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
- 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
- Install the Cockpit web dashboard and the machines extension for VM management.
- Run:
sudo apt install cockpit cockpit-machines
- Access the dashboard at
https://localhost:9090 using your Ubuntu system credentials.
- Move your Windows ISO to
/var/lib/libvirt/images/ to avoid home directory permission issues.
- Change the ownership of all ISO and disk files to the virtualization service.
- Run:
sudo chown libvirt-qemu:kvm /var/lib/libvirt/images/[filename]
- 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
- Add two CD/DVD drives to the VM: one for the Windows ISO and one for VirtIO drivers.
- Set the Bus type for the VirtIO driver CD-ROM to “SATA” so Windows can read it.
- Create a virtual hard drive with a minimum of 64GB and set the Bus to “VirtIO.”
- Adjust the Boot Order in Cockpit to place the Windows 11 ISO at the top.
- Load the storage driver during Windows setup by navigating to
viostor > w11 > amd64 on the VirtIO CD.
- Load the network driver during Windows setup by navigating to
NetKVM > w11 > amd64.
- Apply
sudo chmod 666 [filepath] if you encounter persistent “Permission Denied” errors when starting the VM. Or delete the VM and create new one.
- Bypass the Windows 11 Microsoft Account requirement by disabling netwrok interface for a moment.