Virtualization - Bazzite GPU Passthrough & KVM¶
Overview¶
Advanced virtualization features for Bazzite including KVM, VFIO GPU passthrough, Looking Glass (kvmfr), and USB hotplug for VMs.
Quick Reference¶
| Command | Description |
|---|---|
ujust setup-virtualization | Main virtualization setup |
ujust setup-virtualization virt-on | Enable KVM/libvirt |
ujust setup-virtualization virt-off | Disable KVM/libvirt |
ujust setup-virtualization vfio-on | Enable VFIO passthrough |
ujust setup-virtualization vfio-off | Disable VFIO passthrough |
ujust setup-virtualization kvmfr | Setup Looking Glass |
ujust setup-virtualization usbhp-on | Enable USB hotplug |
ujust setup-virtualization usbhp-off | Disable USB hotplug |
KVM/Libvirt¶
Enable Virtualization¶
Enables: - libvirtd service - User permissions for VMs - Default network - QEMU/KVM backend
Disable Virtualization¶
VFIO GPU Passthrough¶
Enable VFIO¶
What VFIO does: - Isolates GPU from host - Passes GPU directly to VM - Near-native GPU performance in VM
Requirements: - Two GPUs (or iGPU + dGPU) - IOMMU support (VT-d or AMD-Vi) - Supported GPU
Disable VFIO¶
Returns GPU to host control.
Looking Glass (kvmfr)¶
Setup kvmfr¶
Looking Glass: - Zero-copy GPU framebuffer sharing - Near-zero latency display - No GPU encoding needed - Mouse/keyboard passthrough
Requirements: - Windows VM with GPU passthrough - Looking Glass host app - IVSHMEM device in VM
Using Looking Glass¶
- Host: Run
looking-glass-client - VM: Run Looking Glass host service
- Connect via shared memory
USB Hotplug¶
Enable USB Hotplug¶
Allows: - Hot-add USB devices to running VMs - Dynamic USB device assignment - No VM restart needed
Disable USB Hotplug¶
Common Workflows¶
Basic VM Setup¶
Gaming VM with GPU Passthrough¶
# 1. Enable VFIO
ujust setup-virtualization vfio-on
# 2. Reboot (GPU now isolated)
systemctl reboot
# 3. Create VM with GPU
# In virt-manager: Add PCI device (GPU)
# 4. Optional: Setup Looking Glass
ujust setup-virtualization kvmfr
Dynamic USB Access¶
# Enable USB hotplug
ujust setup-virtualization usbhp-on
# In running VM:
# - Right-click VM in virt-manager
# - Add Hardware > USB Host Device
# - Select device
IOMMU Groups¶
Check IOMMU¶
# Verify IOMMU enabled
dmesg | grep -i iommu
# List IOMMU groups
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done
GPU IOMMU Group¶
Ideal: GPU alone in IOMMU group. If not, may need ACS override patch.
VM Management¶
Virsh Commands¶
# List VMs
virsh list --all
# Start VM
virsh start <vm-name>
# Shutdown VM
virsh shutdown <vm-name>
# Force off
virsh destroy <vm-name>
GUI Management¶
Troubleshooting¶
VFIO Not Binding GPU¶
Check IOMMU:
Enable in BIOS: - Intel: VT-d - AMD: AMD-Vi / IOMMU
Check binding:
Looking Glass Black Screen¶
Check IVSHMEM:
Verify shared memory:
USB Device Not Passing Through¶
Check permissions:
Check device:
VM Won't Start After VFIO¶
GPU still attached to host:
Reboot may be needed after vfio-on.
Cross-References¶
- bazzite-ai:vm - QCOW2 VM management
- bazzite:gpu - GPU driver configuration
- bazzite-ai:configure - libvirtd service
When to Use This Skill
Use when the user asks about: - "GPU passthrough", "VFIO", "pass GPU to VM" - "Looking Glass", "kvmfr", "VM display" - "KVM", "libvirt", "virtualization" - "USB hotplug", "pass USB to VM" - "gaming VM", "Windows VM", "VM performance" - "IOMMU", "VT-d", "AMD-Vi"