Skip to content
VirtualLP Virtual Learning Platform
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. 1 Check that the CPU supports hardware virtualization
  2. 2 Install the KVM / libvirt packages
  3. 3 Enable and verify the libvirt daemon
  4. 4 Allow your user to manage VMs without sudo
  5. 5 Confirm the KVM kernel modules are loaded
  6. 6 Create VM ubuntu-vm1 with virt-install
  7. 7 List all domains
  8. 8 Inspect the VM and find its IP address
  9. 9 Shut the VM down gracefully
  10. 10 Take a snapshot named fresh-install
  11. 11 Clone the VM to ubuntu-vm2
  12. 12 Delete the clone and its storage