all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#61101: Graphical container examples forget to expose things.
@ 2023-01-27 16:50 Maxime Devos
  2023-01-27 17:34 ` Simon Tournier
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Devos @ 2023-01-27 16:50 UTC (permalink / raw)
  To: 61101


[-- Attachment #1.1.1: Type: text/plain, Size: 2982 bytes --]

Many of the graphical container examples don't work.

For example, take

      guix shell --container --network --no-cwd ungoogled-chromium \
        --preserve='^DISPLAY$' -- chromium

from (guix)Invoking guix shell.  It fails with:

Authorization required, but no authorization protocol specified
[1:1:0127/163058.718097:ERROR:ozone_platform_x11.cc(238)] Missing X 
server or $DISPLAY
[1:1:0127/163058.718126:ERROR:env.cc(255)] The platform failed to 
initialize.  Exiting.

To make it work, "XAUTHORITY" needs to be preserved and exposed:

guix shell --container --network --no-cwd ungoogled-chromium 
--preserve='^DISPLAY$' --preserve='^XAUTHORITY$' --expose=/tmp/.X11-unix 
--expose="$XAUTHORITY" -- chromium

For another example, take "eolie" from "(guix)Invoking guix environment":

      guix environment --preserve='^DISPLAY$' --container --network \
        --expose=/etc/machine-id \
        --expose=/etc/ssl/certs/ \
        --share=$HOME/.local/share/eolie/=$HOME/.local/share/eolie/ \
        --ad-hoc eolie nss-certs dbus --  eolie

it fails with

Authorization required, but no authorization protocol specified
Unable to init server: Could not connect: Connection refused
Authorization required, but no authorization protocol specified
Unable to init server: Could not connect: Connection refused
Authorization required, but no authorization protocol specified
Unable to init server: Could not connect: Connection refused

Preserving XAUTHORITY and exposing $XAUTHORITY makes it actually start, 
though the created window is invisible.  Exposing /sys makes the window 
actually visible, albeit with

(WebKitWebProcess:2): Gtk-WARNING **: 16:40:32.008: cannot open display: :1
Unable to init server: Could not connect: Connection refused

warnings.


An additional issue, is that the examples -- even after adjustment -- 
stop working with network-less containers, e.g.

guix environment --preserve='^DISPLAY|XAUTHORITY$' --container 
--expose=/etc/machine-id        --expose=/etc/ssl/certs/ 
--expose="$XAUTHORITY" 
--share=$HOME/.local/share/eolie/=$HOME/.local/share/eolie/ 
--expose=/sys --expose=/sys/bus  --ad-hoc eolie nss-certs dbus --  eolie


fails with

Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(org.gnome.Eolie:1): Gtk-WARNING **: 16:41:53.524: cannot open display: :1.

(I discovered this with the FHS container example in 
https://guix.gnu.org/en/blog/2023/the-filesystem-hierarchy-standard-comes-to-guix-containers/ 
-- it was a no-network application I tried out, so I left out the 
--network.)

To fix this, I had to add --expose=/tmp/.X11-unix.  It should be 
documented how to make network-less containers for graphical 
applications -- nowhere in the manual or FHS blog post is /tmp/.X11-unix 
mentioned.

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

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

* bug#61101: Graphical container examples forget to expose things.
  2023-01-27 16:50 bug#61101: Graphical container examples forget to expose things Maxime Devos
@ 2023-01-27 17:34 ` Simon Tournier
  2023-01-27 19:44   ` bug#47106: " Maxime Devos
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Tournier @ 2023-01-27 17:34 UTC (permalink / raw)
  To: Maxime Devos, 61101

Hi,

On ven., 27 janv. 2023 at 17:50, Maxime Devos <maximedevos@telenet.be> wrote:
> Many of the graphical container examples don't work.

I think it is related to #47097 [1].

1: <http://issues.guix.gnu.org/issue/47097>


Cheers,
simon




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

* bug#47106: bug#61101: Graphical container examples forget to expose things.
  2023-01-27 17:34 ` Simon Tournier
@ 2023-01-27 19:44   ` Maxime Devos
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Devos @ 2023-01-27 19:44 UTC (permalink / raw)
  To: 47106, Simon Tournier


[-- Attachment #1.1.1: Type: text/plain, Size: 768 bytes --]



On 27-01-2023 18:34, Simon Tournier wrote:
> Hi,
> 
> On ven., 27 janv. 2023 at 17:50, Maxime Devos <maximedevos@telenet.be> wrote:
>> Many of the graphical container examples don't work.
> 
> I think it is related to #47097 [1].
> 
> 1: <http://issues.guix.gnu.org/issue/47097>


Right, didn't notice that one.
That one appears to be mostly about inputs though, not about XAUTHORITY 
and /tmp/.X11-unix stuff.

I think <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47106> is closer
<https://issues.guix.gnu.org/47106>, being about XAUTHORITY and /sys -- 
and in <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47106#50>, about 
/tmp/.X11-unix.

It's a more general issue though, not only the eolie example is affected.

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

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

end of thread, other threads:[~2023-01-27 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27 16:50 bug#61101: Graphical container examples forget to expose things Maxime Devos
2023-01-27 17:34 ` Simon Tournier
2023-01-27 19:44   ` bug#47106: " Maxime Devos

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.