The SPICE support in KVM Ubunt 16.04 guest

Table of Contents

1. Problem

The OS can't detect the qxl video driver. The display resolution can't be changed not to mention adjust automatically.

Try to solve it by kill X,then reconfigure it.

init 3

after relogin

X -configure

It keep complains

X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-97-generic x86_64 Ubuntu
Current Operating System: Linux station167 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-62-generic root=UUID=355663b7-9481-4414-bcb9-4ee9b76c4a6b ro
Build Date: 13 October 2017  01:57:05PM
xorg-server 2:1.18.4-0ubuntu0.7 (For technical support please see http://www.ubuntu.com/support) 
Current version of pixman: 0.33.6
      Before reporting problems, check http://wiki.x.org
      to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
      (++) from command line, (!!) notice, (II) informational,
      (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Jan 20 09:50:48 2018
List of video drivers:
      amdgpu
      ati
      intel
      nouveau
      qxl
      radeon
      vmware
      modesetting
      vesa
      fbdev
(II) [KMS] Kernel modesetting enabled.
No devices to configure.  Configuration failed.
(EE) Server terminated with error (2). Closing log file.

2. Solution

  1. Turn off Xserver used

    sudo init 3
    
  2. Remove xserver-xorg-core

    sudo apt-get remove  xserver-xorg-core -y
    
  3. Install the driver or so

    sudo apt-get install  spice-vdagent gdm xserver-xorg-video-qxl-hwe-16.04 
    
  4. Create the xorg.conf we needed

    sudo X -configure
    sudo cp ./xorg.conf.new /etc/X11/xorg.conf
    
    
  5. Get X Back

    sudo apt-get install   xserver-xorg-core xserver-xorg-input-all -y
    
  6. Make sure spice-vdagent start automatically

    sudo systemctl enable spice-vdagentd
    sudo systemctl start spice-vdagentd
    
  7. Time to cross your fingers

    sudo init 5
    

If everything goes smoothly, your screen resolution will change automatically.

blogroll

social