supervacuo.com

c v t

Windows 8.1 in QEMU: custom resolutions and QXL

28 September 2014

Windows 8.1 works pretty well as a QEMU guest:

  • qemu-kvm-1.6.2-8.fc20.x86_64
  • qemu-common-1.6.2-8.fc20.x86_64
  • qemu-system-x86-1.6.2-8.fc20.x86_64

One missing piece is a QXL (video) driver — the RedHat-provided driver installer won't run on Windows 8 or later.

So, two solutions if you need a screen resolution not provided by the "vgastd" driver (like my 1366x768 laptop screen).

Tomaž Šolc wrote an excellent guide on recompiling QEMU 1.4.0 to add custom screen resolutions to the "vgastd" driver.

A comment on that article notes that the sources have moved since 1.4, though — on Fedora, you can recompile like so:

$ yumdownloader --noplugins --source seabios
$ rpm -ivh seabios*.rpm
$ cd rpmbuild/SOURCES
$ $EDITOR 0002-resolutions.patch

Add the following:

$ diff -ur seabios-1.7.3.1.old/vgasrc/bochsvga.c seabios-1.7.3.1/vgasrc/bochsvga.c
--- seabios-1.7.3.1.old/vgasrc/bochsvga.c   2014-08-27 10:31:58.807413368 +0100
+++ seabios-1.7.3.1/vgasrc/bochsvga.c   2014-09-23 15:12:30.873538124 +0100
@@ -89,6 +89,7 @@
{ 0x18a, { MM_DIRECT, 2560, 1600, 16, 8, 16, SEG_GRAPH } },
{ 0x18b, { MM_DIRECT, 2560, 1600, 24, 8, 16, SEG_GRAPH } },
{ 0x18c, { MM_DIRECT, 2560, 1600, 32, 8, 16, SEG_GRAPH } },
+ { 0x18d, { MM_DIRECT, 1368, 768, 24, 8, 16, SEG_GRAPH } },
};

static int is_bochsvga_mode(struct vgamode_s *vmode_g)

Then edit ~/rpmbuild/SPECS/seabios.spec to add Patch0002 under Patch0001 and a corresponding patch0002 under patch0001. Run rpmdev-bumpspec to update the ChangeLog and release number then rpmbuild -bb seabios.spec to rebuild. Install the resulting RPMs from ~/rpmbuild/RPMS, restart your QEMU guest and select the new resolution!

NB that although my laptop resolution is 1366x768, the patch adds 1368x768 — apparently a known bug in QEMU means that resolution dimensions must be divisible by 8 (otherwise the screen is completely garbled).

The second possibility is a "not official, completely untested" QXL driver for Windows 8, written (I think) by Vadim Rozenfeld. The driver is available as a ZIP file and some feedback and advice on it can be found in RedHat bug #89536.