< Previous | Contents | Next >
1.2. Installation
To install the necessary packages, from a terminal prompt enter:
sudo apt install qemu-kvm libvirt-bin
After installing libvirt-bin, the user used to manage virtual machines will need to be added to the libvirt group. Doing so will grant the user access to the advanced networking options.
In a terminal enter:
sudo adduser $USER libvirt
If the user chosen is the current user, you will need to log out and back in for the new group membership to take effect.
You are now ready to install a Guest operating system. Installing a virtual machine follows the same process as installing the operating system directly on the hardware. You either need a way to automate the installation, or a keyboard and monitor will need to be attached to the physical machine.
In the case of virtual machines a Graphical User Interface (GUI) is analogous to using a physical keyboard and mouse. Instead of installing a GUI the virt-viewer application can be used to connect to a virtual machine's console using VNC. See Section 1.6, “Virtual Machine Viewer” [p. 342] for more information.
There are several ways to automate the Ubuntu installation process, for example using preseeds, kickstart, etc. Refer to the Ubuntu Installation Guide1 for details.
Yet another way to install an Ubuntu virtual machine is to use uvtool. This application, available as of 14.04, allows you to set up specific VM options, execute custom post-install scripts, etc. For details see Section 3, “Cloud images and uvtool” [p. 346].
Libvirt can also be configured work with Xen. For details, see the Xen Ubuntu community page referenced below.