{"id":289,"date":"2012-02-02T17:20:46","date_gmt":"2012-02-02T15:20:46","guid":{"rendered":"http:\/\/www.rinta-aho.org\/blog\/?p=289"},"modified":"2015-11-03T10:14:18","modified_gmt":"2015-11-03T08:14:18","slug":"xen-ubuntu-11-10-as-dom0-and-domu","status":"publish","type":"post","link":"http:\/\/www.rinta-aho.org\/blog\/xen-ubuntu-11-10-as-dom0-and-domu\/","title":{"rendered":"Xen: Ubuntu 11.10 as Dom0 and DomU"},"content":{"rendered":"<p>After spending hours of figuring out how to get Xen virtualization on the latest Ubuntu done as simply as possible, here are the results. Hopefully they are helpful to you.<\/p>\n<p>1) Install packages<\/p>\n<pre>\r\n$ sudo apt-get install xen-hypervisor-4.1-amd64 xen-tools\r\n<\/pre>\n<p>2) Reboot with Xen<\/p>\n<p>Note that there will be a two-stage grub menu. First choose Xen, then choose the kernel from the second menu.<\/p>\n<p>Press ESC during boot to see the menu in the first place if it is hidden.<\/p>\n<p>3) Check that Xen (Dom0) works<\/p>\n<pre>\r\n$ sudo xm list\r\nName\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ID\u00a0\u00a0 Mem VCPUs\u00a0\u00a0\u00a0\u00a0\u00a0 State\u00a0\u00a0 Time(s)\r\nDomain-0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 15289\u00a0\u00a0\u00a0\u00a0 8\u00a0\u00a0\u00a0\u00a0 r-----\u00a0\u00a0\u00a0 126.5\r\n<\/pre>\n<p>4) Fix xen-tools<\/p>\n<pre>\r\n$ sudo cp -R \/usr\/lib\/xen-tools\/karmic.d \\\r\n             \/usr\/lib\/xen-tools\/oneiric.d\r\n$ sudo rm \/usr\/lib\/xen-tools\/oneiric.d\/70-install-ssh\r\n<\/pre>\n<p>This is needed because as of today, the next step will fail due to some strange umount problem related to ssh. There is no need to install ssh immediately, as it can be done later from the console (step 7).<\/p>\n<p>5) Create a virtual machine (DomU) running Ubuntu 11.10 amd64<\/p>\n<pre>\r\n$ sudo xen-create-image \\\r\n    --memory=1G --size=10G --swap=1G \\\r\n    --dist=oneiric --install-method=debootstrap \\\r\n    --dir=\/home\/xen --hostname=xen1 --dhcp\r\n<\/pre>\n<p>Configuration will be stored in \/etc\/xen\/xen1.cfg, virtual disks in \/home\/xen\/domains\/xen1.<\/p>\n<p>Write down the random root password from the installation report.<\/p>\n<p>6) Start up the new virtual machine with console<\/p>\n<pre>\r\n$ sudo xm create xen1.cfg -c\r\n<\/pre>\n<p>You can exit the console by pressing CTRL + ALTGr + &#8216;}&#8217;<\/p>\n<p>You can enter the console later with &#8216;xm console xen1&#8217;.<\/p>\n<p>7) Update (and install) packages in the virtual machine<\/p>\n<pre>\r\nroot@xen1:~# apt-get update &amp;&amp; apt-get dist-upgrade\r\nroot@xen1:~# apt-get install openssh-server\r\n<\/pre>\n<p>8) You&#8217;re done.<\/p>\n<p>To shut down the virtual machine from its (ssh) console:<\/p>\n<pre>\r\nroot@xen1:~# halt -p\r\n<\/pre>\n<p>To later start the virtual machine:<\/p>\n<pre>\r\n$ sudo xm create xen1\r\n<\/pre>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-32 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"http:\/\/www.facebook.com\/sharer.php?u=http%3A%2F%2Fwww.rinta-aho.org%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F289&#038;t=Xen%3A%20Ubuntu%2011.10%20as%20Dom0%20and%20DomU&#038;s=100&#038;p&#091;url&#093;=http%3A%2F%2Fwww.rinta-aho.org%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F289&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=Xen%3A%20Ubuntu%2011.10%20as%20Dom0%20and%20DomU\" style=\"font-size: 0px;width:32px;height:32px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"32\" height=\"32\" style=\"display: inline;width:32px;height:32px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/www.rinta-aho.org\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/addons\/extra-icons\/image\/social\/clearslate\/64x64\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-32 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=http%3A%2F%2Fwww.rinta-aho.org%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F289&#038;text=Xen%3A%20Ubuntu%2011.10%20as%20Dom0%20and%20DomU\" style=\"font-size: 0px;width:32px;height:32px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"32\" height=\"32\" style=\"display: inline;width:32px;height:32px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/www.rinta-aho.org\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/addons\/extra-icons\/image\/social\/clearslate\/64x64\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-32 synved-social-resolution-single synved-social-provider-reddit nolightbox\" data-provider=\"reddit\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Reddit\" href=\"https:\/\/www.reddit.com\/submit?url=http%3A%2F%2Fwww.rinta-aho.org%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F289&#038;title=Xen%3A%20Ubuntu%2011.10%20as%20Dom0%20and%20DomU\" style=\"font-size: 0px;width:32px;height:32px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"reddit\" title=\"Share on Reddit\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"32\" height=\"32\" style=\"display: inline;width:32px;height:32px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/www.rinta-aho.org\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/addons\/extra-icons\/image\/social\/clearslate\/64x64\/reddit.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-32 synved-social-resolution-single synved-social-provider-pinterest nolightbox\" data-provider=\"pinterest\" target=\"_blank\" rel=\"nofollow\" title=\"Pin it with Pinterest\" href=\"https:\/\/pinterest.com\/pin\/create\/button\/?url=http%3A%2F%2Fwww.rinta-aho.org%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F289&#038;media=&#038;description=Xen%3A%20Ubuntu%2011.10%20as%20Dom0%20and%20DomU\" style=\"font-size: 0px;width:32px;height:32px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"pinterest\" title=\"Pin it with Pinterest\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"32\" height=\"32\" style=\"display: inline;width:32px;height:32px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/www.rinta-aho.org\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/addons\/extra-icons\/image\/social\/clearslate\/64x64\/pinterest.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-32 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=http%3A%2F%2Fwww.rinta-aho.org%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F289&#038;title=Xen%3A%20Ubuntu%2011.10%20as%20Dom0%20and%20DomU\" style=\"font-size: 0px;width:32px;height:32px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"32\" height=\"32\" style=\"display: inline;width:32px;height:32px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/www.rinta-aho.org\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/addons\/extra-icons\/image\/social\/clearslate\/64x64\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-32 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Xen%3A%20Ubuntu%2011.10%20as%20Dom0%20and%20DomU&#038;body=http%3A%2F%2Fwww.rinta-aho.org%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F289\" style=\"font-size: 0px;width:32px;height:32px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"32\" height=\"32\" style=\"display: inline;width:32px;height:32px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"http:\/\/www.rinta-aho.org\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/addons\/extra-icons\/image\/social\/clearslate\/64x64\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>After spending hours of figuring out how to get Xen virtualization on the latest Ubuntu done as simply as possible, here are the results. Hopefully they are helpful to you. 1) Install packages $ sudo apt-get install xen-hypervisor-4.1-amd64 xen-tools 2) Reboot with Xen Note that there will be a two-stage grub menu. First choose Xen, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.rinta-aho.org\/blog\/xen-ubuntu-11-10-as-dom0-and-domu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Xen: Ubuntu 11.10 as Dom0 and DomU&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/comments?post=289"}],"version-history":[{"count":11,"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":421,"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions\/421"}],"wp:attachment":[{"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/categories?post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.rinta-aho.org\/blog\/wp-json\/wp\/v2\/tags?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}