libvirt
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. This section provides generalized instructions for installing a VM Guest.
Virtual machines have few if any requirements above those required to run the operating system. If the operating system has not been optimized for the virtual machine host environment, the unmodified OS can run only on hardware-assisted virtualization computer hardware, in full virtualization mode, and requires specific device drivers to be loaded. The hardware that is presented to the VM Guest depends on the configuration of the host.
The virtual machine host runs only on AMD64 and Intel 64. Additionally, KVM for z Systems is included on SUSE Linux Enterprise Server as a technology preview. It does not run on other system architectures such as POWER. A 64-bit virtual machine host can, however, run both 32-bit and 64-bit VM Guests.
You should be aware of any licensing issues related to running a single licensed copy of an operating system on multiple virtual machines. Consult the operating system license agreement for more information.
The
wizard helps you through the steps required to create a virtual machine and install its operating system. There are two ways to start it: Within Virtual Machine Manager either click the icon or choose › . Alternatively, start YaST and choose › .Start the
wizard either from YaST or Virtual Machine Manager.Choose an installation source—either a locally available media or a network installation source. If you want to set up your VM Guest from an existing image, choose
.On a VM Host Server running the Xen hypervisor, you can choose whether to install a paravirtualized or a fully virtualized guest. The respective option is available under
. Depending on this choice, not all installation options may be available.Depending on your choice in the previous step, you need to provide the following data:
Specify the path on the VM Host Server to an iso image containing the installation data. If it is available as a volume in a libvirt storage pool, you can also select it via the Chapter 12, Managing Storage for more information). Alternatively, choose a physical CD-ROM or DVD inserted in the optical drive of the VM Host Server.
button (see
Provide the ftp://
, http://
,
https://
, and nfs://
. Under
you may provide a path to an
auto-installation file (AutoYaST or Kickstart, for example) and
Kernel parameters. Having provided a URL, the operating system
should be automatically detected correctly. If this is not the
case, deselect and manually select the and .
When booting via PXE, you only need to provide the
and the .To set up the VM Guest from an existing image, you need to specify the path on the VM Host Server to the image. If it is available as a volume in a libvirt storage pool, you can also select it via the Chapter 12, Managing Storage for more information).
button (seeChoose the memory size and number of CPUs for the new virtual machine.
This step is omitted if having chosen
in the first step.
Set up a virtual hard disk for the VM Guest. Either create a new
disk image or choose an existing one from a storage pool (see
Chapter 12, Managing Storage for more information). If you
choose to create a disk, a qcow2
image will be
created under /var/lib/libvirt/(images
.
Setting up a disk is optional. In case you are running a live system directly from CD or DVD, for example, you can omit this step by deselecting
.The last screen of the wizard lets you specify the name for the virtual machine. Options to specify the network device and the MAC address can be found under
. If you need to customize the configuration in detail before the installation, activate the relevant check box. Exit the wizard with . Depending on your choice, this will either start the installation or open the VM Guest configuration screen.The installation starts in a Virtual Machine Manager console window. Some key combinations, such as Ctrl–Alt–F1, are recognized by the VM Host Server but are not passed to the virtual machine. To bypass the VM Host Server, Virtual Machine Manager provides the “sticky key” functionality. Pressing Ctrl, Alt, or Shift three times makes the key sticky, then you can press the remaining keys to pass the combination to the virtual machine.
For example, to pass Ctrl–Alt–F2 to a Linux virtual machine, press Ctrl three times, then press Alt–F2. You can also press Alt three times, then press Ctrl–F2.
The sticky key functionality is available in the Virtual Machine Manager during and after installing a VM Guest.
virt-install
#
virt-install
is a command line tool that helps you
create new virtual machines using the libvirt
library. It is useful
if you cannot use the graphical user interface, or need to automatize the
process of creating virtual machines.
virt-install
is a complex script with a lot of command
line switches. The following are required. For more information, see the
man page of virt-install
(1).
--name vm_guest_name
:
Specify the name of the new virtual machine. The name must be unique
across all guests known to the hypervisor on the same connection. It
is used to create and name the guest’s configuration file and you
can access the guest with this name from
virsh
. Alphanumeric and _-.:+
characters are allowed.
--memory
required_memory
: Specify the
amount of memory to allocate for the new virtual machine in
megabytes.
--vcpus number_of_cpus
:
Specify the number of virtual CPUs. For best performance, the number
of virtual processors should be less than or equal to the number of
physical processors.
--paravirt
: Set up a paravirtualized guest. This is
the default if the VM Host Server supports paravirtualization and full
virtualization.
--hvm
: Set up a fully virtualized guest.
--virt-type hypervisor
:
Specify the hypervisor. Supported values are kvm
,
xen
, or lxc
.
Specify one of --disk
, --filesystem
or --nodisks
the type of the storage for the new
virtual machine. For example, --disk size=10
creates
10 GB disk in the default image location for the hypervisor and uses
it for the VM Guest. --filesystem
/export/path/on/vmhost
specifies
the directory on the VM Host Server to be exported to the guest. And
--nodisks
sets up a VM Guest without a local
storage (good for Live CDs).
Specify the installation method using one of
--location
, --cdrom
,
--pxe
, --import
, or --boot
.
Use the --graphics value
option to specify how to access the installation. openSUSE Leap
supports the values vnc
or none
.
If using vnc virt-install
tries to launch
virt-viewer
. If it is not installed or cannot be
run, connect to the VM Guest manually with you preferred viewer.
To explicitly prevent virt-install
from launching
the viewer use --noautoconsole
. To define a password
for accessing the VNC session, use the following syntax:
--graphics
vnc,password=PASSWORD
.
In case you are using --graphics none
, you can access
the VM Guest through operating system supported services, such as
SSH or VNC. Refer to the operating system installation manual on how
to set up these services in the installation system.
virt-install
command line #The following command line example creates a new SUSE Linux Enterprise Desktop 12 virtual machine with a virtio accelerated disk and network card. It creates a new 10 GB qcow2 disk image as a storage, the source installation media being the host CD-ROM drive. It will use VNC graphics, and it will auto-launch the graphical client.
virt-install --connect qemu:///system --virt-type kvm --name sled12 \ --memory 1024 --disk size=10 --cdrom /dev/cdrom --graphics vnc \ --os-variant sled12
virt-install --connect xen:// --virt-type xen --name sled12 \ --memory 1024 --disk size=10 --cdrom /dev/cdrom --graphics vnc \ --os-variant sled12
This section provides instructions for operations exceeding the scope of a normal installation, such as including modules and extensions packages.
Memory ballooning is a method to change the amount of memory used by VM Guest at runtime. Both the KVM and Xen hypervisors provide this method, but it needs to be supported by the guest as well.
While openSUSE and SLE-based guests support memory ballooning, Windows guests need the Virtual Machine Driver Pack (VMDP) to provide ballooning. To set the maximum memory greater than the initial memory configured for Windows guests, follow these steps:
Install the Windows guest with the maximum memory equal or less than the initial value.
Install the Virtual Machine Driver Pack in the Windows guest to provide required drivers.
Shut down the Windows guest.
Reset the maximum memory of the Windows guest to the required value.
Start the Windows guest again.
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 medium and an image for the add-on product.
In case you are using the GUI-based installation, select
in the last step of the wizard and add the add-on product ISO image via › . Specify the path to the image and set the to .
If installing from the command line, you need to set up the virtual
CD/DVD drives with the --disk
parameter rather than
with --cdrom
. The device that is specified first is
used for booting. The following example will install SUSE Linux Enterprise Server 12 plus
SDK:
virt-install --name sles12+sdk --memory 1024 --disk size=10 \ --disk /virt/iso/SLES12.iso,device=cdrom \ --disk /virt/iso/SLES12_SDK.iso,device=cdrom \ --graphics vnc --os-variant sles12