Looking Glass is an open-source application that copies the framebuffer of a virtual machine with a passed-through GPU into shared memory and displays it in a window on the Linux host with very low latency. In Linux virtualization, it solves a specific problem of VFIO GPU passthrough: the guest owns a physical graphics card whose output normally goes to a separate monitor, and Looking Glass makes that output visible on the host desktop without a second screen, a capture card or a video encoder.
The project is licensed under the GPLv2 and uses its own transport called KVMFR (KVM Frame Relay). It is aimed mainly at Windows guests used for games, creative software or engineering applications that need native GPU performance, while the user keeps working in the Linux host session.
How Looking Glass moves frames from guest to host
Looking Glass relies on a shared memory region between guest and host, exposed to the virtual machine as an IVSHMEM device (Inter-VM Shared Memory). Inside the guest, a capture program grabs each new frame from the GPU and writes it into that region; on the host, a client reads the same memory and draws the frame with OpenGL or EGL. No data passes through a network stack and no lossy compression is applied, so image quality equals the guest output.
The naming confuses many newcomers: the program that runs inside the Windows guest is called the host application, because it hosts the frames, while the program on the Linux machine is the client. Mouse and keyboard input travel back through a SPICE channel provided by QEMU, and the optional SPICE guest agent synchronizes the clipboard.
The table below summarizes the parts that must work together.
| Component | Runs where | Role |
|---|---|---|
| Host application | Windows guest | Captures GPU frames and writes them to shared memory |
| Client | Linux host | Reads frames and renders them in a window |
| IVSHMEM device | QEMU virtual hardware | Exposes the shared memory to the guest |
| kvmfr kernel module | Linux host kernel | Optional shared memory backend with DMA-BUF support |
| SPICE channel | QEMU | Carries keyboard, mouse and clipboard data |
| IVSHMEM driver | Windows guest | Lets the host application access the shared memory |
Shared memory sizing and capture methods
The shared memory size must fit two full frames plus overhead. The documented rule is width times height times 4 bytes times 2, converted to mebibytes, plus about 10 MiB, rounded up to the next power of two. An undersized region causes the host application to fail or to fall back to lower resolutions.
| Guest resolution | Calculated need | Configured size |
|---|---|---|
| 1920 x 1080 | About 26 MiB | 32 MiB |
| 2560 x 1440 | About 39 MiB | 64 MiB |
| 3840 x 2160 | About 74 MiB | 128 MiB |
Higher bit depth or HDR output roughly doubles the memory per pixel, so those configurations need the next larger size. Capture itself uses either the DXGI Desktop Duplication API, which works with any Windows-compatible GPU, or NvFBC, an NVIDIA interface limited to certain professional cards. Direct3D 12 capture is available in recent releases and can lower overhead on modern drivers.
Looking Glass compared with other display paths
Looking Glass is one of several ways to see a passthrough VM’s output, and the right choice depends on whether the guest runs on the same machine as the viewer. Its advantage is local, uncompressed, low-latency viewing; its limitation is that it works only on the physical host.
| Method | Latency and quality | Main constraint |
|---|---|---|
| Looking Glass | Very low latency, lossless | Same physical machine only |
| Second monitor or input switch | Native, no added latency | Extra hardware and desk space |
| SPICE or VNC console | High latency, emulated display | Unsuitable for GPU-accelerated work |
| Game streaming protocols | Low latency, lossy video encoding | Compression artifacts and network dependence |
| Remote desktop protocols | Variable, optimized for office use | Poor for full-screen 3D applications |
Looking Glass also differs from virtio-gpu and VirGL, which provide paravirtualized graphics without dedicating a physical card. Those approaches need no second GPU but offer far lower 3D performance and limited support for Windows guests.
Requirements and configuration in practice
A working setup starts with functional VFIO GPU passthrough under KVM and QEMU, typically managed through libvirt. The host needs IOMMU support enabled in firmware and kernel, and in most cases a second GPU or integrated graphics for the host desktop.
- Add an IVSHMEM device to the libvirt domain XML, or load the kvmfr module and point QEMU at its device file.
- Keep a SPICE display and input channel for keyboard, mouse and clipboard, while disabling the emulated video adapter where possible.
- Install the IVSHMEM driver and host application in the Windows guest and let it start as a service.
- Attach a display or an HDMI display emulator plug to the guest GPU, because many drivers render nothing without a detected monitor.
- Start the client on the Linux host with matching client and host application versions.
Version matching is strict: the client and the guest application must come from the same release, or the client refuses to connect. File permissions on the shared memory device and AppArmor or SELinux policies for QEMU are the other frequent causes of startup errors.
Limitations and common problems
Looking Glass narrows the gap to native output, but it does not remove every cost of a virtualized display.
| Symptom | Likely cause | Typical fix |
|---|---|---|
| Black window or no frames | Guest GPU has no detected display | Connect a monitor or display emulator plug |
| Client refuses to connect | Version mismatch | Install matching releases on both sides |
| Permission denied on shared memory | Wrong owner or security policy | Adjust device permissions and policy rules |
| Stutter at high refresh rates | Memory bandwidth or CPU pinning issues | Pin vCPUs and use the kvmfr module |
| Capture fails on secure screens | Windows protects login and UAC prompts | Use the SPICE fallback for those screens |
Each frame is copied at least once, which consumes host memory bandwidth and CPU time, especially at 4K and high refresh rates. Anti-cheat software in some games blocks or detects virtual machines regardless of the display method, and Looking Glass cannot solve that.
Stripped to the essentials
Imagine a second computer hidden inside your main one, with its own powerful graphics card. Normally you would need a separate screen to see what it shows. Looking Glass acts like a window cut into the wall between the two computers. The picture from the hidden one appears in a normal window on your main desktop.
The picture travels through shared memory, not a cable or a network. It arrives almost instantly and without blurring. That is why people use it for games and graphics work.
Where it is applied
A 3D designer works on a Linux workstation with an integrated GPU for the desktop and a dedicated graphics card passed through to a Windows virtual machine. The Windows guest runs a CAD package and a rendering tool that have no Linux version. Instead of switching monitor inputs dozens of times a day, the designer configures a 64 MiB kvmfr shared memory region for a 2560 x 1440 guest display and attaches a small display emulator plug to the passed-through card.
The Looking Glass client runs in a resizable window next to Linux terminals and a browser. Viewport rotation in the CAD software feels as responsive as on bare metal, the clipboard works between both systems, and the second monitor previously reserved for the virtual machine is now used as extra workspace for the Linux desktop.