Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

virt-manager guest resize not working

Installed virt-manager, target virtual machine is debian jessie with spice-vdagent installed shared clipboard, and latency-free mouse input works

Display: Spice Video: QXL Channel spice: spicevmc, virtio, com.redhat.spice.0 (confirmed /dev devices exist in target vm)

like image 244
ThorSummoner Avatar asked Feb 01 '17 22:02

ThorSummoner


4 Answers

  1. Make sure guest resizing is enabled in virt-manager:

    Menu View -> Scale Display -> Auto resize VM with window (Checked)


  1. Make sure your have a spice agent on your guest (the virtual machine)

    https://www.spice-space.org/download.html#guest

    'spice-vdagent' on linux

    'spice-guest-tools' on windows


How I figured this out,

I found a setting in "spicy" that I assumed had an equivalent in virt-maanger. To connect with spicy from spice-client-gtk apt package, I found the port to connect to by checking sudo ss -nlp | grep qemu, and connected to that port on localhost. Spicy's toggle was much easier to find: Options -> Resize guest to match window size (Checked).

like image 183
ThorSummoner Avatar answered Nov 05 '22 15:11

ThorSummoner


For XFCE, this is a known bug which does not appear to have been fixed yet (confirmed still broken in Xubuntu 20.04).

This issue is due to a change in spice-vdagent whereby instead of changing the resolution directly, it instead notifies the DE to make the change, and that functionality has not been implemented yet in XFCE.

One workaround is to run the following in the guest every time you resize your window:

$ xrandr --output Virtual-1 --auto
like image 45
JBentley Avatar answered Nov 05 '22 16:11

JBentley


According to Installing Windows 10 in KVM + libvirt, visit Spice then scroll down to Windows binaries and then click the link spice guest tools. Proceed to install the spice tools after download completes. Once installation is complete, you should be able to get the guest VM resolution to match that of the resized VM window.

For me, "Auto resize VM with window" was greyed out until I installed the spice guest tools; I did not even have to reboot after installation - this feature was available immediately and it just worked - :).

Host machine: Ubuntu 16.04.6 LTS (Xenial Xerus)

Guest VM: Windows 10 Pro (Version 1809 build 17763.379)

like image 14
AnthonyK Avatar answered Nov 05 '22 16:11

AnthonyK


@ThorSummoner's approach works, but if you have a high resolution monitor, the guest video driver may not have enough memory to draw the larger screen. In that case, you will need to increase the video memory, but unfortunately the virt-manager GUI doesn't provide a method to do so. So instead follow this procedure:

  1. View -> Details -> copy the UUID.
  2. sudo virsh edit <copied uuid>
  3. Look for a line like the following: <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>. Your type and other parameters may be different, but as long as there's a vgamem, you can continue.
  4. Change vgamem to 32768
  5. Save & exit. The config file will automatically be checked for errors.

Then restart your VM, and try again.

like image 11
user60561 Avatar answered Nov 05 '22 15:11

user60561