6.1 Virtual Machines (Full Virtualization Mode)

This section contains the latest issues and information common to all operating systems running in full virtualization mode on the VM Server. It contains the following subsections:

6.1.1 Creating a Fully Virtual VM

Basic instructions for creating a fully virtual VM are in Section 3.1.4, Creating a Virtual Machine (Full Virtualization Mode).

6.1.2 Working with a Specific Operating System

Information in this section is common to all operating systems running in fully virtual mode. Before creating or running a fully virtual VM, you should review issues related to its specific operating system in Section 7.0, Specific Operating Systems .

6.1.3 Power Management Features

Power management features, such as the suspend-to-disk feature, are not supported and should be disabled on the VM Server and all VMs.

6.1.4 Virtual Disk Performance Settings

For best performance, create each virtual disk from an entire disk or a partition. For 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 the slowest installation and disk access speeds. (179409)

6.1.5 File-Backed Virtual Disks and Write Modes

By default, a VM’s virtual disk uses asynchronous write mode to write data to the disk. Asynchronous write mode dramatically improves VM system-to-disk performance because the VM Server can buffer data before actually writing to disk. Although it delivers better performance, the asynchronous write mode might corrupt the file system if the VM is using a file-backed virtual disk and the VM server has a system crash or power outage. This is because Xen does not support write barriers, which preserve the order of data being written to disk.

A virtual disk using synchronous write mode maintains file system integrity in the event of a system crash, but significantly slows write-to-disk performance by executing each write-to-disk activity before continuing. In synchronous write mode, the VM Server does not cache data.

To change between modes, append or remove the S flag to the existing writable flag in the disk line in the VM's configuration file. This mode is set per disk.

For example, the first statement specifies asynchronous disk-write mode (no S). The second statement specifies synchronous write mode (added S).

disk = [ 'file:/var/lib/xen/images/vm1/hda,hda,w' , 'phy:/dev/hdb,hdb,w' ]

disk = [ 'file:/var/lib/xen/images/vm1/hda,hda,wS', 'phy:/dev/hdb,hdb,w' ]

6.1.6 Using the Manage Virtual Machines Page

The following commands are available by running the Virtual Machine Management (Xen) module on the Xen VM Server desktop.

  1. On the VM Server desktop, click YaST > System > Virtual Machine Management (Xen).

    The Manage Virtual Machines page displays all VMs.

  2. From the Manage Virtual Machines page, you can perform the following actions:

    • Add starts the process to create a new VM.
    • Start boots the operating system of the selected VM and displays it in a new window.
    • Refresh displays the current status of all VMs.
    • Delete completely removes the selected VM.
    • View displays the command console for the selected VM.
    • Shutdown performs a normal shutdown of the selected VM.
    • Terminate acts as if power is shut off to the selected VM.

6.1.7 Viewing the VM

  • To view the VM in the VNC viewer, open a terminal and enter vncviewer ip_address:vm_id where ip_address is the IP address of VM Server and vm_id is the VM’s ID number.
  • The TightVNC viewer (used by default) does not automatically resize when the VM’s screen size changes. To view the entire screen, close the VNC viewer and start a new VNC viewer session each time you need to resize the screen.
  • To view the VM using the VNC viewer instead of text mode, change the vnc=0 setting to vnc=1 in the VM’s config file (/etc/xen/vm/vm_name).
  • If you replace the TightVNC viewer with a different VNC viewer, such as Real VNC, the VM window might resize automatically.
  • If the VM crashes while the mouse is constrained by the VM window, the mouse might be lost. To restore it, start another VM, then repeatedly press Ctrl+Alt until the mouse reappears. Then move the mouse to the applicable VM window.

6.1.8 Helpful Keystrokes

When running or setting up a VM in full virtualization mode, you can use the following commands and key combinations:

  • Ctrl+Alt+1 to view the HVMXen control window
  • Ctrl+Alt+2 to get a command line interface to the HVMXen console
  • Ctrl+Alt+3 to view output from the virtual serial port; most useful for debugging
  • Ctrl+Alt to release mouse from VM window
  • send-key keystrokes to enter keystrokes in the HVMXen control window. For example, entering send-key ctrl+alt+f1 on the command line switches between the VM's text and GUI views. This command is only available when using the command line interface (Ctrl+Alt+2)
  • change cdrom cd2.iso to switch to another CD ISO image. Enter the command from the HVMXen console command line interface and replace cd2.iso with the name of the CD ISO image file

6.1.9 Useful File Locations

Files

Location

VM configuration files

/etc/xen/vm/vm_name where vm_name is the name you entered for the VM

Example VM configuration files

/etc/xen/examples

File-backed virtual disk images

/var/lib/xen/images/vm_name/disk_image where vm_name is the VM name and disk_image is the name of the disk image file

6.1.10 Using the xm Command

You can perform actions on VMs by using the xm command. In a terminal, log in as root and enter the desired command.

Command

Action

xm help

View a list of actions available for the xm command

xm list

View a list of all running virtual machines

xm create /etc/xen/vm/vm_name

To start and view a VM

(The VM starts and displays in a separate SDL viewer window)

xm destroy vm_name

To terminate a VM immediately

6.1.11 Available Memory

Fully-virtualized VMs can crash, especially when running heavy loads, if not enough free memory is available for Xen. Xen does not yet flush the shadow page cache when memory becomes low, which can result in an artificial out-of-memory condition. As a workaround, manually shrink the Xen VM Server’s memory (to leave some amount free for use by Xen) with a command such as xm mem-set 0 384

6.1.12 Using VNC Viewer to View Fully Virtual VMs

By default, the VM Server uses the SDL viewer to view fully virtual guests, but you can change the setting to use the VNC viewer. If you change to the VNC viewer, make sure remote administration is disabled on the VM Server. If remote administration is disabled, entering vncviewer VM_server_ip_address:VM_ID in a terminal displays the VM (matching the ID) in the VNC viewer. If remote administration is enabled, the VNC viewer displays the VM Server’s login prompt, not the intended VM.

HINT:You might need to reboot the VM Server to disable remote administration.