Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to SUSE Linux Enterprise Server 11 SP4

6 Guest Installation

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.

6.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.

6.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:

6.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.

6.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 errors or performance penalties.

This dialog also allows you to assign PCI devices (for example a network card) that can be directly used by the VM Guest (PCI passthrough). Click Host Devices › Manage VM Devices to get a list of available devices. Choose a device from the list and click Add to add it to the devices list for the VM Guest. It is recommended to activate the Managed option for each device—it assures that libvirt automatically takes care of binding and unbinding drivers—see Tip: 'managed' vs. 'unmanaged' for more information.

Important
Important: PCI devices cannot be shared

PCI devices cannot be shared between host and VM Guest or between VM Guests—each device can only be used by a single instance. Make sure to only add PCI devices not used elsewhere.

The Advanced Settings lets you activate or deactivate ACPI, APIC, and PAE. It is recommended not to change the default settings. You can also enable or disable paravirtualized I/O with virtio or choose to execute the kernel on boot (linux only) here.

Important
Important: Para-Virtualized I/O

If you enable paravirtualized I/O 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.

6.1.1.3 Peripheral Devices

Configure the type of virtualized graphics hardware, the keymap and sound device in this dialog. If you disable the graphics card support, the machine is only accessible via network services (ssh) or serial port. Sound in VM Guests is currently not supported by SUSE, therefore Sound should be set to None.

6.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
    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
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 sparse raw disk image file is created in /var/lib/kvm/images/VM_NAME/ where VM_NAME is the name of the virtual machine.

Note
Note: Supported Disk format

Currently, only the disk formats raw, qed and qcow2 are supported by SUSE with read and write support. The vmdk, vpc and vhd/vhdx formats are only supported in read-only mode.

Procedure 6.1: Creating a Virtual Disk
  1. Click Harddisk.

  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. For creating raw disks, choose either file for file-backed virtual disks or phy for device-backed disks. qcow2 or qed disks can be created by choosing the corresponding value.

  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.

6.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. If a bridge exists on the VM Host Server, the virtual network card will be attached to it, otherwise it will be attached to the libvirt's default virtual bridge (virbr1).

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
    Note: Supported Virtual Network Adapter Types

    Currently, only Fully Virtualized Realtek 8139, Fully Virtualized Intel e1000 or the paravirtualized QEMU Virtualized NIC Card (virtio) are supported by SUSE.

  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
    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 obvious MAC addresses such as 52:54:00:12:34:56 or 52:54:00:11:22:33, because they may already be in use. It is strongly recommended to always use a randomly generated MAC address for each adapter.

6.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, a network resource or via PXE boot—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

6.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
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 6.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 6.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 6.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 6.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 paravirtualized 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 paravirtualized 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.

6.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 is 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. You can start the installation.

Warning
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

6.3 Advanced Guest Installation Scenarios

This section provides instructions for operations exceeding the scope of a normal installation, such as including add-on packages.

6.3.1 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.

Print this page