KVM / oVirt
intermediate
Install KVM and create virtual machines with virt-install and virsh
On an Ubuntu server, verify hardware virtualization, install the KVM/libvirt stack, create a VM from an ISO with virt-install and manage its full lifecycle with virsh – exactly as you would on a real cloud compute node.
What you'll do
- Check Intel VT-x / AMD-V support
- Install qemu-kvm, libvirt and virtinst
- Create a VM with virt-install
- Start, stop, inspect, snapshot, clone and delete VMs with virsh
Lab tasks
- 1 Check that the CPU supports hardware virtualization
- 2 Install the KVM / libvirt packages
- 3 Enable and verify the libvirt daemon
- 4 Allow your user to manage VMs without sudo
- 5 Confirm the KVM kernel modules are loaded
-
6
Create VM
ubuntu-vm1with virt-install - 7 List all domains
- 8 Inspect the VM and find its IP address
- 9 Shut the VM down gracefully
-
10
Take a snapshot named
fresh-install -
11
Clone the VM to
ubuntu-vm2 - 12 Delete the clone and its storage