This page describes how to create new virtual machines on the infra/api hosts running KVM/libvirt, with Virtual Machine Manager.
Install Virtual Machine Manager
$ apt install virt-manager ssh-askpass-gnome
Connect to the remote KVM host
- Start Virtual Machine Manager, and click
File -> Add Connection...
- Select:
- Hypervisor = QEMU/KVM
- Connect to remote host
- Method = SSH
- Username = <your username at the remote host>
- Hostname = <kvmhost.domain.net>
- Autoconnect
- You will be prompted for you password at the remote host. Enter it, and hit OK.
- You should now see something like this, and you're all set to create virtual machines!
Creating a virtual machine
- Select the remote server, and click the
Create a new virtual machine
button - Ensure that the remote server is selected in the
Connection
dropdown, and selectNetwork Boot (PXE)
- Select the correct OS type and version. In most cases, this should be
Linux
andUbuntu 16.04
- Choose the RAM and CPU settings you need
- Select
Enable storage for this virtual machine
andSelect or create custom storage
and clickManage..
- Select
vmvg
in the left menu, and click the green button with a plus sign - Give the disk a name, preferably the same name as your new virtual machine, enter a sufficient disk size, and click
Finish
- Ensure that the newly created volume are selected, and click
Choose volume
- Give the virtual machine a name, and check
Customize configuration before install
. Also, select the network your virtual machine should connect to. In most cases, you should select one of the options starting withVirtual network
. - In the customization menu, select
Boot Options
and ensure thatStart virtual machine on host boot up
are selected, and that both the NIC and Disk are selected underBoot device order
. The NIC should be first. Click Apply, and thenBegin Installation.
- Your new virtual machine is now ready to go, and is set up for PXE booting. It's now probably smart to take a note of the MAC adress on the virtual NIC.