21.7. Creating a new guest

21.7. Creating a new guest

virt-manager is the desktop application which can be used to manage guests.

You can use Red Hat's Virtual Machine Manager to:

Before creating new guest virtual machines you should consider the following options. This list is a summery of the installation process using the Virtual Machine Manager.

VNC is used for graphical installations.


You must install Red Hat Enterprise Linux 5, virt-manager, and the kernel packages on all systems that require virtualization. All systems then must be booted and running the Red Hat Virtualization kernel.

If virt-manager is not working properly...

If virt-manager is not working, it is usually due to one of these common problems:

  1. you have not booted the correct kernel. Verify you are running the kernel-xen kernel by running uname.

    $ uname -r

    If the kernel-xen is installed it must be enabled in grub, seeChapter 23, Configuring GRUB. If the Red Hat Virtualization packages are not installed, see Chapter 4, Installing Red Hat Virtualization packages on the host.

  2. the virtualization extensions are not enabled or available on your hardware. Verify your hardware has the virtualization extensions for full virtualization, read Chapter 1, System requirements.

  3. virt-manager is not installed. To install Red Hat Virtualization, read Chapter 4, Installing Red Hat Virtualization packages on the host.

For other issues see the troubleshooting section, Part VII, “Troubleshooting”.

These are the steps required to install a guest operating system on Red Hat Enterprise Linux 5 using the Virtual Machine Monitor:

Procedure 21.1. Creating a guest with virt-manager
  1. From the Applications menu, select System Tools and then Virtual Machine Manager.

    The Virtual Machine Manager main window appears.

    Virtual Machine Manager window
    Figure 21.6. Virtual Machine Manager window

  2. From the File menu, select New machine.

    Selecting a new machine
    Figure 21.7. Selecting a new machine

    The Creating a new virtual system wizard appears.

  3. Click Forward.

    Creating a new virtual system wizard
    Figure 21.8. Creating a new virtual system wizard

  4. Enter the name of the new virtual system, this name will be the name of the configuration file for the virtual machine, the name of the virtual disk and the name displayed by virt-manager's main screen.

    Choose para-virtualization or full virtualization (hardware virtualization). Now you can continue by clicking the Forward button.

    Naming the virtual system
    Figure 21.9. Naming the virtual system


    Do not use the kernel-xen as the file name for a Red Hat Enterprise Linux 5 fully virtualized guest. Using this kernel on fully virtualized guests can cause your system to hang.

  5. Choose a virtualization method to use for your guest, either para-virtualization or full virtualization.

    Fully virtualized guests do not use the kernel-xen kernel

    If you are using an Installation Number when installing Red Hat Enterprise Linux on a fully virtualized guest, be sure to deselect the Virtualization package group during the installation. The Virtualization package group option installs the kernel-xen kernel.

    Para-virtualized guests are not affected by this issue. Para-virtualized guests always use the kernel-xen kernel.

  6. Enter the location of your install media. The location of the kickstart file is optional. Then click Forward .

    Locating the installation media for para-virtualized guests
    Figure 21.10. Locating the installation media for para-virtualized guests

    Storage media

    For installation media on an http server the address should resemble "http://servername.example.com/pub/dist/rhel5" where the actual source on your local host is /var/www/html/pub/dist/rhel5.

    For installation media on an ftp server the address should resemble "ftp://servername.exampe.com/dist/rhel5", where the actual source on your local host is /var/ftp/pub/dist/rhel5.

    For installation media on an NFS server the address should resemble "nfs:servername.example.com:/dist/rhel5". The actual location depends on your NFS share. Use the system-config-nfs command to configure NFS to share media.

    For more information on configuring these network services read the relevant sections of your Red Hat Enterprise Linux Deployment Guide in the System->Documentation menu.

    Networked installation media must be accessible

    The installation media and kickstart files must be accessible for the host and the guest in order to install. You must take into account the IP address of both host and guest and you may need to use the IP addresses instead of hostnames.

    Tip: networked media for para-virtualization

    You can use an iso image, a local CD-ROM or DVD to install para-virtualized guests. To enable this, mount the iso file or disk and host the image with NFS. To mount an iso image locally use the command:

    # mount -o loop image.iso /mountpoint

  7. For fully virtualized guests you must use an .iso file, CD-ROM or DVD.

    Locating installation media for fully virtualized guests
    Figure 21.11. Locating installation media for fully virtualized guests

  8. Install either to a physical disk partition or install to a virtual file system within a file.


    This example installs a virtual system within a file.

    The default SELinux policy only allows storage of virtualization disk images in the /var/lib/xen/images folder.

    To install images at a different location, /virtimages for example, open a terminal and create the /virtimages directory and set the SELinux policy settings with the command restorecon -v /virtimages. Specify your newly created location and the size of the virtual disk, then click Forward.

    A time saving tip

    Creating a new disk image may take a while depending on the size and your system configuration. You can create a file before hand by using dd – for example to build an empty 6GB file you could use:

    dd if=/dev/zero of=osimage.img bs=1048576 count=6144

    Remember if you have created this file outside of the /var/lib/xen/images folder the file will need SELinux settings changed. Change the SELinux policy for the file with the command:

    restorecon -v /path/to/file

    Assigning the storage space
    Figure 21.12. Assigning the storage space

  9. Connecting to the host network

    Choose the “Shared Physical Device” option to allow the guest access to the same network as the host and accessible to other computers on the network.

    Choose the “Virtual Network” option if you want your guest to on a virtual network. You can bridge a virtual network making it accessible to external networked computers, read Chapter 8, Configuring networks and guests for configuration instructions.


    The section, Section 21.17, “Creating a virtual network”, can guide you through the process of creating and configuring network devices or the chapter on network devices, Chapter 12, Virtualized network devices.

    Connect to the host network
    Figure 21.13. Connect to the host network

  10. Select memory to allocate the guest and the number of virtual CPUs then click Forward.

    Allocating Memory and CPU
    Figure 21.14. Allocating Memory and CPU


    Avoid allocating more memory to all of your virtual machines than you have physically available. Over allocating will cause the system to use the swap partition excessively, causing unworkable performance levels.

  11. Review your selections, then click Forward to open a console and the files start to install.

    The final virt-manager screen
    Figure 21.15. The final virt-manager screen

  12. Your virtual machine will begin to boot.

    The virtual machine's boot output
    Figure 21.16. The virtual machine's boot output

  13. Type xm create -c xen-guest to start the Red Hat Enterprise Linux 5 guest. Right click on the guest in the Virtual Machine Manager and choose Open to open a virtual console.

    A Red Hat Enterprise Linux 5 guest
    Figure 21.17. A Red Hat Enterprise Linux 5 guest

Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.