Ubuntu Lucid on XenServer 5.6 FP1

Describes howto install Ubuntu Lucid 10.04 LTS (32-Bit or 64-Bit) on a Citrix XenServer 5.6 FP1 and convert the virtual machine into a template.

Note: Click to enlarge a picture.

1. Create a new virtual machine

Select template “Ubuntu Lucid Lynx 10.04 (64-bit)” and choose name and description for your virtual machine (or 32-Bit if necessary). Select “Install from URL” and insert the URL http://archive.ubuntu.net/ubuntu

xl1xl2xl3

Specify the number of vCPUs and the memory for your virtual machine and create the virtual disks.

xl4xl5

I choose a 8 GB Disk for the system and 1 GB for the swap disk.Ich habe eine 8 GB Disk für das System gewählt und eine 1 GB Disk für SWAP.
By using 2 different disks i can delete the swap partition if i don’t need it or can replace disks with bigger ones.

At least add network interfaces to your VM. This depends on your XenServer network setup. Choose a bonding or single interface here for example and finish the virtual machine wizzard.

XenServer now builds your virtual machine and start it.

If the virtual machine is ready open the console to the virtual machine and start the installation of Ubuntu:

xl6xl7xl8

Choose your country and keyboard layout and configurate the network interface.
If you don’t have a DHCP Server in your network you choose “manual” and configurate the network by hand.

xl9xl10xl11xl12

Enter the hostname and domain name. In this example, my system is called xen.local, so I enter xen and local:

xl13xl14

Choose a mirror of the Ubuntu archive.
Please check if the installer detected your time zone correctly. If so, select Yes, otherwise No.

xl15xl16

Partitioning

Now you have to partition your hard disks.
First select “manual” and select the first virtual disk “xvda”. Create a new empty partition table and select the free disk space to create a new partition.
Use this partition as “Ext4 journaling file system” and as “/” mount point.

xl17xl18xl19xl20xl21

xl22xl23xl24

 

Now repeat all with “xvdb” but now create a “swap area”.

xl26xl27xl28xl29

The partitioning is totally up to you – if you know what you’re doing, you can also set up different partitions.
At least “Finish partitioning” and select “Yes” when you are asked “Write the changes to disks”. Now the new partitions are being created and formatted.

Afterwards the base system is being installed:
xl30

Create a user, for example the user “sebastian” with the user name “sebastian”:

xl31xl32xl33xl34

Note: I don’t need an encrypted private directory, so I choose No here.

Next the package manager apt gets configured. Leave the HTTP proxy line empty unless you’re using a proxy server to connect to the Internet.
I select “No automatic updates”. Of course, it’s up to you what you select here. But on a server i usually want to install the updates by myself.

Make your choce about automatic updates. Now the installer installs the system and download some essential packets. Make a small software selecten. I choose “Basic Ubuntu server” and “OpenSSH server” to get a small virtual machine.

xl35xl36xl37xl38

Now the GRUB boot loader gets installed. Select “Yes” when you are asked “Install the GRUB boot loader to the master boot record?”.

xl39xl40xl42

The base system installation is now finished. Hit “Continue” to reboot the system.

2. Install XEN Tools

In XenCenter, attach “xs-tools.iso” to the DVD drive of the VM.Verbinde im XenCenter “xs-tools.iso” mit der virtuellen Maschine.
Mount “xs-tools.iso”, install the correct XenServer Tools package (replace amd64 with i386 if necessary) and unmount “xs-tools.iso”.

mount /dev/cdrom /mnt
dpkg -i /mnt/Linux/xe-guest-utilities_5.6.100-647_amd64.deb
umount /mnt/

At least reboot the VM. Make sure the services run at boot time. If not try this:

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

Reboot the VM for the last time.

3. Convert to template

Install all software on your virtual machine you need on all virtual machines and make all settings you need.

After you have made all your changes and settings shut down the virtual machine.

“Right click” on the virtual machine in your inventory and select “Convert to Template”.

Now you can create new virtual machines with a basic setup for your environment.

Select “New VM from template” and choose your custom template.

This Post Has 8 Comments

  1. Thanks! Excellent article.

    1. Thanks a lot. Just 2 quotes :
      – I had to use ftp://archive.ubuntu.com/ubuntu as repository but I couldn’t figure out why
      – To deal with the bug in ubuntu kernel that crashes the VM passing fron host to host in a xen cluster I installed linux-image-virtual-lts-backport-natty and linux-headers-virtual-lts-backport-natty from ppa repository

      bye

  2. What is the purpose of the install Xen Tools step?

    1. What do you mean ?
      I want to install the xen server tools on every machine. So i installed it 🙂 before create the template.
      If you create a new virtual machine from the template, the tools are already installed.

  3. Good info about the template creation – a lot of people don’t realize that and they spend the time to create a new one from scratch each time!

  4. Brilliant tutorial – worked perfectly first time.

    P.S.: I lost your site for a bit – managed to close it before I had made a note of it – took a moment to find you again – but well worth the effort.

    Soooo, thank you! 🙂

Schreibe einen Kommentar

eMail-Benachrichtigung bei weiteren Kommentaren.
Auch möglich: Abo ohne Kommentar.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.