Книга: Fedora™ Unleashed, 2008 edition

Installing Xen

Installing Xen

The first step is to convert your current OS to a virtualized guest OS. This is actually a very easy thing to do because, as discussed, domain 0 has special privileges — such as the capability to access hardware directly. As a result, you do not have to reformat your machine: dom0 reads straight from the disk, uses the graphics card, uses the sound card, and so on.

To get started, go to Applications, Add/Remove Software. From the window that appears, choose List view, and then select the following packages: kernel-xen, vnc, and xen. The kernel-xen package provides a Linux kernel that is configured to run on top of Xen without any special privileges, as well as a Linux kernel designed to be used as dom0 so it can access hardware directly. The vnc package is there to make VM management much easier. Finally, the xen package gives you all the tools you need to create and manage virtual machines. Along with these packages, there are several other dependencies that Fedora will automatically resolve for you, so just go ahead and install all the packages.

Because you have installed two new kernels, Fedora updates your Grub boot configuration to make them bootable, but leaves your original, non-Xen kernel as the default. Switch to root and bring up /boot/grub/grub.conf in your favorite text editor. Look for the line "default=2" and change it to read "default=0". This might vary on your machine — set it to the position of the Xen hypervisor kernel in the grub.conf file, remembering that Grub counts from 0 rather than 1. That is, the first OS in the list is considered to be number 0. Note that you should not set the guest kernel as the default because it will not boot—it is designed only to be created on top of the hypervisor (dom0).

Save your changes and reboot, making sure that your new hypervisor kernel is the one that boots. Your system should restart as normal, and you will probably not notice anything different beyond a smattering of "XEN" at the very beginning of the boot phase. But when you are back in control, open a terminal and run uname -r — it should tell you that you are running the Xen hypervisor kernel.

At this point, you are already running as a virtual machine on top of the Xen kernel, but there is no way for you to communicate with the Xen kernel and thus manipulate the virtual machines on the system. To do that, you need to start the Xen daemon, which provides the link between dom0 (where you are working) and the Xen kernel underneath.

Run ps aux | grep xend — if you do not see xend in there, you need to start it yourself by switching to root with su - and then running service xend start. Now run the command xm list, which prints out a list of all the virtual machines that are running and how much RAM they have allocated — you should see Domain-0, which is your current system, in the list.

Оглавление книги


Генерация: 1.373. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз