unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Running graphical apps with guix shell --container
@ 2022-01-27 23:51 Luis Felipe
  2022-01-28 10:11 ` Edouard Klein
       [not found] ` <877daks3vs.fsf@ruhr-uni-bochum.de>
  0 siblings, 2 replies; 7+ messages in thread
From: Luis Felipe @ 2022-01-27 23:51 UTC (permalink / raw)
  To: help guix


[-- Attachment #1.1: Type: text/plain, Size: 935 bytes --]

Hi,

I'm trying to run a GTK application in an isolated environment, but the application seems to fail when trying to be displayed. I'm running these commands:

EXAMPLE:
$ guix shell -C --preserve='^DISPLAY$'
$ python3 mazo
INFO: No database found. Creating it.
INFO: Database created.
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

(mazo:2): Gtk-WARNING **: 23:24:28.154: cannot open display: :1
END EXAMPLE

Also, trying the following example from Guix manual, the browser does not start:

EXAMPLE:
$ guix shell --container --network --no-cwd ungoogled-chromium --preserve='^DISPLAY$' -- chromium
Authorization required, but no authorization protocol specified
END EXAMPLE

I'm using Guix System 037c2b6.


---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

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

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

* Re: Running graphical apps with guix shell --container
  2022-01-27 23:51 Running graphical apps with guix shell --container Luis Felipe
@ 2022-01-28 10:11 ` Edouard Klein
  2022-01-28 15:42   ` Luis Felipe
       [not found] ` <877daks3vs.fsf@ruhr-uni-bochum.de>
  1 sibling, 1 reply; 7+ messages in thread
From: Edouard Klein @ 2022-01-28 10:11 UTC (permalink / raw)
  To: Luis Felipe; +Cc: help-guix

I won't be specifically helpful, but I never managed to get chromium to
run in a container. It crashes almost immediately. If you ever manage
it, I'd be happy to know the magic command that allows it.


Cheers,

Edouard.
Luis Felipe <luis.felipe.la@protonmail.com> writes:

> [[PGP Signed Part:Undecided]]
> Hi,
>
> I'm trying to run a GTK application in an isolated environment, but the application seems to fail when trying to be displayed. I'm running these commands:
>
> EXAMPLE:
> $ guix shell -C --preserve='^DISPLAY$'
> $ python3 mazo
> INFO: No database found. Creating it.
> INFO: Database created.
> 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
>
> (mazo:2): Gtk-WARNING **: 23:24:28.154: cannot open display: :1
> END EXAMPLE
>
> Also, trying the following example from Guix manual, the browser does not start:
>
> EXAMPLE:
> $ guix shell --container --network --no-cwd ungoogled-chromium --preserve='^DISPLAY$' -- chromium
> Authorization required, but no authorization protocol specified
> END EXAMPLE
>
> I'm using Guix System 037c2b6.
>
>
> ---
> Luis Felipe López Acevedo
> https://luis-felipe.gitlab.io/
>
> [2. application/pgp-keys; publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc]...
>
> [[End of PGP Signed Part]]


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

* Re: Running graphical apps with guix shell --container
       [not found] ` <877daks3vs.fsf@ruhr-uni-bochum.de>
@ 2022-01-28 15:22   ` Luis Felipe
  2022-01-28 16:01     ` Luis Felipe
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Felipe @ 2022-01-28 15:22 UTC (permalink / raw)
  To: Daniel Meißner, help guix


[-- Attachment #1.1: Type: text/plain, Size: 2185 bytes --]

Hi Daniel,

On Friday, January 28th, 2022 at 7:42 AM, Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de> wrote:

> > Also, trying the following example from Guix manual, the browser does not start:
> > 

> > EXAMPLE:
> > $ guix shell --container --network --no-cwd ungoogled-chromium
> > --preserve='^DISPLAY$' -- chromium
> > Authorization required, but no authorization protocol specified
> 

> This example only works on foreign distros. See the mails [1-3] on
> help-guix. However, this seems to be known much longer [4]. However,
> IMHO it is not really documented in the manual. Maybe it's time to do
> something about it since this question has now come up three times in
> the last two months. I am willing to write something but I do not feel
> compentent enough since I don't really know much about X.

Somehow I missed those messages... Daniel, I think it would be good to report the issue to https://issues.guix.gnu.org/ with the information in https://lists.gnu.org/archive/html/help-guix/2021-12/msg00088.html, and provide the command below as a proposed replacement, which I can confirm launches chromium in Guix System. I think that would be a start at least. Would you like to do that, or should I do it?

> Concerning the chromium example, for me this works:
> 

> --8<---------------cut here---------------start------------->8---
> guix shell --container --network --no-cwd ungoogled-chromium \
> --preserve='^DISPLAY$' --preserve='^XAUTHORITY$' \
> --expose=$XAUTHORITY -- chromium
> --8<---------------cut here---------------end--------------->8---
> 

> Maybe for your example (I couldn't check since I didn't find any package
> called mazo or python-mazo) this would work:

Yeah, sorry, I should have mentioned that "mazo" is an application I'm writing. It's not in Guix yet.

> --8<---------------cut here---------------start------------->8---
> guix shell -C --preserve='^DISPLAY$' --preserve='^XAUTHORITY$' \
> --expose=$XAUTHORITY
> --8<---------------cut here---------------end--------------->8---

Unfortunately, this didn't work. I got the same result as before.

Daniel, thanks for taking a look at this.

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

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

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

* Re: Running graphical apps with guix shell --container
  2022-01-28 10:11 ` Edouard Klein
@ 2022-01-28 15:42   ` Luis Felipe
  2022-01-28 21:12     ` Edouard Klein
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Felipe @ 2022-01-28 15:42 UTC (permalink / raw)
  To: Edouard Klein; +Cc: help-guix


[-- Attachment #1.1: Type: text/plain, Size: 559 bytes --]

Hi Edouard,

On Friday, January 28th, 2022 at 10:11 AM, Edouard Klein <edou@rdklein.fr> wrote:

> I won't be specifically helpful, but I never managed to get chromium to
> run in a container. It crashes almost immediately. If you ever manage
> it, I'd be happy to know the magic command that allows it.

Could you try the command shared by Daniel in https://lists.gnu.org/archive/html/help-guix/2022-01/msg00167.html ? It worked for me. At least chromium runs and I could browse a couple of websites without crashes (didn't test for too long, though).

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

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

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

* Re: Running graphical apps with guix shell --container
  2022-01-28 15:22   ` Luis Felipe
@ 2022-01-28 16:01     ` Luis Felipe
  2022-01-29 20:15       ` Luis Felipe
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Felipe @ 2022-01-28 16:01 UTC (permalink / raw)
  To: Luis Felipe; +Cc: Daniel Meißner, help guix


[-- Attachment #1.1: Type: text/plain, Size: 1393 bytes --]

On Friday, January 28th, 2022 at 3:22 PM, Luis Felipe <luis.felipe.la@protonmail.com> wrote:
> On Friday, January 28th, 2022 at 7:42 AM, Daniel Meißner daniel.meissner-i4k@ruhr-uni-bochum.de wrote:

> > Maybe for your example (I couldn't check since I didn't find any package
> > called mazo or python-mazo) this would work:
> 

> Yeah, sorry, I should have mentioned that "mazo" is an application I'm writing. It's not in Guix yet.
> 

> > --8<---------------cut here---------------start------------->8---
> > guix shell -C --preserve='^DISPLAY$' --preserve='^XAUTHORITY$' \
> > --expose=$XAUTHORITY
> > --8<---------------cut here---------------end--------------->8---
> 

> Unfortunately, this didn't work. I got the same result as before.

I managed to launch the app by mixing the command above with some parts of the command used in another message about the same subject (https://lists.gnu.org/archive/html/help-guix/2020-07/msg00012.html). So this worked:

EXAMPLE:
guix shell -C -E "^DISPLAY$" -E "^XAUTHORITY$" --expose="$XAUTHORITY" --share=/tmp/.X11-unix/ --share=$HOME/.Xauthority
END EXAMPLE

But I'm just typing things without much consideration and hoping for the best :) For example, the application now starts but it has no icons. So I guess I'll go find some information about all the fundamental variables and resources required by GTK apps to run.

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

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

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

* Re: Running graphical apps with guix shell --container
  2022-01-28 15:42   ` Luis Felipe
@ 2022-01-28 21:12     ` Edouard Klein
  0 siblings, 0 replies; 7+ messages in thread
From: Edouard Klein @ 2022-01-28 21:12 UTC (permalink / raw)
  To: Luis Felipe; +Cc: help-guix

It does work ! Thank you very much :)
Luis Felipe <luis.felipe.la@protonmail.com> writes:

> [[PGP Signed Part:Undecided]]
> Hi Edouard,
>
> On Friday, January 28th, 2022 at 10:11 AM, Edouard Klein <edou@rdklein.fr> wrote:
>
>> I won't be specifically helpful, but I never managed to get chromium to
>> run in a container. It crashes almost immediately. If you ever manage
>> it, I'd be happy to know the magic command that allows it.
>
> Could you try the command shared by Daniel in
> https://lists.gnu.org/archive/html/help-guix/2022-01/msg00167.html ? It worked
> for me. At least chromium runs and I could browse a couple of websites without
> crashes (didn't test for too long, though).
>
> [2. application/pgp-keys; publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc]...
>
> [[End of PGP Signed Part]]


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

* Re: Running graphical apps with guix shell --container
  2022-01-28 16:01     ` Luis Felipe
@ 2022-01-29 20:15       ` Luis Felipe
  0 siblings, 0 replies; 7+ messages in thread
From: Luis Felipe @ 2022-01-29 20:15 UTC (permalink / raw)
  To: Luis Felipe; +Cc: Daniel Meißner, help guix


[-- Attachment #1.1: Type: text/plain, Size: 1724 bytes --]

On Friday, January 28th, 2022 at 4:01 PM, Luis Felipe <luis.felipe.la@protonmail.com> wrote:
> 

> So this worked:
> 

> EXAMPLE:
> guix shell -C -E "^DISPLAY$" -E "^XAUTHORITY$" --expose="$XAUTHORITY" --share=/tmp/.X11-unix/ --share=$HOME/.Xauthority
> END EXAMPLE
> 

> But I'm just typing things without much consideration and hoping for the best :) For example, the application now starts but it has no icons. So I guess I'll go find some information about all the fundamental variables and resources required by GTK apps to run.

I took a shortcut and just added "gnome" package to the manifest. After this, I also noticed a dbind-related warning¹ when starting the app and lots of dconf-related warnings² when using a file chooser dialog from the app. I got rid of the former by exposing the socket mentioned in the warning, while the latter went away after exposing the machine-id. So the command now looks like this:

EXAMPLE:
guix shell -C -E "^DISPLAY$" -E "^XAUTHORITY$" --expose="$XAUTHORITY" --expose=/tmp/.X11-unix/ --expose=$HOME/.Xauthority --expose=/tmp/dbus-P03C3WeCs0 --expose=/etc/machine-id
END EXAMPLE

At this point, the app is displayed and works as expected :)


1. dbind-WARNING **: 19:19:29.619: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-P03C3WeCs0: No such file or director
2. dconf-WARNING **: 19:39:19.279: failed to commit changes to dconf: Cannot spawn a message bus without a machine-id: Unable to load /gnu/store/qqs98rxwjrji6aaf6dqwp7q4m545g2sn-glib-2.70.0/var/lib/dbus/machine-id or /etc/machine-id: Failed to open file ?/gnu/store/qqs98rxwjrji6aaf6dqwp7q4m545g2sn-glib-2.70.0/var/lib/dbus/machine-id?: No such file or directory

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1815 bytes --]

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

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

end of thread, other threads:[~2022-01-29 20:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 23:51 Running graphical apps with guix shell --container Luis Felipe
2022-01-28 10:11 ` Edouard Klein
2022-01-28 15:42   ` Luis Felipe
2022-01-28 21:12     ` Edouard Klein
     [not found] ` <877daks3vs.fsf@ruhr-uni-bochum.de>
2022-01-28 15:22   ` Luis Felipe
2022-01-28 16:01     ` Luis Felipe
2022-01-29 20:15       ` Luis Felipe

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