Bug 1951173 - Auto resize VM with window does not work correctly
Summary: Auto resize VM with window does not work correctly
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1951580
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-19 17:52 UTC by Jan Vlug
Modified: 2024-01-26 11:24 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-08-07 12:06:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Screenshot of a general protection fault in vdagent. (272.31 KB, image/png)
2021-07-08 21:01 UTC, Jan Vlug
no flags Details

Description Jan Vlug 2021-04-19 17:52:44 UTC
Description of problem:
I installed a Fedora 34 beta VM on a Fedora 33 host with virt-manager. The display of the Fedora 34 VM does not correctly auto resize with the window, even when this option is selected.

I tried both with Video Model Virtio and QXL

Steps to Reproduce:
1. Install Fedora 34 beta in a virt-manager VM.
2. (Try to) enable View | Scale Display | Auto resize VM with window
3. Resize the VM window

Actual results:
The display of the VM does not auto resize.

Expected results:
The display of the VM should auto resize to the size of the containing window.

Additional info:
Initially, I also noted that the "Auto resize VM with window" option was disabled / greyed out. After a bit fiddling with some settings, the option became enabled.

Comment 1 Cole Robinson 2021-05-23 20:44:09 UTC
Thanks for the report. The `Auto resize` option will only become enabled once the VM is fully started, and spice+virt-manager connect to spice-vdagent inside the VM. Hover over the menu option and it will give some info why it is disabled.

As for why it's not working, are you still seeing the issue? If so can you reproduce it with virt-viewer too? `sudo virt-viewer YOUR-VM-NAME`

Comment 2 Jan Vlug 2021-05-23 21:26:32 UTC
I updated the VM. The issue is still there, both in virt-manager and virt-viewer.
I have a two display setup for my host machine, the displays are similar and scaled to 125% on GNOME Wayland. The resolution of both host displays is: 3840x2160 (16:9). The host is now also running Fedora 34, fully up-to-date.
The resolution of the VM seems to be automatically set to 5120x2160 (21:9).
I virt-viewer, I do not see an Auto resize option in the menu.

Comment 3 Jan Vlug 2021-05-23 21:37:22 UTC
I tested auto display resizing also with an older Fedora 32 VM in virt-manager that I have. There auto resizing works fine.
If I open the display settings in the VM, I can see the Resolution. When I resize the window, the Resolution resizes to the window size.

Comment 4 Jan Vlug 2021-05-23 21:39:33 UTC
I also note that when I set the Scale in the Fedora 32 Guest to something other than 100%, the Scale setting is reverted to 100% when resizing the window of the VM.

Comment 5 Cole Robinson 2021-05-24 15:32:01 UTC
virt-viewer uses the autoresize behavior automatically so there's no UI to click.

I can reproduce the issue. It's definitely all sorts of flaky. On one login it seemed to be working perfectly. On a few logins, it would work perfectly once, then next window size change would resize the VM to 1024x768 only, then next one worked, then next 1024, etc. A few logins it didn't work at all. When I'd run `journalctl --follow` inside the VM I wouldn't see any logging from the spice-vdagent happening on window size change, despite the spice client thinking the agent was connected.

Does switching from video qxl to virtio help at all?

Comment 6 Jan Vlug 2021-07-08 21:00:02 UTC
Today I tried again. Still a fully up to date Fedora 34 VM is not resizing, while an old fedora 30 works perfect. As far as I can see both have the same virtual hardware (virtio).
In the Fedora 30 VM journalctl -f is giving logging when resizing the window (although also some ERRORS, but resizing works well, both when logged in into a gnome session and when not logged in).
In the Fedora 34 VM, there is not logging at all when resizing the window.

But, when I restarted the spice-vdagentd, I noticed that it crashed. However ABRT cannot report the crash.

I will attach a screenshot of the crash.

Comment 7 Jan Vlug 2021-07-08 21:01:28 UTC
Created attachment 1799787 [details]
Screenshot of a general protection fault in vdagent.

Comment 8 Jan Vlug 2021-07-08 21:31:23 UTC
I am not really familiar with the whole spice architecture, but I ran:
spice-vdagent -dx
It does log something when I resize the window (although it seems to be about the clipboard).
But when starting, it prints also the error message: ... proxy is for the well-known name org.gnome.Mutter.DisplayConfig without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
and other information about the resolution

Comment 9 Jan Vlug 2021-07-08 22:02:07 UTC
I encountered these crashes when trying to gather further information for this issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1980574
https://bugzilla.redhat.com/show_bug.cgi?id=1980573

Comment 10 Jan Vlug 2021-07-08 22:03:50 UTC
See also: https://bugzilla.redhat.com/show_bug.cgi?id=1966645

Comment 11 Jan Vlug 2021-07-08 22:15:55 UTC
See also:
https://bugzilla.redhat.com/show_bug.cgi?id=1951580

Comment 12 Ed Greshko 2021-07-14 08:59:53 UTC
FYI, I get around this issue by adding and enabling a systemd user unit placed in ~/.config/systemd/user 

The unit contains

[egreshko@frk ~]$ cat .config/systemd/user/spice-vdagent.service 
[Unit]
Description=TestMe
After=plasma-core.target

[Service]
ExecStart=/usr/bin/spice-vdagent -x

[Install]
WantedBy=plasma-core.target

This is only relevant for plasma Xorg.

The reason there is an issue is that /etc/xdg/autostart/spice-vdagent.desktop is no longer processed as it had been in the past.

Comment 13 Jan Vlug 2021-07-26 13:25:01 UTC
I noticed that when I set the Display scaling of the host to 100% for both the displays that I have, the VM seems to (partially) respond to resizing of the VM window. It does not work correctly, but this could maybe indicate that the issue is related to (fractional) scaling of the Displays. Normally, I work on 125% scaling of the displays on the host.

Comment 14 Ed Greshko 2021-07-26 19:33:17 UTC
(In reply to Jan Vlug from comment #13)
> I noticed that when I set the Display scaling of the host to 100% for both
> the displays that I have, the VM seems to (partially) respond to resizing of
> the VM window. It does not work correctly, but this could maybe indicate
> that the issue is related to (fractional) scaling of the Displays. Normally,
> I work on 125% scaling of the displays on the host.

Have you tried changing your guest's display to virtio instead of the default QXL?

Is there a chance you could use maybe an F31 guest to test?

The issue you speak of sounds more like a spice-vdagent one.  But not what this BZ is addressing

Comment 15 Jan Vlug 2021-07-27 15:56:57 UTC
Yes, I tested with virtio with a Fedora 34 VM. That does not work well.
I do not have a F31, but I have an F32. The F32 works perfectly.
I'm the reporter of this bug, maybe I should have made the component spice-vdagent instead of virt-manager. Please let me know if I should change the component this bug applies to.

Comment 16 Jan Vlug 2021-08-07 12:06:39 UTC
Today, I updated a Fedora 34 VM. Made sure the Video Model is set to Virtio, and resizing works. My host computer has a scaling of 150%.

One small issue (separate from this one) is that after a resize, the scaling of the display in the VM goes always back to 100%.
Also, I have only two display scale options in the VM: 100% and 200%.

I'm happy resizing works again and I close this bug report as: worksforme.

Comment 17 pxc14936 2024-01-24 12:36:29 UTC
(In reply to Jan Vlug from comment #16)
> One small issue (separate from this one) is that after a resize, the scaling
> of the display in the VM goes always back to 100%.

I'm sorry if this isn't the right place for this; I'm experiencing this exact issue albeit with a different host/guest OS combination.
It's quite hard to find relevant information on this as the term 'scaling' is used to describe both 'dynamically changing the resolution' and 'making things appear larger'. But the scaling being reset to 100% after a resize does pose a usability issue on hi-dpi screens.

I'm not sure whether this is an issue with the host OS, libvirt, virtio, spice, the guest or if a separate bug report for this already exists. If anyone who has a clearer understanding of how these components interact could point me in the right direction, I'd greatly appreciate the help.

Comment 18 Jan Vlug 2024-01-26 11:24:12 UTC
> if this isn't the right place for this

Because this issue is closed, it is probably better to create a new issue for this. I do also not know which component you should report it to, but I guess someone will correct it if you report against a wrong component.


Note You need to log in before you can comment on or make changes to this bug.