Ubuntu – Ubuntu 16.04 KVM + QXL Guest – Can’t change resolution

16.04kvmspice

Using Spice + QXL for a 16.04 guest running on a 16.04 KVM hypervisor. This was working normally until recently.

After the last reboot of the guest, resolution was set to 1024×768. When I try setting it back to 1680×1050 (or any resolution), the session freezes until the timeout reverts back to the previous resolution.

spice-vdagent and the xorg QXL driver are installed on the guest.

(edit: added additional info)

This allowed me to change the resolution, but is not persistent across reboots:

xrandr -s 1680x1050

Best Answer

I had this same issue, but I tried so many things that I am not sure what made the difference. Going in reverse of what I did to get a working solution.

1) In the KVM host, I changed the Video from "QXL" --> "VGA" (worked after this)

2) Updated ~/.config/monitors.xml with:

<monitors version="1">
  <configuration>
    <clone>no</clone>
    <output name="Virtual-0">
      <vendor>unknown</vendor>
      <product>unknown</product>
      <serial>unknown</serial>
      <width>1440</width>
      <height>900</height>
      <rate>59.990913391113281</rate>
      <x>0</x>
      <y>0</y>
      <rotation>normal</rotation>
      <reflect_x>no</reflect_x>
      <reflect_y>no</reflect_y>
      <primary>yes</primary>
      <presentation>no</presentation>
      <underscanning>no</underscanning>
    </output>
  </configuration>
  <configuration>
    <clone>no</clone>
    <output name="Virtual-0">
      <vendor>???</vendor>
      <product>0x0000</product>
      <serial>0x00000000</serial>
      <width>1440</width>
      <height>900</height>
      <rate>60</rate>
      <x>0</x>
      <y>0</y>
      <rotation>normal</rotation>
      <reflect_x>no</reflect_x>
      <reflect_y>no</reflect_y>
      <primary>yes</primary>
      <presentation>no</presentation>
      <underscanning>no</underscanning>
    </output>
  </configuration>
</monitors>

3) Updated /etc/default/grub adding: "GRUB_GFXMODE=1440x900" and then running "sudo update-grub"

4) Using advice from this post ( Reinstall package and its installed dependencies) to reinstall Gnome:

sudo apt-cache depends gnome | grep '[ |]Depends: [^<]' | cut -d: -f2 | tr -d ' ' | xargs sudo apt-get --reinstall install -y

Hope this helps!