Chapter 5. Guest Installation

Contents

5.1. Guest Installation with Virtual Machine Manager
5.2. Installing from the Command Line with vm-install
5.3. Advanced Guest Installation Scenarios

A VM Guest is comprised of an image containing an operating system and data files and a configuration file describing the VM Guest's virtual hardware resources. VM Guests are hosted on and controlled by the VM Host Server.

5.1. Guest Installation with Virtual Machine Manager

Clicking New in the Virtual Machine Manager launches vm-install. It provides the graphical Create Virtual Machine Wizard that guides you through the guest installation. vm-install can also be run directly from the command-line or from YaST by choosing Virtualization+Create Virtual Machine.

  1. Start the Create Virtual Machine Wizard as described above and click Forward.

  2. Choose whether to install an operation system or an already existing image or disk.

  3. Select the operating system you want to install from the list. Each entry provides reasonable defaults for the chosen operating system.

  4. The Summary page shows the default configuration for the chosen operating system. Edit the configuration by clicking on a headline. When having chosen to install a system, you at least have to specify either an image or a CD/DVD device from which to boot or choose PXE boot. When accepting the configuration with OK, the guest system boots to start the installation.

5.1.1. Customizing the Default Settings

Change the proposed configuration by clicking on a headline in the Summary page of the Create Virtual Machine Wizard:

5.1.1.1. Name of Virtual Machine

Specify a Name and an optional Description for the guest. The Name must contain only alphanumeric and _-.:+ characters. It must be unique among all VM Guests on the VM Host Server. It is used to create and name the guest’s configuration file and you will be able to access the guest with this name from virsh.

5.1.1.2. Hardware

Change memory and CPU assignments in this screen. It is recommended not to specify values larger than the resources the VM Host Server can provide (overcommit), since it may result in fatal errors or performance penalties.

The Advanced Settings let you activate or deactivate ACPI, APIC, and PAE. It is recommended not to change the default settings. You can also enable or disable para-virtualization with virtio here.

[Important]Enabling virtio (Para-Virtualization)

If you enable para-virtualization by activating virtio, all hard disks you create will be configured as virtio disks. If your operating system does not have appropriate drivers, the installation will fail. A Windows operating system installation even fails if providing a driver. By default, this feature is only activated for operating systems known to ship with virtio drivers.

Overwriting the default by activating para-virtualization for non-supported operating system currently only makes sense for SUSE Linux Enterprise Server SP3, if you plan to add the para-virtualized drivers during the installation (see Section 5.3.1, “Adding para-virtualized Drivers During the Installation” for installation instructions).

5.1.1.3. Graphics and Keyboard

Configure the type of virtualized graphics hardware and the keymap in this dialog. If you disable the graphics card support, the machine is only accessible via network services (ssh) or serial port.

5.1.1.4. Disks

Disks: Manage virtual hard disks and CD/DVD drives in this dialog. A VM Guest must have at least one virtual disk—either an existing one or a newly created disk. Virtual disks can be:

  • a single file with a fixed size

  • a single file that grows on demand (Sparse Image File)

    [Important]Sufficient Space for Sparse Image Files

    When creating sparse image files, the partition on which you create them always needs sufficient free space. The VM Guest has no means to check the VM Host Server disk space. Having no space left on the host partition causes write errors and loss of data on the guest system.

  • a block device, such as an entire disk, partition, or a network volume.

For best performance, create each virtual disk from an entire disk or a partition. For the next best performance, create an image file but do not create it as a sparse image file. A virtual disk based on a sparse image file delivers the most disk space flexibility but slows installation and disk access speeds.

[Tip]Live Migration

If you need to be able to migrate your VM Guest to another host without shutting it down (live migration), all disks must reside on a network resource (network file system or iSCSI volume) that is accessible from both hosts.

By default, a single, file-backed virtual disk is created as a sparse image file in /var/lib/kvm/images/VM_NAME/ where VM_NAME is the name of the virtual machine.

[Note]Supported Disk format

Currently, only the raw disk format is supported by Novell.

Procedure 5.1. Creating a Virtual Disk

  1. Click Hard disk.

  2. Enter a Source. If creating a file-backed disk, either enter the path directly or click New. When creating a disk from a device, enter the device node, for example /dev/disk/by-path/path. It is strongly recommended not to use the simple device paths such as /dev/sdb or /dev/sda5, since they may change (by adding a disk or by changing the disk order in the BIOS).

  3. Specify the Protocol. Choose file for file-backed virtual disks and phy for device-backed disks. Choosing those protocols will create the disk in raw format.

  4. Enter a Size in GB. This option is only available for file-backed disks.

  5. Choose whether to create a Sparse Image File. This option is only available for file-backed disks. If you want to disable write-access to the disk, choose Read-Only Access.

If you want to install from DVD or CD-ROM, add the drive to the list of available hard disks. To learn about device nodes of the available optical drives, run:

hwinfo --cdrom | egrep "(Device File:|Model:)"

Instead of the real DVD or CD-ROM drive, you can also add the ISO image of an installation medium. Note that each CD-Rom drive or ISO image can only be used by one guest at the same time.

To add a CD/DVD-ROM device or an ISO image, proceed as follows:

  1. Click CD-ROM.

  2. Enter a Source. If adding a device, enter its node. If adding an ISO image, either enter the path directly or click Browse to open a file browser.

  3. Specify the Protocol. Choose file for an ISO image and phy for a device.

The disks are listed in the order in which they have been created. This order also represents the boot order. Use the Up and Down arrows to change the disk order.

5.1.1.5. Network Adapters

By default, a single virtual network card is created for the virtual machine. It has a randomly generated MAC address that you can change to fit your desired configuration. The virtual network card will be attached to a default bridge configured on the VM Host Server. You can adjust the configuration in this dialog or create additional virtual network cards.

To add a new network adapter or edit an existing one, proceed as follows:

  1. Click New to add a card or Edit to change the configuration of the selected card.

  2. Choose a Type from the drop-down list.

    [Note]Supported Virtual Network Adapter Types

    Currently, only Fully Virtualized Realtek 8139 or the paravirtualized QEMU Virtualized NIC Card (virtio-net) are supported by Novell.

  3. Choose a Source from the drop-down list.

  4. Choose whether to assign a randomly generated MAC address or manually specify an address.

    [Note]MAC addresses need to be unique

    When choosing to manually specify a MAC address, make sure it is not already used in your network. If so, it may result in network problems, especially when using DHCP. Therefore avoid specifying MAC addresses such as 52:54:00:12:34:56 or 52:54:00:11:22:33. It is strongly recommended to always use a randomly generated MAC address for each adapter.

5.1.1.6. Operating System Installation

This dialog is only available when having chosen to install an operating system. The installation can be booted from a virtual disk, from a CD/DVD device, from an ISO image or via PXE boot over the network— use this dialog to configure the boot device.

Also use this dialog to configure the behavior of the VM Guest when the operating system is powered off, rebooted or if it crashes. The following options are available

destroy

normal cleanup

restart

a new VM Guest is started in place of the old one

preserve

no cleanup, do not delete temporary, configuration and image files

rename-restart

the VM Guest is not cleaned up but is renamed and a new domain started in its place

coredump-destroy

a crashed machine's core is dumped before a normal cleanup is performed

coredump-restart

a crashed machine's core is dumped before a normal restart is performed

5.2. Installing from the Command Line with vm-install

If $DISPLAY is not set (for example, when operating on a console or on an ssh shell with no X-forwarding), vm-install offers a command-line wizard to interactively set up a VM Guest for installation. Once the setup is completed, the newly created guest boots into the installation system which can be connected via VNC.

[Important]Graphical User Interface needed for Installation

Once the VM Guest boots into the installation, you need to connect to the graphical console via VNC to attend the installation. Therefore, you need to start the viewer from a graphical user interface.

If you are working from a console with no access to a graphical user interface, you can set up the VM Guest configuration and start the installation at a later time. Refer to Section 5.2.1, “Defining a VM Guest without Starting the Installation” for instructions.

To start the wizard, just type vm-install to start. For a lot of parameters, the installation wizard already provides reasonable defaults which you can confirm by just pressing Enter. Here is a log of an interactive setup for a SUSE Linux Enterprise Server 11 installation:

Example 5.1. Interactive Setup on the Command Line Using vm-install

~ # vm-install 
Gathering settings...

Please specify the type of operating system that will run within the virtual
machine.  This defines many defaults, and helps decide how to start
paravirtualized operating systems.
Press 'q' or the Escape key to exit.
  1: Novell Open Enterprise Server 2 (Linux)
  2: Novell Open Enterprise Server 2 (NetWare)
  3: Other operating system
  4: PXE
  5: RedHat (other)
  6: RedHat Enterprise Linux 3
  7: RedHat Enterprise Linux 4
  8: RedHat Enterprise Linux 5
  9: SUSE (other)
 10: SUSE Linux Enterprise Desktop 10
 11: SUSE Linux Enterprise Desktop 11
 12: SUSE Linux Enterprise Server 8
 13: SUSE Linux Enterprise Server 9
 14: SUSE Linux Enterprise Server 10
 15: SUSE Linux Enterprise Server 11
 16: Solaris 9 and older
 17: Solaris 10
 18: Windows (other)
 19: Windows (other, x64)
 20: Windows NT
 21: Windows Server 2008
 22: Windows Server 2008 (x64)
 23: Windows Vista, Windows 7
 24: Windows Vista, Windows 7 (x64)
 25: Windows XP, 2000, 2003
 26: Windows XP, 2003 (x64)
 27: openSUSE
 28: openSUSE 11
[15] >

PXE Boot
(Y / N) [N] >  
Please choose a name for the virtual machine.
[sles11] > 

Description > SLES 11 SP1

Specify the amount of memory and number of processors to allocate for the VM.
Initial Memory [512] > 
Maximum Memory [512] > 768
Warning: Setting the maximum memory greater than the initial memory requires
the VM operating system to have a memory balloon driver.
Virtual Processors [2] >

Please specify the type of virtualized graphics hardware.
  1: Cirrus Logic GD5446 VGA
  2: No Graphics Support
  3: VESA VGA
[1] > 

Virtual Disks:
  (None)
Do you want to add another virtual disk?
(Y / N) [Y] > 

Create a virtual disk based on a device (CD or other block device), an existing
image file (ISO), or a new file.  Specify a device by its device node, such as
/dev/cdrom, not its mount point.
What type of virtual disk do you want to add?
  1: CD-ROM or DVD
  2: Floppy
  3: Hard Disk
[3] > 3
Where will the virtual disk physically reside?
[/var/lib/kvm/images/sles11/hda] > 
Size (GB) [4.0] > 8.0
Create a sparse image file for the virtual disk?
(Y / N) [Y] > 

Virtual Disks:
  8.0 GB Hard Disk (file:/var/lib/kvm/images/sles11/hda)
Do you want to add another virtual disk?
(Y / N) [N] > y

Create a virtual disk based on a device (CD or other block device), an existing
image file (ISO), or a new file.  Specify a device by its device node, such as
/dev/cdrom, not its mount point.
What type of virtual disk do you want to add?
  1: CD-ROM or DVD
  2: Floppy
  3: Hard Disk
[3] > 1
Where will the virtual disk physically reside?
[/var/lib/kvm/images/sles11/hdb] > /isos/SLES-11-SP1-CD-i386-GM-CD1.iso

Virtual Disks:
  8.0 GB Hard Disk (file:/var/lib/kvm/images/sles11/hda)
  2.9 GB CD-ROM or DVD (file:/isos/SLES-11-SP1-DVD-x86_64-GM-DVD1.iso)
Do you want to add another virtual disk?
(Y / N) [N] > 

Network Adapters
  (None)
Do you want to add another virtual network adapter?
(Y / N) [Y] > 
What type of virtual network adapter do you want to add?
  1: Fully Virtualized AMD PCnet 32
  2: Fully Virtualized Intel e100
  3: Fully Virtualized Intel e1000
  4: Fully Virtualized NE2000 (ISA Bus)
  5: Fully Virtualized NE2000 (PCI Bus)
  6: Fully Virtualized Realtek 8139
  7: Paravirtualized
[6] > 7

Network Adapters
  Paravirtualized; Randomly generated MAC address
Do you want to add another virtual network adapter?
(Y / N) [N] > 

Preparing to start the installation...

Installing...

You may also provide parameters on the command line. The wizard will then prompt you for any missing parameters. In the following all parameters from Example 5.1, “Interactive Setup on the Command Line Using vm-install for which a command line switch exists, are specified. See man 8 vm-install for a full list of parameters.

Example 5.2. vm-install command line switches

vm-install --os-type sles111 --name "sles11_test"2 \
--vcpus 23 --memory 5124 --max-memory 7685 \
--disk /var/lib/kvm/images/sles11/hda,0,disk,w,8000,sparse=1 6 \
--disk /iso/SLES-11-SP1-DVD-x86_64-GM-DVD1.iso,1,cdrom7 \
--nic mac=52:54:00:05:11:11,model=virtio8 \
--graphics cirrus9 --config-dir "/etc/libvirt/qemu"10

1

Specifies the guest operating system to define suitable defaults. A list of valid values can be obtained with vm-install -O.

2

Name of the VM Guest. This name must be unique.

3

Number of virtual processors.

4

Initial amount of memory.

5

Maximum amount of memory. Requires an operating system with a para-virtualized virtio-balloon driver.

6

Defines a virtual hard disk. The file is located at /var/lib/kvm/images/sles11/hda. It is configured as the first (0) hard disk (disk). It is writable (w) with a size of 8 GB (8000). The file on the VM Host Server is a sparse file (sparse=1).

7

Defines an ISO image for a CD-ROM as the second (1) block device.

8

Configures a para-virtualized network device with the MAC address 52:54:00:05:11:11.

9

Specifies the graphics card.

10

The directory in which the XML configuration file for the virtual machine will be stored. It is strongly recommended to use the default directory /etc/libvirt/qemu.

[Important]No Automated and Non-Interactive Setup

An automated installation in the background utilizing, for example, AutoYaST or a NetWare Response File with vm-install --os-settings is currently not supported with KVM (it only works for Xen PV guests).

The non-interactive setup of a VM Guest with vm-install --vm-settings is currently not supported with KVM, as well.

5.2.1. Defining a VM Guest without Starting the Installation

vm-install provides the --no-install parameter. With this parameter the XML configuration file defining the VM Guest is created, but the guest does not booted automatically. You may use it regardless whether you start vm-install in wizard mode or whether you specify all other options in the command line.

[Warning]No Virtual Disk Creation

When using the --no-install parameter with vm-install, no virtual disks will be created. Therefore, you have to create the disks in advance using either qemu-img or virsh.

Once the VM Guest XML configuration file is successfully created, you need to register it so it is recognized by Virtual Machine Manager or virsh. Do so by running:

virsh -c qemu:///system define PATH_TO_XMLFILE

5.3. Advanced Guest Installation Scenarios

This section provides instructions for operations exceeding the scope of a normal installation, such as adding para-virtualized drivers during the installation or including add-on packages.

5.3.1. Adding para-virtualized Drivers During the Installation

Installing an operating system out of the box on machines with para-virtualized devices is currently only possible with SUSE Linux Enterprise Server 11 SP1 or RedHat Enterprise Linux 5.4 and newer. Novell offers para-virtualized drivers for SUSE Linux Enterprise Server 10 SP3 and Windows operating systems, that can be installed manually.

In case of SUSE Linux Enterprise Server 10 SP3 these drivers can be added at the start of the installation. Thus it is possible to install on a virtual machine with para-virtualized devices (hard disk, network adapter and memory ballooning). See Section 5.1.1.2, “Hardware on how to activate para-virtualization when setting up a virtual machine. Windows operating systems refuse to install on para-virtualized drives, even if adding the drivers during the installation. Therefore para-virtualization for Windows can only be activated in an already installed system.

See Section A.1, “Installing Para-Virtualized Drivers” for instructions on installing para-virtualized drivers in an already installed system.

5.3.1.1. SUSE Linux Enterprise Server 10 SP3

SUSE Linux Enterprise Server 10 SP3 does not support para-virtualized devices out of the box, because the drivers are not included. In order to use such devices, add the missing drivers during the installation. Proceed as follows:

  1. Download the ISO image containing the para-virtualized drivers from http://drivers.suse.com/novell/Novell-virtio-drivers-2.6.27/sle10-sp3/novell-virtio-drivers-2.6.27-sle10sp3.iso.

  2. When setting up the VM Guest, specify the ISO image containing the para-virtualized drivers as CDROM device. If you are installing from CDROM or from an ISO image, make sure to configure the para-virtualized driver image as the second CDROM device.

  3. Finish the guest setup and start the installation. Enter

    dud=1

    at the boot prompt and boot into the installation.

  4. After the installation system has loaded, a pop-up window opens and asks for the device from which to install the drivers. Choose the CDROM device containing the drivers.

5.3.2. Including Add-On Products in the Installation

Some operating systems such as SUSE Linux Enterprise Server offer to include add-on products in the installation process. In case the add-on product installation source is provided via network, no special VM Guest configuration is needed. If it is provided via CD/DVD or ISO image, it is necessary to provide the VM Guest installation system with both, the standard installation images and the image for the add-on product.

First add the standard installation image, and second the physical CD/DVD-ROM or add-on image. The image or device added first is automatically chosen as the boot image. In case you install SUSE Linux Enterprise Server, it will be configured as /dev/sr0, while the add-on product source will be configured as /dev/sr1.