Posterous theme by Cory Watilo

Filed under: ubuntu

Setting up Ubuntu 10.4 on Citrix ZenServer 5.5 DomU

This is how I got Ubuntu 10.4 64bit running under DomU on Citrix ZenServer 5.5. I’m not sure if the 32bit version can install in DomU — I’ve been told only the 64bit Kernels include the citrix modules   First off, start out by setting up a new machine.

Screen_shot_2010-04-15_at_6
Next, let the auto partitioner set up the disk, but don’t write the changes yet.
Screen_shot_2010-04-15_at_7
Next, edit the partition table.  Delete the primary partition, leaving the swap.
Screen_shot_2010-04-15_at_7
0screen_shot_2010-04-15_at_7
Screen_shot_2010-04-15_at_7
Next, create a 256Mb primary partition at the beginning with Ext 2 with a mount point of /boot
Screen_shot_2010-04-15_at_7
Then create an Ext 4 primary partition with a mount point of /
Screen_shot_2010-04-15_at_7
Write the changes to disk and continue the install as normal
0screen_shot_2010-04-15_at_7
After the installation, Ubuntu will reboot into HVM mode.  Login and run the following commands  

sudo aptitude update  
sudo aptitude safe-upgrade

Next, follow the instructions I found on http://brettshaffer.com/blog/linux/downgrade-grub-2/ to downgrade Grub2 to Grub1

sudo cp /etc/default/grub /etc/default/grub.old
sudo cp -R /etc/grub.d /etc/grub.d.old
sudo cp -R /boot/grub /boot/grub.old

sudo apt-get purge grub-common grub-pc
-- answer yes to remove grub2

sudo apt-get install grub
sudo update-grub
sudo grub-install /dev/sdX

echo "grub hold" | sudo dpkg --set-selections

  Then set up getty to listen to the hvc0 console

cd /etc/init
cp tty1.conf hvc0.conf

Change all references from tty1 to hvc0 In your fstab, change /dev/scd0 to /dev/xvdd. Reboot into HVM again to make sure the grub install went okay

Look in the /boot directory and copy down the vmlinuz & initrd versions

ssh into the xen console:

find the machine and copy the uuid of it:

xe vm-list

once you have that:

xe vm-param-set uuid=uuid-of-machine HVM-boot-policy=
xe vm-param-set uuid=uuid-of-machine PV-bootloader=pygrub
xe vm-param-set uuid=uuid-of-machine PV-bootloader-args="--kernel /vmlinuz-2.6.31-20-server --ramdisk /initrd.img-2.6.31-20-server"
xe vm-param-set uuid=uuid-of-machine PV-args="root=/dev/xvda3 console=hvc0"

find the uuid of the VBD

xe vm-disk-list uuid=uuid-of-machine
xe vbd-param-set uuid=uuid-of-vbd bootable=true

check to make sure the boot partition is readable

xe-edit-bootloader -u uuid-of-machine -p 1

start the VM – The VM should start in PV mode – Reboot and Shutdown buttons should be active now.

—hint: if you can’t type in the console, you may have to restart citrix center

Login and start an sh shell instead of bash

Mount the xs-tools.iso and install the tools. You’ll get an “Unexpected Operator” message, but the tools install.

sudo mount /dev/xvdd /mnt
cd /mnt/Linux
sudo dpkg -i xe-guest-utilities_5.5.0-466_amd64.deb

Now, the suspend button should be active. Edit the /boot/grub/menu.lst and change the value of indomU to false so that grub will pick up the standard kernels. Also, set the value of groot=(hd0) and update grub again

sudo update-grub

Now, go back to the xen ssh session and clear out the PV-bootloader-args

xe vm-param-set uuid=889ee104-56a7-c5db-677a-f4ec71d63fb8 PV-bootloader-args=

Reboot! Your server should be running in DomU mode and should be booting from the grub menu. When your kernel updates, it will automatically be picked up now and become the default kernel.

Screen_shot_2010-04-15_at_8

I did have some issues with the tools not always starting correctly. I rectified that by moving them back in the boot order.

sudo update-rc.d -f xe-linux-distribution remove

sudo update-rc.d xe-linux-distribution defaults 86