This page deals with using Fedora to host virtual guests. For information on using Fedora as a virtual guest, see Installing a Fedora Virtual Machine. For information the different virtualization technologies available in Fedora, see the dedicated page.

At least 256MB of RAM per guest plus 256 for the base OS. At least 756MB is recommended for each guest of a modern operating system. A good rule of thumb is to think about how much memory is required for the operating system normally and allocate that much to the virtualized guest.

KVM requires a CPU with virtualization extensions, found on most consumer CPUs made in the past couple years. These extensions are called Intel VT or AMD-V. To check whether you have proper CPU support, run the command:

$ egrep '^flags.*(vmx|svm)' /proc/cpuinfo

If NOTHING is printed, your system does not support the relevant extensions. You can still use the QEMU/KVM, but the emulator will fall back to software virtualization, which is FAR FAR slower.

Installing the virtualization packages

When installing Fedora, the virtualization packages can be installed by selecting Virtualization in the Base Group in the installer.

For existing Fedora installations, QEMU, KVM, and other virtualization tools can be installed by running the following command which installs the virtualization group:

su -c "yum install @virtualization"

This will install qemu-kvm, python-virtinst, qemu, virt-manager, virt-viewer and all dependencies are needed.

Networking Support

By default libvirt will create a private network for your guests on the host machine. This private network will use a 192.168.x.x subnet and not be reachable directly from the network the host machine is on, but virtual guests can use the host machine as a gateway and can connect out via it. If you need to provide services on your guests that are reachable via other machines on your host network you can use iptables DNAT rules to forward in specific ports, or you can setup a Bridged env.

Creating a Fedora guest

The installation of Fedora guests using anaconda is supported. The installation can be started on the command line via the virt-install program or in the GUI program virt-manager.

Creating a guest with virt-install

virt-install is a command line based tool for creating virtualized guests. To start the interactive install process, run the virt-install command with the --prompt parameter.

su -c "/usr/bin/virt-install --prompt"

The following questions for the new guest will be presented.

What is the name of your virtual machine? This is the label that will identify the guest OS. This label is used with virsh commands and virt-manager(Virtual Machine Manager).

How much RAM should be allocated (in megabytes)? This is the amount of RAM to be allocated for the guest instance in megabytes (eg, 256). Note that installation with less than 256 megabytes is not recommended.

What would you like to use as the disk (path)? The local path and file name of the file to serve as the disk image for the guest (eg, /var/lib/libvirt/images/name.img). This will be exported as a full disk to your guest. It's best to specify the default /var/lib/libvirt/images/ directory.

How large would you like the disk to be (in gigabytes)? The size of the virtual disk for the guest (only appears if the file specified above does not already exist). 4.0 gigabytes is a reasonable size for a "default" install

What is the install CD-ROM/ISO or URL? This is the path to a Fedora installation tree in the format used by anaconda. NFS, FTP, and HTTP locations are all supported. Examples include:

nfs:my.nfs.server.com:/path/to/test2/tree/

http://my.http.server.com/path/to/tree/

ftp://my.ftp.server.com/path/to/tree

These options can be passed as command line options, execute virt-install --help for details.

virt-install can use kickstart files, for example
virt-install -x ks=kickstart-file-name.ks.

If graphics were enabled, a VNC window will open and present the graphical installer. If graphics were not enabled, a text installer will appear. Proceed with the fedora installation.

Creating a guest with virt-manager

Start the GUI Virtual Machine Manager by selecting it from the "Applications-->System Tools" menu, or by running the following command:

su -c "virt-manager"

If you encounter an error along the lines of "Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash", trying running virt-manager not as root (without the su -c). The GUI will prompt for the root password.

Open a connection to a hypervisor by choosing File-->Add connection...

Choose "qemu" for KVM, or "Xen" for Xen.

Choose "local" or select a method to connect to a remote hypervisor

After a connection is opened, click the new icon next to the hypervisor, or right click on the active hypervisor and select "New" (Note - the new icon is going to be improved to make it easier to see)

A wizard will present the same questions as appear with the virt-install command-line utility (see descriptions above). The wizard assumes that a graphical installation is desired and does not prompt for this option.

On the last page of the wizard there is a "Finish" button. When this is clicked, the guest OS is provisioned. After a few moments a VNC window should appear. Proceed with the installation as normal.

Bugs in the virt-manager tool should be reported in BugZilla against the 'virt-manager' component

Managing guests with virsh

The virsh command line utility that allows you to manage virtual machines.
Guests can be managed on the command line with the virsh utility. The virsh utility is built around the libvirt management APIl:

virsh has a stable set of commands whose syntax and semantics are preserved across updates to the underlying virtualization platform.

virsh can be used as an unprivileged user for read-only operations (e.g. listing domains, listing domain statistics).

virsh can manage domains running under Xen, Qemu/KVM, esx or other backends with no perceptible difference to the user

Bugs in the virsh tool should be reported in BugZilla against the 'libvirt' component.

Other virtualization options

QEMU/KVM without Libvirt

QEMU/KVM can be invoked directly without libvirt, however you won't be able to use tools such as virt-manager, virt-install, or virsh.
Plain QEMU (without KVM) can also virtualize other processor architectures like ARM or PowerPC. See How to use qemu

OpenNebula

oVirt

The oVirt project is an open virtualization project providing a feature-rich, end to end, server virtualization management system with advanced capabilities for hosts and guests, including high availability, live migration, storage management, system scheduler, and more.