This is a Ubuntu 22.04 guest, gnonme, wayland session although the problem exists for the xorg session too.
To reproduce: 1 start with a working gnome session, that is, auto-resizing of guest is working 2 in the guest, manually set the display resolution to something low 3 now, auto resizing does not work BUT it still works in the greeter, that is, in the login screen. It only stops working after I login. So technically, virt-manager is still sending resize messages, and the guess is capable of responding to them in the login screen. The problem is the gnome session after I login. It looks like manually changing the display resolution has somehow broken the ability of the gnome session to respond the resize messages.
Using remote-viewer is the same.
I am using the virtio display driver.
Update
If I create a new gnome user, auto display resizing works for that user. So it is definitely a session-specific problem I have triggered somehow.
Fix
To fix this annoying problem, in Display settings, choose the resolution which matches the current display. It will be present, it just is not the selected resolution. Once you "align" gnome display resolution with the current actual size of the guest window, auto-resizing works again.
You need to remove
monitors.xml
located in~/.config/monitors.xml
and log out from the current session. It's an undocumented file that sets parameters for the monitor in the current user session.Each time the monitor is manually set with gnome-settings, this file is written.