How to setup SUSE Linux 10.0 under Xen in SUSE Linux 9.3

From openSUSE

image:Dialog-ok.png The procedure in this article was written and tested with version 9.3

Whilst there is no guarantee, it should be applicable to later versions.
If you find this to be incorrect, please help to update this article.

Xen 3.0 (provides 64 bit support) is only available in SUSE 10 or higher, so virtualization for x86_64 is not available for older versions of SUSE Linux.


Contents

Installation

Install the Xen packages with YaST

Grub configuration

Add the following to the grub configuration file /boot/grub/menu.lst (change dom0_mem=XXX to whatever amount of memory you want your host OS to have and other values according to your setup):


title Xen 2.0
 kernel (hd1,1)/xen.gz dom0_mem=393216
 module (hd1,1)/vmlinuz-2.6.11.4-20a-xen root=/dev/hdb3 ro console=tty0
 module (hd1,1)/initrd-2.6.11.4-20a-xen

Fix a few things

Fix a few things:

  • disable TLS support
mv /lib/tls /lib/tls.disabled

Alternative approaches to disabling (Thread Local Storage) support:

a) you could also follow the instructions at http://wiki.xensource.com/xenwiki/XenSpecificGlibc . Yet this is also a drastic solution.

b) export LD_LIBRARY_PATH=/lib so the linker when launching Xen uses non-TLS libraries instead. This seems the most reasonable approach. Where to set this is left to the user as an exercise.


  • enable xend service
chkconfig xend on
  • enable xendomains service
chkconfig xendomains on
  • create some directories we need (must have at least 12GB of space)
mkdir /mnt/loop
mkdir /vm/installsource
mkdir /var/tmp/dirinstall

Image creation

Create an image

dd if=/dev/zero of=/vm/base.img bs=1M count=1 seek=4096
mkreiserfs -q -f /vm/base.img
cp -a /vm/base.img /vm/openSUSE-beta1.img
mount -o loop /vm/openSUSE-beta1.img /var/tmp/dirinstall

Yast repository

Create the YaST repository

Have your ISOs or CD-Rs of SUSE Linux 10.0 beta ready.

  • Install the yast2-instserver package and start YaST --> Miscellaneous --> Installation Server, create any installation source in /vm/installsource, add a repository called 10.0; YaST will ask you for the CDs/ISOs.
  • Go to YaST --> Software --> Change Source of Installation, add a new directory called /vm/installsource/10.0, and disable other sources.

Installation

  • Start Yast --> Software --> Installation into directory for XEN. Install the system of your choice, and do not forget the Xen kernel. There are various unresolved dependencies. Try to solve them by removing/not installing the packages in the bottom window.
  • create /etc/fstab in the root filesystem (/var/tmp/dirinstall/etc/fstab)
/dev/sda1               /                       reiserfs    defaults 1 1
none                    /dev/pts                devpts  gid=5,mode=620 0 0
none                    /dev/shm                tmpfs   defaults 0 0
none                    /proc                   proc    defaults 0 0
none                    /sys                    sysfs   defaults 0 0
  • create initrd
chroot /var/tmp/dirinstall/
mkinitrd -s off
  • set the root password
passwd
  • link /proc/mounts to /etc/mtab
ln -s /proc/mounts /etc/mtab
echo "mount -t proc proc /proc" >> /etc/rc.d/boot.local
echo "ln -s /proc/mounts /etc/mtab" >>/etc/init.d/boot.local
  • exit and reboot
exit
cd
umount /mnt/loop
sync
reboot

Select the Xen 2.0 entry in the bootloader menu. If it works, change the default entry in /boot/grub/menu.lst to the Xen entry. Note: 0 denominates the first entry, 1 the second and so on.

Configuration

Configuration

cd /etc/xen/auto
vi 10.0

Content of 10.0:

kernel = "/boot/vmlinuz-2.6.11.4-20a-xen"
ramdisk = "/boot/initrd-2.6.11.4-20a-xen"
memory = 128
name = "SUSE-10.0"
#vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
disk = ['file:/vm/openSUSE-beta1.img,sda1,w' ]
root = "/dev/sda1 ro"
extra = "5"

Running XEN

Start the VM

xm create  -c /etc/xen/auto/10.0

Other possibilities

Once it is started, you can also:

  • manually configure network (yast lan)
  • disable unneeded services (powermanagement, hwclock, etc.)
  • have a look at /usr/share/doc/packages/xen/boot.local.xenU and copy the boot command line parsing bits into the new domain
  • set up nomachine by using the FreeNX and NX packages and running
nxsetup --install --setup-nomachine-key

See also How to install VMware 5.0 workstation on SUSE Linux 10.0