Objectives

  • Configure KVM hypervisor and resolve libvirt permission errors on Ubuntu
  • Install and access the Cockpit web dashboard for virtual machine management
  • Prepare Windows 11 installation media and high-performance VirtIO drivers
  • Configure virtual hardware including storage pools, network interfaces, and boot order
  • Resolve Linux file ownership and AppArmor security blocks for virtual disks
  • Bypass Windows 11 online account requirements to create a local user

Instructions

  1. Add your user to the libvirt and kvm groups to manage VMs without sudo.
    • Run: sudo usermod -aG libvirt $USER && sudo usermod -aG kvm $USER
  2. Install the Cockpit web dashboard and the machines extension for VM management.
    • Run: sudo apt install cockpit cockpit-machines
  3. Access the dashboard at https://localhost:9090 using your Ubuntu system credentials.
  4. Move your Windows ISO to /var/lib/libvirt/images/ to avoid home directory permission issues.
  5. Change the ownership of all ISO and disk files to the virtualization service.
    • Run: sudo chown libvirt-qemu:kvm /var/lib/libvirt/images/[filename]
  6. Download the VirtIO driver ISO to enable high-speed storage and networking.
    • Run: sudo wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso -O /var/lib/libvirt/images/virtio-win.iso
  7. Add two CD/DVD drives to the VM: one for the Windows ISO and one for VirtIO drivers.
  8. Set the Bus type for the VirtIO driver CD-ROM to “SATA” so Windows can read it.
  9. Create a virtual hard drive with a minimum of 64GB and set the Bus to “VirtIO.”
  10. Adjust the Boot Order in Cockpit to place the Windows 11 ISO at the top.
  11. Load the storage driver during Windows setup by navigating to viostor > w11 > amd64 on the VirtIO CD.
  12. Load the network driver during Windows setup by navigating to NetKVM > w11 > amd64.
  13. Apply sudo chmod 666 [filepath] if you encounter persistent “Permission Denied” errors when starting the VM. Or delete the VM and create new one.
  14. Bypass the Windows 11 Microsoft Account requirement by disabling netwrok interface for a moment.