-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GPU passthrough and Windows VM with Looking Glass #3454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
GPU passthrough and Windows VM with Looking Glass #3454
Conversation
|
Wow, this seems amazing! Thanks for making this! 🙌 The black-screen risk is real. I had to turn off GPU acceleration in Brave/Chromium because I got black screens during Google Meet meetings regularly. I assume this could be related (don't have to be). Do you think this is a one-off, or that could happen again? Or is that a misconfiguration or a bug in the latest packages? (I didn't have that before, so when I troubleshooted, I thought it could be because of a Mesa or similar update, but I'm not sure. |
|
The black screen risk I mentioned is specifically about the first boot after GPU passthrough setup - it happened to me during testing when something didn't configure correctly (kernel params or Hyprland trying to start on the wrong GPU). Your Brave/Chromium issue sounds different. |
|
This is truly amazing. I would never have believed I would see GPU-heavy tasks like playing Counter-Strike 2 in a Windows VM running via Docker on Linux, in a home setting. Good job! |
|
This is just awesome, hope this gets implemented into the main branch! |
5502de0 to
9138bf1
Compare
|
If you want to merge this it would make sense to point this to |
|
Hi! |
9138bf1 to
d8680b5
Compare
Done
Hey @hngrdev, give it another shot - should handle more IOMMU configurations now. If it still doesn't work, drop a diagnostic report here. Recent changes:
Want to help test GPU passthrough? # Fetch PR branch
git -C "$OMARCHY_PATH" fetch origin pull/3454/head:feat/omarchy-gpu-passthrough
# Switch to test branch
omarchy-update-branch feat/omarchy-gpu-passthrough
# Test it out
omarchy-gpu-passthrough info detect # Check hardware compatibility
omarchy-gpu-passthrough setup # Run setup
omarchy-windows-vm install # Install Windows VM with Looking GlassAny feedback welcome. |
d8680b5 to
66983ab
Compare
|
It would be useful to be able to point this at a raw block device instead of a virtual volume. Use case would be having a dual boot that could be bootable or could be loaded as VM. |
1566bff to
350d8d8
Compare
|
minor fixes and rebase from v3.2.1 |
350d8d8 to
614564b
Compare
Interesting idea. Should be possible since QEMU supports raw block devices. Main challenge would be configuring docker-compose correctly to prevent accidental overwrites - you'd want the disk passed through as read-write but with installation disabled. Would need to detect existing OS and skip the Windows installation flow entirely. |
|
Gave it another try on my laptop, didn't work, here are the results: 0000:00:01.0 is the PCI bridge, and it seems like it can't be bound to vfio-pci, but can be bound to pci-stub if [ ! -d "/sys/kernel/iommu_groups/2/devices/" ]; then for device in /sys/kernel/iommu_groups/2/devices/*; do driver=$(lspci -k -s "$pci_addr" | grep -i "Kernel driver in use" | awk -F': ' '{print $2}') echo "Device: $pci_addr" Device: 0000:01:00.0 Device: 0000:01:00.1 Device: 0000:01:00.2 Device: 0000:01:00.3 GPU Passthrough Diagnostics ℹ️ Collecting system information... [SYSTEM INFORMATION] [CPU] [Operating System] [Bootloader] [Motherboard] [Display Session] [GPU INFORMATION] [GPU 1: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]] DRM Card: card1 [GPU 2: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile]] [IOMMU INFORMATION] IOMMU Status: Enabled Active VFIO IOMMU Groups: 1 [GPU 1: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]] [GPU 2: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile]] [KERNEL CONFIGURATION] [Kernel Command Line] [IOMMU Parameters] iommu=pt: ✓ Enabled [LOADED KERNEL MODULES] [VFIO Modules] [NVIDIA Modules] [AMD GPU Modules] [DRIVER VERSIONS] [NVIDIA Driver] [AMD GPU Driver] [VFIO Driver] [GPU PASSTHROUGH CONFIGURATION] [GPU Configuration: /etc/omarchy-gpu-passthrough.conf] GPU Passthrough Config - Generated 2025-11-29GPU_PCI_ADDR="01:00.0" [Limine Configuration: /etc/default/limine] [VFIO Configuration: /etc/modprobe.d/vfio.conf] VFIO GPU Passthrough - Generated 2025-11-29options vfio-pci disable_vga=1 [Driver Blacklist: /etc/modprobe.d/blacklist-gpu-passthrough.conf] GPU Passthrough - Prevent NVIDIA auto-load at bootinstall nvidia /bin/false [System Environment (/etc/environment)] [PROCESSES USING GPU] [NVIDIA GPU Processes] [DRI Device Handles] [NVIDIA Device Handles] [RECENT GPU PASSTHROUGH LOGS] [Last 50 lines of /var/log/omarchy-gpu-passthrough/gpu-passthrough.log] RELEVANT BOOT MESSAGES (dmesg) [IOMMU Messages] [VFIO Messages] [Boot VGA Device] [PCI Passthrough Messages] [END OF DIAGNOSTICS REPORT] Report saved to: /tmp/omarchy-gpu-passthrough-diagnostics-20251129_160137.txt ✓ Report saved: /tmp/omarchy-gpu-passthrough-diagnostics-20251129_160137.txt |
Installation and launch of Looking Glass for low-latency VM display with IVSHMEM setup and permission management.
Dedicated GPU passthrough with automatic driver binding, IOMMU setup and state management. Mode switching, setup wizard and diagnostics.
GPU passthrough, Looking Glass support and hardware spoofing. Installation wizard and lifecycle management.
SPICE socket 666 → 660+kvm. Use sg kvm for group refresh.
Detects if dockurr/windows image has SPICE support and auto-builds if missing. No manual workaround needed - transparent during installation.
Replace echo with emoji (❌,⚠️ , ✓) with msg_* functions. Added msg_* to omarchy-looking-glass-install.
Reduces user friction during installation: consolidates sudo prompts, eliminates YAY/pacman interactive prompts, hides Docker build logs. Fixes desktop launcher bug. Adds snapshot integration for GPU passthrough.
Adds tmpfiles.d and sudoers configuration for passwordless desktop launcher operations. Reorganizes Windows VM installation: collect decisions first, show summary, confirm once, then execute. Removes exec sg kvm pattern.
62b66fb to
f17b423
Compare
|
minor doc updates and rebase from v3.2.2 |
|
@hngrdev thanks for the detailed diagnostic report!
You're right - the script shouldn't try to pass PCI bridges to the VM. They're host-side infrastructure that connects the PCIe slot to the CPU. I've pushed a fix that filters out devices with class Could you update and try again? git -C "$OMARCHY_PATH" fetch origin pull/3454/head:feat/omarchy-gpu-passthrough
omarchy-update-branch feat/omarchy-gpu-passthrough
# Re-run setup to regenerate config
omarchy-gpu-passthrough setup
# Remove old VM completely
omarchy-windows-vm remove
rm -rf ~/.config/windows/
# Reinstall VM with new config
omarchy-windows-vm installIf you have time, could you share (paste to https://pastebin.com if too long): Let's move this to the discussion thread: #3455 |
c0bad19 to
0318217
Compare
0318217 to
8025f20
Compare
GPU passthrough and Windows VM with Looking Glass
TL;DR: Run Windows 11 with dedicated GPU passthrough, Looking Glass for low-latency gaming and hardware spoofing for anti-cheat compatibility. Tested with Fortnite and Counter-Strike 2.
Demo: Omarchy: GPU passthrough + Windows 11 VM installation - Complete setup, gaming with Fortnite and Counter-Strike 2, benchmarks and switching GPU back to host for LM Studio.
See discussion thread for community testing and feedback: #3455
What's New
This PR adds GPU passthrough automation, Looking Glass integration and Windows VM enhancements:
GPU Passthrough Tools (omarchy-gpu-passthrough)
Automated GPU passthrough with mode switching between VM and host usage.
Commands:
What it does:
Files added:
omarchy-gpu-passthrough- Main dispatcheromarchy-gpu-passthrough-bind- Mode controlomarchy-gpu-passthrough-info- Diagnosticsomarchy-gpu-passthrough-setup- Setup wizardomarchy-gpu-passthrough-utils- Shared libraryLooking Glass Integration (omarchy-looking-glass-install, omarchy-looking-glass-launch)
Low-latency VM display using shared memory (IVSHMEM). Near-native gaming performance.
Commands:
What it does:
Note: Default escape key is Scroll Lock. If your keyboard lacks this key, configure a different key in
~/.config/looking-glass/client.inibefore launching (see Looking Glass documentation for key names).Files added:
omarchy-looking-glass-install- Installation scriptomarchy-looking-glass-launch- Client launcherWindows VM Management (omarchy-windows-vm)
Enhanced with GPU passthrough, Looking Glass support and hardware spoofing.
New commands:
Existing commands:
What's new:
show-composecommand for testing docker-compose generationInstallation options:
~/Windowsis never removed (preserved across reinstalls)Both installation and uninstall are idempotent (safe to run multiple times).
Files modified:
omarchy-windows-vmAutomatic SPICE Support
Looking Glass requires SPICE for keyboard/mouse input. Upstream
dockurr/windowsrejected SPICE support (PR #1567) due to image size concerns.Solution:
omarchy-windows-vmautomatically builds a custom image with SPICE when needed:Note: See Known Limitations section for previous manual workaround (now obsolete).
Hardware Requirements
BIOS Settings (one-time):
Hardware:
Looking Glass Display Requirement:
Looking Glass needs a display connected to your dedicated GPU. Options:
Without display on GPU, only slow RDP will work.
Tested Hardware:
Tested on Omarchy versions: 3.1.7, 3.2.0, 3.2.1, 3.2.2
Known working hardware:
Not tested: AMD dedicated GPUs, Intel Arc GPUs
Quick Start
Prerequisites:
1. Install GPU Passthrough
2. Verify Configuration (after reboot)
If you encounter issues, please share the output of these commands in the discussion thread.
3. Install Windows VM
omarchy-windows-vm install # Interactive wizard (~20 min)During installation you'll be prompted to install Looking Glass. Installation is automated if you choose yes. You can also install manually with
omarchy-looking-glass-install.4. Launch Windows VM
5. Switch GPU back to host (optional)
omarchy-windows-vm stop omarchy-gpu-passthrough mode host # Use GPU on host (CUDA, LM Studio, etc.)Known Limitations
Experimental Status
Tested on author and community hardware configurations (see Known working hardware). Backup your system before installation.
Black Screen Risk
Can occur after first GPU passthrough setup (first boot with blacklisted GPU). System blacklists dedicated GPU for VM passthrough. If Hyprland configuration fails, desktop won't start.
Recovery:
Ctrl+Alt+F2to switch to TTY2omarchy-gpu-passthrough setup(re-configure)OR:
omarchy-gpu-passthrough setup --uninstall(remove)Prevention: Set "Primary Display = IGD" in BIOS before setup.
Anti-Cheat Compatibility
Hardware spoofing included (SMBIOS, CPU flags).
Tested: Fortnite/EasyAntiCheat, Counter-Strike 2
Not tested: Valorant/Vanguard, BattlEye, other anti-cheat systems
Upstream DependencySOLVED: Automatic SPICE BuildUpstream Dependency (Temporary)Waiting for newdockurr/windowsrelease. SPICE support fix merged toqemus/qemu(PR #978) butdockurr/windowshasn't released new version yet.Workaround (for testing now):bash~~ ~~git clone https://github.com/dockur/windows.git~~ ~~cd windows~~ ~~git fetch origin pull/1567/head:spice-support~~ ~~git checkout spice-support~~ ~~docker build -t dockurr/windows:latest .~~ ~~This creates localdockurr/windows:latestimage. Scripts will use this local image. Workaround won't be needed after new release.Update: Manual workaround no longer needed.
omarchy-windows-vmnow automatically builds custom image with SPICE support when Looking Glass is enabled. Build happens transparently during installation. See "Automatic SPICE Support" in What's New section.Other Limitations
omarchy-gpu-passthrough setup --uninstallTesting This PR
Want to test GPU passthrough before it's merged? Follow these steps:
Notes:
omarchy-update-branchautomatically creates snapshot and updates system/var/backups/omarchy-gpu-passthrough/omarchy-gpu-passthrough setup --uninstallRelated Discussion
This addresses the feature request from #3307
Community testing and feedback welcome in the discussion thread.
Credits
Thanks to @sspaeti for the original
omarchy-windows-vmimplementation and @dhh for Omarchy and inspiration.