unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
@ 2022-08-09  9:30 Ludovic Courtès
  2022-08-09  9:47 ` Ludovic Courtès
  2022-08-10  1:14 ` Maxim Cournoyer
  0 siblings, 2 replies; 9+ messages in thread
From: Ludovic Courtès @ 2022-08-09  9:30 UTC (permalink / raw)
  To: 57068; +Cc: Maxim Cournoyer

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’.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
  2022-08-09  9:30 bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings Ludovic Courtès
@ 2022-08-09  9:47 ` Ludovic Courtès
  2022-08-10  4:46   ` Maxim Cournoyer
  2022-08-10  1:14 ` Maxim Cournoyer
  1 sibling, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2022-08-09  9:47 UTC (permalink / raw)
  To: 57068; +Cc: Maxim Cournoyer

Ludovic Courtès <ludo@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’.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
  2022-08-09  9:30 bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings Ludovic Courtès
  2022-08-09  9:47 ` Ludovic Courtès
@ 2022-08-10  1:14 ` Maxim Cournoyer
  2022-08-11 10:36   ` Ludovic Courtès
  1 sibling, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2022-08-10  1:14 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 57068

Hi Ludovic,

Ludovic Courtès <ludo@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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
  2022-08-09  9:47 ` Ludovic Courtès
@ 2022-08-10  4:46   ` Maxim Cournoyer
  2022-08-11 10:30     ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2022-08-10  4:46 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 57068

Hi,

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

> Ludovic Courtès <ludo@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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
  2022-08-10  4:46   ` Maxim Cournoyer
@ 2022-08-11 10:30     ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2022-08-11 10:30 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 57068

Hi,

Maxim Cournoyer <maxim.cournoyer@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’.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
  2022-08-10  1:14 ` Maxim Cournoyer
@ 2022-08-11 10:36   ` Ludovic Courtès
  2022-11-01 17:40     ` Mathieu Othacehe
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2022-08-11 10:36 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 57068

Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@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’.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
  2022-08-11 10:36   ` Ludovic Courtès
@ 2022-11-01 17:40     ` Mathieu Othacehe
  2022-11-03 14:59       ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Mathieu Othacehe @ 2022-11-01 17:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 57068, Maxim Cournoyer


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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
  2022-11-01 17:40     ` Mathieu Othacehe
@ 2022-11-03 14:59       ` Ludovic Courtès
  2023-12-30  5:35         ` Maxim Cournoyer
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2022-11-03 14:59 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 57068, Maxim Cournoyer

Hi,

Mathieu Othacehe <othacehe@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’.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings
  2022-11-03 14:59       ` Ludovic Courtès
@ 2023-12-30  5:35         ` Maxim Cournoyer
  0 siblings, 0 replies; 9+ messages in thread
From: Maxim Cournoyer @ 2023-12-30  5:35 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Mathieu Othacehe, 57068-done

Hi Ludovic,

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

> Hi,
>
> Mathieu Othacehe <othacehe@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




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-12-30  5:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-09  9:30 bug#57068: Resizing mcron job in vm-image.tmpl interferes with settings Ludovic Courtès
2022-08-09  9:47 ` Ludovic Courtès
2022-08-10  4:46   ` Maxim Cournoyer
2022-08-11 10:30     ` Ludovic Courtès
2022-08-10  1:14 ` Maxim Cournoyer
2022-08-11 10:36   ` Ludovic Courtès
2022-11-01 17:40     ` Mathieu Othacehe
2022-11-03 14:59       ` Ludovic Courtès
2023-12-30  5:35         ` Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).