GNU bug report logs - #57068
Resizing mcron job in vm-image.tmpl interferes with settings

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Tue, 9 Aug 2022 09:31:01 UTC

Severity: important

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57068 in the body.
You can then email your comments to 57068 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to maxim.cournoyer <at> gmail.com, bug-guix <at> gnu.org:
bug#57068; Package guix. (Tue, 09 Aug 2022 09:31:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to maxim.cournoyer <at> gmail.com, bug-guix <at> gnu.org. (Tue, 09 Aug 2022 09:31:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: bug-guix <at> gnu.org
Subject: Resizing mcron job in vm-image.tmpl interferes with settings
Date: Tue, 09 Aug 2022 11:30:33 +0200
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’.




Information forwarded to bug-guix <at> gnu.org:
bug#57068; Package guix. (Tue, 09 Aug 2022 09:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 57068 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 57068 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#57068: Resizing mcron job in vm-image.tmpl interferes with
 settings
Date: Tue, 09 Aug 2022 11:47:17 +0200
Ludovic Courtès <ludo <at> gnu.org> 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’.




Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 09 Aug 2022 09:48:02 GMT) Full text and rfc822 format available.

Added indication that bug 57068 blocks53214 Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 09 Aug 2022 09:48:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#57068; Package guix. (Wed, 10 Aug 2022 01:15:01 GMT) Full text and rfc822 format available.

Message #15 received at 57068 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 57068 <at> debbugs.gnu.org
Subject: Re: bug#57068: Resizing mcron job in vm-image.tmpl interferes with
 settings
Date: Tue, 09 Aug 2022 21:14:29 -0400
Hi Ludovic,

Ludovic Courtès <ludo <at> gnu.org> 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




Information forwarded to bug-guix <at> gnu.org:
bug#57068; Package guix. (Wed, 10 Aug 2022 04:47:01 GMT) Full text and rfc822 format available.

Message #18 received at 57068 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 57068 <at> debbugs.gnu.org
Subject: Re: bug#57068: Resizing mcron job in vm-image.tmpl interferes with
 settings
Date: Wed, 10 Aug 2022 00:46:04 -0400
Hi,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Ludovic Courtès <ludo <at> gnu.org> 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




Information forwarded to bug-guix <at> gnu.org:
bug#57068; Package guix. (Thu, 11 Aug 2022 10:31:02 GMT) Full text and rfc822 format available.

Message #21 received at 57068 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 57068 <at> debbugs.gnu.org
Subject: Re: bug#57068: Resizing mcron job in vm-image.tmpl interferes with
 settings
Date: Thu, 11 Aug 2022 12:30:14 +0200
Hi,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> 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’.




Information forwarded to bug-guix <at> gnu.org:
bug#57068; Package guix. (Thu, 11 Aug 2022 10:37:02 GMT) Full text and rfc822 format available.

Message #24 received at 57068 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 57068 <at> debbugs.gnu.org
Subject: Re: bug#57068: Resizing mcron job in vm-image.tmpl interferes with
 settings
Date: Thu, 11 Aug 2022 12:36:42 +0200
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> 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’.




Information forwarded to bug-guix <at> gnu.org:
bug#57068; Package guix. (Tue, 01 Nov 2022 17:42:02 GMT) Full text and rfc822 format available.

Message #27 received at 57068 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 57068 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#57068: Resizing mcron job in vm-image.tmpl interferes with
 settings
Date: Tue, 01 Nov 2022 18:40:55 +0100
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




Removed indication that bug 57068 blocks Request was from Mathieu Othacehe <mathieu <at> meije.mail-host-address-is-not-set> to control <at> debbugs.gnu.org. (Tue, 01 Nov 2022 17:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#57068; Package guix. (Thu, 03 Nov 2022 15:00:02 GMT) Full text and rfc822 format available.

Message #32 received at 57068 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 57068 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: bug#57068: Resizing mcron job in vm-image.tmpl interferes with
 settings
Date: Thu, 03 Nov 2022 15:59:05 +0100
Hi,

Mathieu Othacehe <othacehe <at> gnu.org> 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’.




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Sat, 30 Dec 2023 05:36:01 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Sat, 30 Dec 2023 05:36:01 GMT) Full text and rfc822 format available.

Message #37 received at 57068-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Mathieu Othacehe <othacehe <at> gnu.org>, 57068-done <at> debbugs.gnu.org
Subject: Re: bug#57068: Resizing mcron job in vm-image.tmpl interferes with
 settings
Date: Sat, 30 Dec 2023 00:35:13 -0500
Hi Ludovic,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi,
>
> Mathieu Othacehe <othacehe <at> gnu.org> 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 archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 27 Jan 2024 12:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.