Line 81: | Line 81: | ||
5. Run the Script | 5. Run the Script | ||
~/Makepv.sh | ~/Makepv.sh | ||
+ | |||
+ | |||
+ | |||
+ | == What to do if the VM doesn't boot after running Makepv.sh == | ||
+ | |||
+ | xe vm-param-set uuid=<DEVICE_UUID> HVM-boot-policy="BIOS order" | ||
+ | xe vm-param-set uuid=<DEVICE_UUID> PV-bootloader= | ||
+ | xe vm-param-set uuid=<DEVICE_UUID> PV-args= | ||
+ | xe vbd-param-set uuid=<VBD_UUID> bootable=false | ||
+ | |||
+ | You can get <DEVICE_UUID> by: | ||
+ | xe vm-list name-label=<VM_NAME> | ||
+ | |||
+ | You can get the <VBD-UUID> by: | ||
+ | xe vm-disk-list uuid=<DEVICE_UUID> | ||
+ | |||
Revision as of 18:20, 30 May 2010
Contents
Ubuntu 10.04 LTS
Install
Within XenServer Create a new VM using the "Other Install Media".
Choose an Ubuntu amd64 ISO, i386 ISO's don't seem to work.
NOTE: XenServer 5.5 doesn't support booting from the ext4 file system! During the install process make sure to format the / partition as ext3 or create a separate /boot partition formatted as ext3 so that XenServer can access the boot images.
Make sure to enable OpenSSH either during the install or upon first boot.
After the install is finished, boot the new VM.
If you didn't enable SSH access during install, now is the time to do it:
sudo apt-get install openssh-server
Modifications to the Guest OS
We need to create console for Xen, the easiest way to do this is to copy tty1.conf to hvc0.conf
Duplicate /etc/init/tty1.conf
cd /etc/init sudo cp tty1.conf hvc0.conf
Do an inline find and replace with sed
sudo sed -i 's/tty1/hvc0/g' hvc0.conf
Collect Boot Information
We need to gather some info for the next step. Go to the directory containing the grub configuration file:
cd /boot/grub/
Now edit grub.cfg and find the following line (the lines may differ from yours as the kernel may have been updated since this writing). You want the following information:
- Kernal
- Boot Arguements
- Boot Image
It should look something like this:
### BEGIN /etc/grub.d/10_linux ### menuentry 'Ubuntu, with Linux 2.6.32-21-server' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod ext2 set root='(hd0,1)' search --no-floppy --fs-uuid --set 96ae5c39-aed3-4fb8-821b-c8f7463d7c76 linux /boot/vmlinuz-2.6.32-21-server root=UUID=96ae5c39-aed3-4fb8-821b-c8f7463d7c76 ro quiet initrd /boot/initrd.img-2.6.32-21-server }
We are looking for these lines:
linux /boot/vmlinuz-2.6.32-21-server root=UUID=96ae5c39-aed3-4fb8-821b-c8f7463d7c76 ro quiet initrd /boot/initrd.img-2.6.32-21-server
Kernel
/boot/vmlinuz-2.6.32-21-server
Boot Arguments
root=UUID=96ae5c39-aed3-4fb8-821b-c8f7463d7c76 ro quiet
Boot Image
/boot/initrd.img-2.6.32-21-server
Shutdown the VM
Shut down the VM
halt -p
MakePV Script
This script will automate the process of converting the VM to PV
First you need to get the script to your XenServer Host.
1. Connect to your XenServer Hosts Console (via XenCenter or SSH)
2. move to your home directory
cd ~/
3. Get the makepv.sh script
wget http://wiki.ledhed.net/images/Makepv.sh
4. Now make the script executable
chmod +x Makepv.sh
5. Run the Script
~/Makepv.sh
What to do if the VM doesn't boot after running Makepv.sh
xe vm-param-set uuid=<DEVICE_UUID> HVM-boot-policy="BIOS order" xe vm-param-set uuid=<DEVICE_UUID> PV-bootloader= xe vm-param-set uuid=<DEVICE_UUID> PV-args= xe vbd-param-set uuid=<VBD_UUID> bootable=false
You can get <DEVICE_UUID> by:
xe vm-list name-label=<VM_NAME>
You can get the <VBD-UUID> by:
xe vm-disk-list uuid=<DEVICE_UUID>
Graphical Console
The "Desktop" and "Alternate" distributions of Ubuntu boot into X11/Gnome. In order to access the Gnome session from XenCenter (rather than the CLI console) you need to enable VNC on Ubuntu and setup gdm to call vnc on display 0.
NOTE: Most tutorials involving gdm/VNC involve setting up xinetd, but if you have any packages that require openbsd-inetd (like LTSP) then you cannot install xinetd. Here is a link for running vnc as a service from openbsd-inetd.
Files
Reference HowTo in PDF
Ubuntu_10.04_XenServer_HowTo.pdf
XenServer Host Script for making a VM a PV.
Makepv.sh
References
PV / XS-Tools
http://www.bishopbarrington.net/wiki/howto/lucidonxenserver
Graphical Console for PV VM's
https://help.ubuntu.com/community/Xen#GNOME%20as%20domU%20guest
http://community.citrix.com/display/ocb/2008/07/02/Installing+Ubuntu+on+XenServer