How to run virtual machines (on Fedora fc6)

See Also: http://fedoraproject.org/wiki/FedoraXenQuickstartFC6

WikiPedia:Xen is just one virtualization choice. (See WikiPedia:Comparison_of_virtual_machines.) WikiPedia:Paravirtualization is faster than real virtualization and, conveniently, works for linux. Xen embeds a WikiPedia:Hypervisor into the host's kernel. They hypervisor is very small but is what allows divides up resources between running host and guest operating systems. The host linux (containing the hypervisor) is special and is called domain0 (domain-zero). And it also contains special drivers for I/O and memory management.

The core Xen tool is xm.

Installing Xen Host

The fedora guide is quite clear.

  • yum install kernel-xen xen virt-manager
  • Modify grub to boot the xen kernel

Installing Xen Guests

Xen guests have a filesystem (stored in a file or partition) and a configuration file (usually stored in /etc/xen).

Recommended configuration:

  • Para-virtualization (faster)
  • Pre-create a LVM partition. (You could store the new machine in a file if you prefer.)
    • The default is to put partitions inside the LVM partition
    • It is also possible to import multiple partitions into the VM so that their easier to mount by the host
  • Memory > 512MB. (Just a suggestion)
  • Install Location: http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os

There are a number of ways to install guest systems.

  • Use an existing image and create a new xen configuration file.
  • Bootstrap the VM and install a guest OS
    • Can boot from a CD-ROM or CD-ROM image
    • Install from network

The easiest way to install a guest is to use one of several tools.

  • virt-install - command line tool
  • virt-manager - X11 tool that is somewhat easier to use

Starting Xen Guests

xm create /etc/xen/<name>

The xendomains daemon is what automatically starts and stops domU-s on reboot of the host. To use it, first, /lib/lsb/init-functions needs to be patched. (See the version on harry.) Second, move any domU-s you want controlled from /etc/xen to /etc/xen/auto when they're not running.