Xen: The Future of Virtualization?


Since 2003, researchers at Cambridge University in Britain have been working on a new method of virtualizing operating systems. Their project, called Xen, reached a critical mass of support in early 2005.

Unlike VMware, which builds a complete virtual machine, Xen is a hypervisor, a layer that doesn't quite go that far. This technology vastly improves the performance of guest operating systems in tests to nearly native performance. This requires each OS kernel to be modified slightly to run on Xen. How SUSE Linux implements this is by using the standard kernel for a standard installation, and putting the Xen virtual machine into /var/tmp/dirinstall, and then using the bootloader application to boot to either the Xen kernel or the standard kernel.

Xen developers have ported several open source kernels, including the 2.4 and 2.6 Linux kernels, NetBSD Unix, FreeBSD Unix, and the Plan9 OS. So you can use Xen today to run several Linux distributions side by side with a copy of FreeBSD to spare. This might be entertaining for some users, but is especially useful to programmers hoping to solve distribution-related problems.

The key question for many users is whether Windows will join the list of supported OSs at some point. License restrictions prevented an early Windows XP port from being released. Intel is expected to release new processors in 2005 that will include a virtualization technology that will help Xen support Windows to some extent. You should not see all the performance you get with directly ported kernels, but the application support on these processors may well exceed Wine's.

SUSE Linux 9.3 was the first Linux distribution to include a copy of Xen, even integrating it into YaST. Open the YaST Software page and you will see the option for Installation to Directory for Xen. When you select this module, a screen very much like the initial YaST install screen (Figure 11.8) will appear.

Figure 11.8. Installing SUSE Linux into a Xen directory via YaST is nearly identical to the standard installation. Use this screen to select the software to install, and to configure Xen-specific options.


Caution

Because Xen is relatively new technology, using it is not entirely for the faint of heart. You need to edit your bootloader files manually, and initialize a Xen-specific kernel. Though the risk of losing data is small, it is highly prudent to back up your data before going on this adventure.


Notice that the Target Directory where the Xen installation will go is var/tmp/dirinstall. This directory will host the Xen kernel and the associated virtual machine.

YaST will then check its installation source module for the location of its packages. If you have multiple sources (such as a Downloads directory for new RPMs) listed here, you may choose to disable everything but the standard install location, usually meaning your SUSE Linux CD. By default, YaST installs the Standard System with KDE, but you can install any variation of this by clicking the Change button at the bottom of this screen. When you have made your selections, click Next to begin installing the packages into the target directory.

Before trying to access this installation, however, you must edit (as the SuperUser) your /boot/grub/menu.lst file (after first backing it up). Add this entry at the bottom of the file:

###Add Xen to the bootlist### 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 

Make sure that the numbers inside the (hd) parentheses are identical (1,1) to the first Linux entry, as the directory is located on the same physical hard drive. Save and exit from the editor.

SUSE Linux engineers recommend running these commands as the SuperUser in the shell:

To disable TLS support:

mv /lib/tls /lib/tls.disabled 

To enable xend service:

chkconfig xend on 

To enable xendomains service:

chkconfig xendomains on 

Now create /var/tmp/dirinstall/etc/fstab with these values:

/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 

Next, initialize the Xen kernel with these commands (this will likely take some time):

chroot /var/tmp/dirinstall/ mkinitrd -s off 

The chroot command moves you into the target directory, so your commands from that point on will apply to the Xen installation, not your running system.

When mkinitrd is finished, type passwd to assign a Root password for the Xen installation. Lastly, enter these commands to 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 

You should now be ready to reboot your system. When grub loads the bootloader menu, select Xen 2.0 from the list. Log in as Root with your password, and you should be able to add users (including yourself), and otherwise configure your "new" system.

Xen 3.0, expected late in 2005, will add direct support for 64-bit architectures, though the current 32-bit version 2.0.5 appears to work well enough in 64-bit machines.



SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net