install suse as xen guest

This is a short howto on installing suse-based distributions (SUSE Linux, SLES, openSUSE) as xen guest. It also has some probably useful background information in the suse installation process.

install domUloader

If you are running suse on the host machine too you can skip that part, most likely you have domUloader already installed as it is included in the suse xen packages. Otherwise you should get domUloader here as this is the best way to boot suse guests.

create xen guest config file

Well, that works as usual. Easiest way is to pick some example config file and adapt it according to your needs. Check out /etc/xen or use the domUloader sample config file).

I suggest to pick a fixed MAC address for your virtual machine. Otherwise xen assigns a random address which changes each time you boot the virtual machine. This makes suse think it as a new network card installed each boot because suse tries to identify them by MAC address.

create kernel and initrd for installation

Getting kernel and initrd which are needed to boot the installer probably is the most tricky part of the install process. You need:

Put all items into one directory and simply run the script, it will create kernel and ramdisk files suitable for installation.

boot first stage install

Boot your virtual machine using the kernel and initrd created in the previous step. You don't have to edit the config file for that, you can simply override the config options on the command line like this:

# xm create -c /path/to/suseguestconf \
	kernel=/path/to/inst.xen-version-kernel \
	ramdisk=/path/to/inst.xen-version-ramdisk \
	on_reboot=destroy \
	memory=256 \
	extra="kernel command line options"

The onreboot=destroy is needed to avoid that the reboot issued after finishing the first stage install kicks the first stage install again. For the installation you should give the machine at least 256 MB of memory because the installer runs out of a ramdisk. More memory makes it run faster. The minimum memory requirements for the installed system are not that high.

There are a number of useful kernel command line options you might want to pass via extra="...":

install=URL
Specify where to install from. You can point to a local install server or even to a opensuse mirror in the internet. http,ftp and nfs protocols are accepted.
rescue=1
Load the rescue system, not the installer. Useful to test-drive your config file.
textmode=1
Ask for textmode install.
ssh=1 sshpassword=yoursecrethere
Install remotely via ssh.
vnc=1 vncpassword=yoursecrethere
Install remotely via vnc.

boot installed machine (and second stage install)

Once the first stage install is done the virtual machine should be configured to boot /boot/vmlinuz-xen and /boot/initrd-xen from the guest hard disk using domUloader. The lines in the config file should look like this (might need adaption):

bootloader = "/usr/lib/xen/boot/domUloader.py"
bootentry = "hda1:/boot/vmlinuz-xen,/boot/initrd-xen"

On the first boot the second install stage kicks in and completes the installation.

you are done

Enjoy!