Virtualization on Linux#
QEMU with KVM (recommended)#
QEMU with KVM gives near-native performance on Linux hosts and is the primary tested environment.
Install#
sudo apt install qemu-system-x86 qemu-kvm virt-managerCheck that KVM is available:
kvm-okIf KVM is not available, QEMU will still work but will run slower without hardware acceleration.
Boot a raw image#
qemu-system-x86_64 \
-cdrom vitruvian.img -boot menu=on \
-m 8G -cpu host -smp sockets=1,cores=2,threads=2 --enable-kvm \
-netdev user,id=mynet,hostfwd=tcp::2222-:22 \
-device virtio-net-pci,netdev=mynetAdjust -m (RAM in MB) and -smp (CPU cores) to your host. Remove -enable-kvm if KVM is unavailable.
Boot an ISO#
qemu-system-x86_64 \
-cdrom vitruvian.iso -boot menu=on \
-m 8G -cpu host -smp sockets=1,cores=2,threads=2 --enable-kvm \
-netdev user,id=mynet,hostfwd=tcp::2222-:22 \
-device virtio-net-pci,netdev=mynetUseful flags#
| Flag | Purpose |
|---|---|
-display gtk | Use a GTK window instead of SDL |
-display spice-app | Use SPICE for better clipboard and display integration |
-cpu host | Expose host CPU features to the guest (better compatibility) |
-snapshot | Run without writing changes back to the image |
-serial stdio | Print serial output to the terminal |
GNOME Boxes#
GNOME Boxes provides a simple GUI over QEMU/KVM. It works but offers less control over VM parameters. Useful for quick tests.
VirtualBox#
Install from virtualbox.org or your distribution’s package manager. Create a new VM with:
- Type: Linux, version Linux 2.6 / 3.x / 4.x (64-bit)
- RAM: 4 GB or more
- Display: VMSVGA, 3D acceleration off
- Storage: attach the raw or ISO image
VirtualBox is slower than QEMU/KVM on Linux and is less well-tested with Vitruvian.