Product SiteDocumentation Site

Chapter 4. Manage Virtual Machines

4.1. Create Virtual Machines
4.1.1. Create a Red Hat Enterprise Linux Virtual Machine
4.1.2. Create a Windows Virtual Machine
4.2. Using Templates
4.2.1. Create a Red Hat Enterprise Linux Template
4.2.2. Clone a Red Hat Enterprise Linux Virtual Machine
4.2.3. Create a Windows Template
4.2.4. Create a Windows Virtual Machine from a Template
4.3. Using Virtual Machines
4.3.1. Assign User Permissions
4.3.2. Log in to the User Portal
The final stage of setting up Red Hat Enterprise Virtualization is the virtual machine lifecycle - spanning the creation, deployment and maintenance of virtual machines; using templates; and configuring user permissions. This chapter will also show you how to log in to the user portal and connect to virtual machines.

4.1. Create Virtual Machines

Create Virtual Machines
Figure 4.1. Create Virtual Machines

On Red Hat Enterprise Virtualization, you can create virtual machines from an existing template, as a clone, or from scratch. Once created, virtual machines can be booted using ISO images, a network boot (PXE) server, or a hard disk. This document provides instructions for creating a virtual machine using an ISO image.

4.1.1. Create a Red Hat Enterprise Linux Virtual Machine

In your current configuration, you should have at least one host available for running virtual machines, and uploaded the required installation images to your ISO domain. This section guides you through the creation of a Red Hat Enterprise Linux 6 virtual server. You will perform a normal attended installation using a virtual DVD.
To create a Red Hat Enterprise Linux server
  1. Navigate to the Tree pane and click Expand All. Click the VMs icon under the Default cluster. On the Virtual Machines tab, click New Server.
    Create New Linux Virtual Machine
    Figure 4.2. Create New Linux Virtual Machine

    You only need to fill in the Name field and select Red Hat Enterprise Linux 6.x as your Operating System. You may alter other settings but in this example we will retain the defaults. Click OK to create the virtual machine.
  2. A New Virtual Machine - Guide Me window opens. This allows you to add networks and storage disks to the virtual machine.
    Create Virtual Machines
    Figure 4.3. Create Virtual Machines

  3. Click Configure Network Interfaces to define networks for your virtual machine. The parameters in the following figure are recommended, but can be edited as necessary. When you have configured your required settings, click OK.
    New Network Interface configurations
    Figure 4.4. New Network Interface configurations

  4. You are returned to the Guide Me window. This time, click Configure Virtual Disks to add storage to the virtual machine. The parameters in the following figure are recommended, but can be edited as necessary. When you have configured your required settings, click OK.
    New Virtual Disk configurations
    Figure 4.5. New Virtual Disk configurations

  5. Close the Guide Me window by clicking Configure Later. Your new RHEL 6 virtual machine will display in the Virtual Machines tab.
You have now created your first Red Hat Enterprise Linux virtual machine. Before you can use your virtual machine, install an operating system on it.
To install the Red Hat Enterprise Linux guest operating system
  1. Right click the virtual machine and select Run Once. Configure the following options:
    Run Red Hat Enterprise Linux Virtual Machine
    Figure 4.6. Run Red Hat Enterprise Linux Virtual Machine

    • Attach CD: Red Hat Enterprise Linux 6
    • Boot Sequence: CD-ROM
    • Display protocol: SPICE
    Retain the default settings for the other options and click OK to start the virtual machine.
  2. Select the virtual machine and click the Console ( ) icon. As this is your first time connecting to the virtual machine, allow the installation of the Spice Active X and the SPICE client.
  3. After the SPICE plugins have been installed, select the virtual machine and click the Console icon again. This displays a window to the virtual machine, where you will be prompted to begin installing the operating system. For further instructions, see the Red Hat Enterprise Linux Installation Guide.
  4. After the installation has completed, shut down the virtual machine and reboot from the hard drive.
You can now connect to your Red Hat Enterprise Linux virtual machine and start using it.

4.1.2. Create a Windows Virtual Machine

You now know how to create a Red Hat Enterprise Linux virtual machine from scratch. The procedure of creating a Windows virtual machine is similar, except that it requires additional virtio drivers. This example uses Windows 7, but you can also use other Windows operating systems. You will perform a normal attended installation using a virtual DVD.
To create a Windows desktop
  1. Navigate to the Tree pane and click Expand All. Click the VMs icon under the Default cluster. On the Virtual Machines tab, click New Desktop.
    Create New Windows Virtual Machine
    Figure 4.7. Create New Windows Virtual Machine

    You only need to fill in the Name field and select Windows 7 as your Operating System. You may alter other settings but in this example we will retain the defaults. Click OK to create the virtual machine.
  2. A New Virtual Machine - Guide Me window opens. This allows you to define networks for the virtual machine. Click Configure Network Interfaces. See Figure 4.4, “New Network Interface configurations” for details.
  3. You are returned to the Guide Me window. This time, click Configure Virtual Disks to add storage to the virtual machine. See Figure 4.5, “New Virtual Disk configurations” for details.
  4. Close the Guide Me windows. Your new Windows 7 virtual machine will display in the Virtual Machines tab.
To install Windows guest operating system
  1. Right click the virtual machine and select Run Once. The Run Once dialog displays as in Figure 4.6, “Run Red Hat Enterprise Linux Virtual Machine”. Configure the following options:
    • Attach Floppy: virtio-win
    • Attach CD: Windows 7
    • Boot sequence: CD-ROM
    • Display protocol: SPICE
    Retain the default settings for the other options and click OK to start the virtual machine.
  2. Select the virtual machine and click the Console ( ) icon. This displays a window to the virtual machine, where you will be prompted to begin installing the operating system.
  3. Accept the default settings and enter the required information as necessary. The only change you must make is to manually install the VirtIO drivers from the virtual floppy disk (vfd) image. To do so, select the Custom (advanced) installation option and click Load Driver. Press Ctrl and select:
    • Red Hat VirtIO Ethernet Adapter
    • Red Hat VirtIO SCSI Controller
    The installation process commences, and the system will reboot itself several times.
  4. Back on the administration portal, when the virtual machine's status changes back to Up, right click on it and select Change CD. From the list of images, select RHEV-toolsSetup to attach the Guest Tools ISO which provides features including USB redirection and SPICE display optimization.
  5. Click Console and log in to the virtual machine. Locate the CD drive to access the contents of the Guest Tools ISO, and launch the RHEV-toolsSetup executable. After the tools have been installed, you will be prompted to restart the machine for changes to be applied.
You can now connect to your Windows virtual machine and start using it.