VM guest resolution is not saved anymore

Bug #2068908 reported by Raffaele Rialdi

This bug report will be marked for expiration in 22 days if no further activity occurs. (find out why)

8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu
Incomplete
Undecided
Unassigned

Bug Description

I am running Ubuntu 24.04 as host and a VM with Ubuntu 24.04 as guest.
I am using VirtIO as driver on Spice (localhost).
The log was created from the VM.

The VMM window is set with these options:
- Scale Display: Always + Auto resize VM with window

Steps to repro:
- I set the resolution of the guest to 1920x1080
- maximize the VMM window (or change the window size in any other way)

The resolution is now 5120x2672) which is weird as the monitor is "just" 4K.

Before upgrading to 24.04 I was on 23.10 and this never occurred.
According to the "Scale Display" option, the window should stretch, making the content bigger. Instead, it resets the resolution to the maximum available which is far bigger than the supported monitor resolution.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: xorg 1:7.7+23ubuntu3
ProcVersionSignature: Ubuntu 6.8.0-35.35-generic 6.8.4
Uname: Linux 6.8.0-35-generic x86_64
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CasperMD5CheckResult: pass
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Mon Jun 10 16:11:30 2024
DistUpgraded: 2024-05-30 17:43:10,553 DEBUG migrateToDeb822Sources()
DistroCodename: noble
DistroVariant: ubuntu
GraphicsCard:
 Red Hat, Inc. Virtio 1.0 GPU [1af4:1050] (rev 01) (prog-if 00 [VGA controller])
   Subsystem: Red Hat, Inc. Virtio 1.0 GPU [1af4:1100]
InstallationDate: Installed on 2024-02-16 (115 days ago)
InstallationMedia: Ubuntu 23.10.1 "Mantic Minotaur" - Release amd64 (20231016.1)
Lsusb:
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
 Bus 001 Device 003: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Lsusb-t:
 /: Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/15p, 480M
     |__ Port 001: Dev 002, If 0, Class=Human Interface Device, Driver=usbhid, 480M
     |__ Port 002: Dev 003, If 0, Class=Human Interface Device, Driver=usbhid, 480M
 /: Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/15p, 5000M
MachineType: QEMU Standard PC (Q35 + ICH9, 2009)
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-6.8.0-35-generic root=UUID=3bb2f1ef-40f7-4a13-b608-ffbc1c1e873d ro quiet splash vt.handoff=7
SourcePackage: xorg
Symptom: display
UpgradeStatus: Upgraded to noble on 2024-05-30 (11 days ago)
dmi.bios.date: 04/01/2014
dmi.bios.release: 0.0
dmi.bios.vendor: SeaBIOS
dmi.bios.version: 1.16.3-debian-1.16.3-2
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.version: pc-q35-8.0
dmi.modalias: dmi:bvnSeaBIOS:bvr1.16.3-debian-1.16.3-2:bd04/01/2014:br0.0:svnQEMU:pnStandardPC(Q35+ICH9,2009):pvrpc-q35-8.0:cvnQEMU:ct1:cvrpc-q35-8.0:sku:
dmi.product.name: Standard PC (Q35 + ICH9, 2009)
dmi.product.version: pc-q35-8.0
dmi.sys.vendor: QEMU
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.120-2build1
version.libgl1-mesa-dri: libgl1-mesa-dri 24.0.5-1ubuntu1
version.libgl1-mesa-glx: libgl1-mesa-glx N/A
version.xserver-xorg-core: xserver-xorg-core 2:21.1.12-1ubuntu1
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:22.0.0-1build1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20210115-1build1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-2build1

Revision history for this message
Raffaele Rialdi (raffaeler) wrote :
summary: - Resolution is not saved anymore
+ VM guest resolution is not saved anymore
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

"Scale Display: Always + Auto resize VM with window" sounds like a feature of the hypervisor. Which hypervisor are you using?

Usually to resize a VM dynamically it either uses;
 (a) A custom Xorg driver in the guest (but you're not using Xorg); or
 (b) Virtually hotplugging the virtual monitor with one of a new resolution.

Overall I'm not sure which software component is expected to be responsible for this. It might help to take a closer look at 23.10 where it worked and list the differences in the guest like kernel driver in use, and Wayland vs Xorg.

affects: xorg (Ubuntu) → ubuntu
Changed in ubuntu:
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Are there multiple card devices in /dev/dri/ ? If so then please try:

  sudo rm /dev/dri/card0

and log in again.

Revision history for this message
Raffaele Rialdi (raffaeler) wrote :

I am not anymore sure whether I am using xorg or not. Could you provide me a link to understand that please? (sorry for the basic question)

```
/dev/dri$ ls
by-path card1 renderD128
```

Do you want me to remove `card1`?

Thanks

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

No please don't delete card1.

Try logging out and then on the login screen choose 'Ubuntu on Xorg' from the menu in the bottom right corner. Then log in again.

Revision history for this message
Raffaele Rialdi (raffaeler) wrote :

I did it: when I log in with the 'Ubuntu on Xorg' radio button selected, I proceed in logging in and get back the following message: "Display output is not active".

The problem now is that I cannot get the shell anymore, even if I select 'Ubuntu' back.

I can only login on the terminal using Ctl-Alt-F3 ... how do I restore back the shell?

Thank you

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That sounds like a whole new bug. Try rebooting and be sure to select 'Ubuntu' before logging in again.

Revision history for this message
Raffaele Rialdi (raffaeler) wrote :

ok I rebooted and could log in with 'Ubuntu' again.
I then retried to logout and picking 'Ubuntu on Xorg' and I don´t see the message anymore, but I get the "X" cross and get straight back to the login screen with my name.
I finally reverted again on 'Ubuntu' and logged in.

I am not sure what you expected from trying to login picking 'Ubuntu on Xorg'.
Please let me know if I have to make other tests.
Thanks

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I was expecting the Ubuntu desktop but also without this bug :)

Revision history for this message
Raffaele Rialdi (raffaeler) wrote :

Got it :)

I have other VMs on the same host/KVM exhibiting the same behavior.
I did not tweak anything, so they are on their defaults. This should make it easier to repro the issue.

One of these Ubuntu VMs have a GPU remapped with IOMMU and it happens very often that the 'Ubuntu' login ends up into a black screen. After multiple reboots I can finally login. I don´t know if this can be related or not. I will eventually open a separate bug.

Let me know if you need more tests.
Thank you

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If you have a VM running KDE or LXQt and it boots to a black screen then see bug 2063143.

Revision history for this message
Raffaele Rialdi (raffaeler) wrote :

Thank you @Daniel but the VM with the black screen is Ubuntu 24.04 with the default shell.
Does this article apply as well?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

No. Default Ubuntu with GNOME should not have that bug.

Revision history for this message
Raffaele Rialdi (raffaeler) wrote :

Do you want me to open a separate bug for the black screen issue?
I can open it from the terminal (Ctl-Alt-3).
Meanwhile, any workaround/suggestion to reliably get gnome up is welcome :)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes a separate bug for the black screen sounds sensible.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.