So here's a rough outline:
Install or having a working Ubuntu 10.04. If you are doing a fresh install, I recommend using ext3 on your hard disks otherwise you'll have to reconfigure the Xen-Linux kernel.
If you are using 32-bit install libc6-xen (This will get rid of the annoying TLS segmentation message): apt-get install libc6-xen
If you are using 64-bit install 32-bit utils: apt-get install gcc-multilibDownload Xen, either get the Xen 4.0.1 source or get testing. If you want the 4.0.1 source, its faster to download the tar.gz than the entire mecurial repository!
4.0.1 source: wget http://bits.xensource.com/oss-xen/release/4.0.1/xen-4.0.1.tar.gz
Testing source: hg clone http://xenbits.xen.org/xen-4.0-testing.hgBuild Xen, this includes building all tools but not the Xen-Linux Kernel:
cd into the Xen dir
make xen
make tools
make stubdom
make install-xen
make install-tools PYTHON_PREFIX_ARG=
make install-stubdom
Build the Xen-Linux Kernel (if you need to configure the kernel see the bottom of this post):
Optionally configure the kernel especially if you are using ext4 (see below)
make kernels
make install-kernels
Figure out kernel version by looking at the .config file in the kernel build path (typically starts with: build-linux-2.6-pvops_), so typing "head build-linux-2.6-pvops_x86_32/.config" in 32-bit case will print out the "Linux kernel version" near the top (the current version is 2.6.32.26)
update-initramfs -c -k [kernel version]
Making Xend auto-start:
update-rc.d xend defaults 20 21
Update Grub
Place this in /etc/grub/40_custom:
menuentry "Xen-Testing - Linux 2.6.32.26" {Note: you can obtain your disks partition (hd0,1) by running blkid on the device, the default device will usually be /dev/sda1 (e.g., blkid /dev/sda1). Also feel free to adjust dom0_mem
insmod ext2
set root="(hd0,1)"
multiboot /boot/xen.gz dom0_mem=256M
module /boot/vmlinuz-2.6.32.26 ro nomodeset root=UUID=24aece87-9b12-4966-8c04-4bd59d5808ae
module /boot/initrd.img-2.6.32.26
}
Finally update grub:
update-grubReboot into Xen. While testing you should leave the default boot into your regular kernel. Hold shift during reboot to access a grub menu and select Xen. Determine which grub entry Xen, hint, they are incremented in order from 0 to N. In my case, it was 6, so edit the /etc/default/grub and replace 0 with 6 on the line "GRUB_DEFAULT". The next step is to create a domU!
By The way, you can use 'blkid' to get device UUIDs instead of looking into your grub.cfg
ReplyDeleteYogesh : hi
ReplyDeleteI have follow all steps but I cant found any xen.gz file in /boot directory
please Can you give any suggestion over this?
thanking in anticipation
Thanks Timo, great point, I'll fix that.
ReplyDeleteYogesh, did you miss the "make install-xen" That should cover your issue. Are there any xen* files in /boot?
Hi.
ReplyDeleteGreat tutorial by the way.
I followed your tutorial exactly.
But I cannot boot into the Xen-kernel.
Is this because of wrong configuration in the .config file??
Can you please post how to configure the .config to enable the ext4 support?
Please help.
Ram, the easiest way to do this is after make prep-kernels, cd into the build dir (build-linux-2.6-pvops_x86_32) and type make menuconfig. Enable ext4 from the file systems menu. There are a plethora of tutorials for make menuconfig if you run into any problems.
ReplyDeleteHi David
ReplyDeleteNice blog.
While executing make xen installation i am getting the following:
grant_table.c:733:22: error: variable ‘old_pin’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[4]: *** [grant_table.o] Error 1
make[4]: Leaving directory `/root/xen-4.0.1/xen/common'
make[3]: *** [/root/xen-4.0.1/xen/common/built_in.o] Error 2
make[3]: Leaving directory `/root/xen-4.0.1/xen/arch/x86'
make[2]: *** [/root/xen-4.0.1/xen/xen] Error 2
make[2]: Leaving directory `/root/xen-4.0.1/xen'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/root/xen-4.0.1/xen'
make: *** [install-xen] Error 2
Please look into this. I have searched around on google, couple of more people got this error, but the resolution was not given anywhere.
Kindly suggest.
Many Thanks
You should carefully examine errors. This is a rather trivial compiler error that says in your makefile you've specified -Werror. Unset that and you should be good to go.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHello David,
ReplyDeleteI am just posting to say thanks for this awesome tutorial !
It was the only one helping me finally install XEN on ubuntu 10.04... !! but when i boot on it ( holding shift and choosing it ) I get some messages (no errors) and then a black screen and nothing happens.. :/ Am i missing something ? i am totally new into this.
Many thanks again ..
Unfortunately I haven't played with Xen in years and your computer's output isn't very helpful. If the computer isn't panicing and rebooting, I'm not sure I can offer you much advice. I would try using a virtual machine and see if you can succeed there. Also I would hope that you can find a modern distribution that works well with Xen, 10.04 is nearly 5 years old :).
ReplyDeleteI managed to boot and make it work :-) but not with 10.04 with 12.04! Indeed 10.04 were way too old . .
ReplyDeleteThanks again !