bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Hi Ludovic, Ludovic Courtès writes: > Hi, > > Mathieu Othacehe skribis: > >>> Oh, I wasn’t aware of that, that should certainly be fixed. (I fixed a >>> similar issue in GNOME some years ago, and I’m confident it’ll be easier >>> to fix in Xfce because it doesn’t have all those layers and daemons and >>> JavaScript and DBus interfaces. :-)) >> >> Fixing this behaviour in Xfce seems like the right thing to do to >> conserve SPICE support and fix the QEMU resizing issue. >> >> This also looks like a large development, so I propose to unblock the >> release with this ticket. > > I agree, but it would be nice to find another workaround: invoking > xrandr every second is undesirable. It interferes with user settings > and degrades performance, whether or not one uses SPICE. > > Can the guest determine whether SPICE is being used? That would allow > us to make the hack conditional. I've discovered we could use udev to invoke xrandr only on resizing events, crafted a custom Guile script, and used it to fix this with commit 1d4db94bebba ("gnu: vm-image.tmpl: Improve SPICE dynamic resizing."). I've tested the automatic resizing works with virt-manager and GNOME Boxes, and that nothing happens when using QEMU (the script still runs, consuming 14 MiB of RSS about, but that's it). -- Thanks, Maxim
bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Hi, Mathieu Othacehe skribis: >> Oh, I wasn’t aware of that, that should certainly be fixed. (I fixed a >> similar issue in GNOME some years ago, and I’m confident it’ll be easier >> to fix in Xfce because it doesn’t have all those layers and daemons and >> JavaScript and DBus interfaces. :-)) > > Fixing this behaviour in Xfce seems like the right thing to do to > conserve SPICE support and fix the QEMU resizing issue. > > This also looks like a large development, so I propose to unblock the > release with this ticket. I agree, but it would be nice to find another workaround: invoking xrandr every second is undesirable. It interferes with user settings and degrades performance, whether or not one uses SPICE. Can the guest determine whether SPICE is being used? That would allow us to make the hack conditional. Ludo’.
bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Hey, > Oh, I wasn’t aware of that, that should certainly be fixed. (I fixed a > similar issue in GNOME some years ago, and I’m confident it’ll be easier > to fix in Xfce because it doesn’t have all those layers and daemons and > JavaScript and DBus interfaces. :-)) Fixing this behaviour in Xfce seems like the right thing to do to conserve SPICE support and fix the QEMU resizing issue. This also looks like a large development, so I propose to unblock the release with this ticket. Thanks, Mathieu
bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Hi Maxim, Maxim Cournoyer skribis: > The vm-image.tmpl is the template we use for our graphical Guix demo > QEMU image that can be downloaded from our site > (https://guix.gnu.org/en/download/ -> > https://ftp.gnu.org/gnu/guix/guix-system-vm-image-1.3.0.x86_64-linux.qcow2). > > This commit was made to allow SPICE dynamic resizing to work, as > mentioned in a comment part of this commit. XFCE lacks support for it, > as also mentioned in the comment > (https://gitlab.xfce.org/xfce/xfce4-settings/-/issues/142), which means > a new user downloading the image and running it in a SPICE-capable > viewer such as virt-manager or gnome-boxes will be dismayed that it > doesn't resize as they may have come to expect from other modern > distributions. Understood. (I wonder if the QEMU Guest Agent can serve a similar purpose.) >> Should we remove this workaround, possibly finding another one? > > I think we should use a desktop environment that is better maintained, I think this is unfair criticism: Xfce is actively maintained, with a large user base. > and which works well with SPICE, without hacks, given the improvements > to the user experience it provides, and given it's important that a > first user encounter with Guix be smooth and shiny. GNOME could do it, > at the cost of a bigger image size. Right. I wouldn’t mind GNOME, but one reason we went for Xfce is that GNOME is just too big, at least as currently packaged in Guix. > There are other, perhaps worst issues with XFCE, which is that the > keyboard layout switcher doesn't work, and it didn't seem trivial to fix > when I looked at it. Oh, I wasn’t aware of that, that should certainly be fixed. (I fixed a similar issue in GNOME some years ago, and I’m confident it’ll be easier to fix in Xfce because it doesn’t have all those layers and daemons and JavaScript and DBus interfaces. :-)) That’s a general issue with all Xfce installations, not just in the VM image, right? Thanks, Ludo’.
bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Hi, Maxim Cournoyer skribis: >> There’s a third problem that I initially thought was unrelated: >> >> 3. The mcron job starts running before ‘xorg-server’ is up, and that >> can cause Xorg to fail to start. >> >> Namely, if you run the command above, you’ll see that Xorg starts and >> fails typically a few times in a row, until it eventually succeeds. In >> /var/log/messages, you can see that the ‘xorg-server’ process exits with >> code 1 (without any indication of what went wrong AFAICS) and the >> service gets respawned. >> >> Now if you remove the mcron job and boot the VM, the ‘xorg-server’ >> service successfully starts. It’s 100% reproducible for me. > > I tried to reproduce the problem without any luck on my machine (it > always boots fine). Odd. Does ‘xorg-server’ successfully start from the first time, or does succeed after a few tries? For me it systemically tries a couple of time before it succeeds. Ludo’.
bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Hi, Ludovic Courtès writes: > Ludovic Courtès skribis: > >> Commit 945ad48cd8029fa77a643e00c7fd350e98cacca0 added an mcron job to >> ‘vm-image.tmpl’ that resets screen size every second. I’m don’t fully >> understand the problem this was addressing, but it has two drawbacks: >> >> 1. Kicking in every second is inefficient. >> >> 2. Resetting the screen size prevents users from changing it. For >> example, if I run: >> >>$(guix system vm gnu/system/examples/vm-image.tmpl) -m 1024 >> >> then go to the Xfce menu, Settings -> Display, and change the screen >> size, I have it immediately reset back to the default value. > > There’s a third problem that I initially thought was unrelated: > > 3. The mcron job starts running before ‘xorg-server’ is up, and that > can cause Xorg to fail to start. > > Namely, if you run the command above, you’ll see that Xorg starts and > fails typically a few times in a row, until it eventually succeeds. In > /var/log/messages, you can see that the ‘xorg-server’ process exits with > code 1 (without any indication of what went wrong AFAICS) and the > service gets respawned. > > Now if you remove the mcron job and boot the VM, the ‘xorg-server’ > service successfully starts. It’s 100% reproducible for me. I tried to reproduce the problem without any luck on my machine (it always boots fine). Odd. I don't mind the hack removed, but I think we should aim to keep SPICE dynamic resizing working, and currently that'd mean switching desktop environment, unless we fix https://gitlab.xfce.org/xfce/xfce4-settings/-/issues/142 (GNOME had adjusted for the years old change in SPICE with https://gitlab.gnome.org/GNOME/mutter/-/commit/957513242c26be458be7a101b83180e3f59f6a44), in case your looking for something fun to hack on :-). Thanks, Maxim
bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Hi Ludovic, Ludovic Courtès writes: > Hello! > > Commit 945ad48cd8029fa77a643e00c7fd350e98cacca0 added an mcron job to > ‘vm-image.tmpl’ that resets screen size every second. I’m don’t fully > understand the problem this was addressing, but it has two drawbacks: The vm-image.tmpl is the template we use for our graphical Guix demo QEMU image that can be downloaded from our site (https://guix.gnu.org/en/download/ -> https://ftp.gnu.org/gnu/guix/guix-system-vm-image-1.3.0.x86_64-linux.qcow2). This commit was made to allow SPICE dynamic resizing to work, as mentioned in a comment part of this commit. XFCE lacks support for it, as also mentioned in the comment (https://gitlab.xfce.org/xfce/xfce4-settings/-/issues/142), which means a new user downloading the image and running it in a SPICE-capable viewer such as virt-manager or gnome-boxes will be dismayed that it doesn't resize as they may have come to expect from other modern distributions. > 1. Kicking in every second is inefficient. 5% on my machine, as mentioned in the commit message. The trade is still on the winning side for me (dynamic resizing is a big upgrade for the user experience in my book). > 2. Resetting the screen size prevents users from changing it. For > example, if I run: > >$(guix system vm gnu/system/examples/vm-image.tmpl) -m 1024 > > then go to the Xfce menu, Settings -> Display, and change the screen > size, I have it immediately reset back to the default value. OK. I didn't know this could be workable use case with the stock QEMU viewer when playing with graphical VMs. > Should we remove this workaround, possibly finding another one? I think we should use a desktop environment that is better maintained, and which works well with SPICE, without hacks, given the improvements to the user experience it provides, and given it's important that a first user encounter with Guix be smooth and shiny. GNOME could do it, at the cost of a bigger image size. There are other, perhaps worst issues with XFCE, which is that the keyboard layout switcher doesn't work, and it didn't seem trivial to fix when I looked at it. What do you think? Thanks, Maxim
bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Ludovic Courtès skribis: > Commit 945ad48cd8029fa77a643e00c7fd350e98cacca0 added an mcron job to > ‘vm-image.tmpl’ that resets screen size every second. I’m don’t fully > understand the problem this was addressing, but it has two drawbacks: > > 1. Kicking in every second is inefficient. > > 2. Resetting the screen size prevents users from changing it. For > example, if I run: > >$(guix system vm gnu/system/examples/vm-image.tmpl) -m 1024 > > then go to the Xfce menu, Settings -> Display, and change the screen > size, I have it immediately reset back to the default value. There’s a third problem that I initially thought was unrelated: 3. The mcron job starts running before ‘xorg-server’ is up, and that can cause Xorg to fail to start. Namely, if you run the command above, you’ll see that Xorg starts and fails typically a few times in a row, until it eventually succeeds. In /var/log/messages, you can see that the ‘xorg-server’ process exits with code 1 (without any indication of what went wrong AFAICS) and the service gets respawned. Now if you remove the mcron job and boot the VM, the ‘xorg-server’ service successfully starts. It’s 100% reproducible for me. I suppose the ‘xrandr’ command can kick in too early while Xorg is initializing, causing it to exit. Ludo’.
bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
Hello! Commit 945ad48cd8029fa77a643e00c7fd350e98cacca0 added an mcron job to ‘vm-image.tmpl’ that resets screen size every second. I’m don’t fully understand the problem this was addressing, but it has two drawbacks: 1. Kicking in every second is inefficient. 2. Resetting the screen size prevents users from changing it. For example, if I run: $(guix system vm gnu/system/examples/vm-image.tmpl) -m 1024 then go to the Xfce menu, Settings -> Display, and change the screen size, I have it immediately reset back to the default value. Should we remove this workaround, possibly finding another one? Thanks, Ludo’.