Running old games and applications under QEMU on a Wayland desktop tends to hit the same three walls:
- The 640×480 guest is blurry when enlarged, the mouse drifts or crawls on a HiDPI screen, and the Windows XP mouse feels slow.
- Printing to
LPT1freezes the whole VM — display, monitor andSIGTERM— when the print server behind a socket stops reading. - Game CDs ripped as
.cue/.binplay no CD music, and Windows CD Player sees no audio disc.
Each has its own patch series and write-up. This page shows how to combine them.
1. The three series
| Series | Fixes | Touches | Patches |
|---|---|---|---|
| qemu-wayland-scaler | Blurry Wayland/HiDPI scaling, relative-pointer drift in SDL and GTK, slow PS/2 mouse in Windows XP; adds pixel-exact -display sdl,scaler=integer|integerplus|nearest|linear (cycled at run time with Ctrl+Alt+S) and zoom-to-fit=on for SDL | ui/gtk.c, ui/sdl2*.c, qapi/ui.json, qemu-options.hx, hw/input/ps2.c | 9 |
| qemu-parallel-port-freeze | Whole-VM freeze when a socket chardev behind LPT1 stops draining; raises the printer BUSY line instead of blocking the vCPU thread | hw/char/parallel.c, include/hw/char/parallel.h | 1 |
| qemu-cue-bin | Native .cue/.bin images and CD audio on ide-cd: digital extraction (READ CD) and analog PLAY AUDIO through an audiodev | hw/ide/ (atapi.c, new cdrom-cue.{c,h}, core.c, ide-dev.c) | 3 |
The series touch disjoint parts of QEMU. Without their options — no scaler=, a file chardev, an .iso image — QEMU behaves as upstream.
2. Applying all three and building
mkdir qemu-retro && cd qemu-retro
git clone https://gitlab.com/qemu-project/qemu.git
git clone https://github.com/zirize/qemu-wayland-scaler.git
git clone https://github.com/zirize/qemu-parallel-port-freeze.git
git clone https://github.com/zirize/qemu-cue-bin.git
cd qemu
git checkout -b retro 5f664cd37a # QEMU 11.1.50, the base all thirteen patches were checked on
git am ../qemu-wayland-scaler/patches/qemu-master/000[1-9]-*.patch
git am ../qemu-parallel-port-freeze/patches/0001-parallel-nonblocking-tx.patch
git am ../qemu-cue-bin/patches/000[1-3]-*.patch
./configure --target-list=i386-softmmu,x86_64-softmmu --enable-sdl --enable-pipewire
ninja -C build
SDL is needed for scaler=; the audio backend (PipeWire here, or PulseAudio/ALSA) carries CD audio. The qemu-wayland-scaler repository also has the scaler series rebased onto the screamer fork for Mac OS 9 guests.
3. One command line using all three
./build/qemu-system-i386 \
-enable-kvm -M pc -m 512 \
-display sdl,scaler=integerplus \
-audiodev pipewire,id=pw0 \
-device AC97,audiodev=pw0 \
-chardev socket,id=lpt0,host=127.0.0.1,port=9100,server=off \
-parallel chardev:lpt0 \
-drive file=disk.qcow2,if=ide,index=0,media=disk \
-drive file=/path/to/game.cue,if=ide,index=2,media=cdrom
Display and mouse
- Use
-display sdlrather thangtkon Wayland; SDL handles pointer constraints and relative motion natively. scaler=integerkeeps an exact integer multiple with borders;scaler=integerplusscales up by an integer, then stretches to fill the window.- Ctrl+Alt+S steps through the scaler modes while the guest runs. Add
zoom-to-fit=onto keep the window size when the guest changes resolution instead of snapping back to 1:1. - Do not add
gl=on: the GL path ignoresscaler=and always filters bilinearly.
Parallel port
- When the socket peer stops reading, the guest sees a busy printer and waits; QEMU, its display and its monitor stay responsive.
- A
filechardev never fills up and was never affected.
CD-ROM
- Point the CD-ROM at the
.cue; the.binfiles are found next to it. - With exactly one
-audiodevthe CD-ROM uses it automatically; with several, add-global ide-cd.audiodev=pw0. - To swap discs in Windows 98 SE from the monitor, send
eject, wait about 1.5 seconds, thenchange, so CD Player notices the new disc.
4. Guest notes
CD audio: digital or analog
| Guest OS / audio driver | Digital (DAE) | Analog |
|---|---|---|
| DOS (MSCDEX) | not available | works |
| Windows 95 | not available | works |
| Windows 98 SE + Sound Blaster (VxD) | not available | works |
| Windows 98 SE + WDM driver (AC97) | works (opt-in) | works (default) |
| Windows XP | works (recommended) | works |
Why, and what was actually tested: qemu-cue-bin.
Windows XP refuses “Enable digital CD audio”
An XP VM that first booted on an unpatched QEMU has cached “no CD-DA” for the drive under HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}\0000\DigitalAudio (CDDASupported = 0, CDDAAccurate = 0) and never re-checks. In Device Manager, uninstall QEMU DVD-ROM and scan for hardware changes (or reboot), then tick the checkbox again. Deleting the DigitalAudio key and rebooting works too.
Verified
On 2026-11-24 all thirteen patches (scaler 1–9, parallel port 1, CUE/BIN 1–3) were applied in the order above onto QEMU 5f664cd37a with no conflicts, and qemu-system-i386 was built with the configure line above. Its -help lists scaler= and zoom-to-fit= on the SDL display line only, and the binary passes the qemu-cue-bin Linux test on pc and q35. Guest-level testing of each feature is described on its own page.
Not submitted upstream
QEMU declines contributions that include or derive from AI-generated content, and all three series were written with Claude. None of them are in QEMU. They are offered as-is under QEMU's licence (GPL-2.0-or-later).