unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Emacs inside container: preserved DISPLAY unavailable etc
@ 2022-01-04 12:29 t
  2022-01-04 17:03 ` zimoun
  2022-01-05 12:39 ` Daniel Meißner
  0 siblings, 2 replies; 6+ messages in thread
From: t @ 2022-01-04 12:29 UTC (permalink / raw)
  To: help-guix

Hi guix.

Straigt out of manual:

--------------------

$ guix shell --container --no-cwd --network emacs-next 
--expose=$HOME/.emacs.d --preserve='^DISPLAY$' -- emacs

No protocol specified
Display :1 unavailable, simulating -nw
Please set the environment variable TERM; see 'tset'.

--------------------

Why? What's going on here? Am I supposed to expose some device or 
smth? This is almost verbatim from Guix manual.

Is there a way to find out which process' reporting that error?

Lets pretend it isn't XXI century and try terminal emacs:

$ guix shell --container --no-cwd --network emacs-next 
--expose=$HOME/.emacs.d --preserve='^TERM$' -- emacs

This starts emacs in the terminal, but fails to load any user 
installed libraries e.g. use-package. Looks like they reside 
inside ~/.guix-profile/share/emacs/site-lisp, so maybe all we need 
to do is again follow the manual and --link-profile

$ guix shell --container --no-cwd --network emacs-next 
--expose=$HOME/.emacs.d --preserve='^TERM$' --link-profile -- 
emacs

That doesn't help but load-path inside emacs has 
$HOME/.guix-profile/share/emacs/site-lisp as first entry, 
hm. However, if we look inside its almost empty. So, I'm not 
entirely sure exactly what --link-profile even achieves. Is there 
some magic in play that "trims" /gnu/store entries only to 
whatever was in manifest (or packages) passed to guix shell 
--container? That would make sense if we are indeed trying to 
isolate things. If so, solution would be to -m manifest.scm with 
all my emacs packages along with emacs-next.

I'd really like to solve the 'display unavailable' above. Could 
anyone help, please?

Thank you


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

* Re: Emacs inside container: preserved DISPLAY unavailable etc
  2022-01-04 12:29 Emacs inside container: preserved DISPLAY unavailable etc t
@ 2022-01-04 17:03 ` zimoun
  2022-01-04 17:11   ` Vlad Kozin
  2022-01-05 12:39 ` Daniel Meißner
  1 sibling, 1 reply; 6+ messages in thread
From: zimoun @ 2022-01-04 17:03 UTC (permalink / raw)
  To: t; +Cc: help-guix

Hi,

On Tue, 4 Jan 2022 at 17:02, <t@fullmeta.me> wrote:

> $ guix shell --container --no-cwd --network emacs-next
> --expose=$HOME/.emacs.d --preserve='^DISPLAY$' -- emacs

This works for me using f43a783 on Debian foreign distro; without the
expose part and I do not think the issue comes from there.

Are you using Guix System or Guix on foreign distro?

Cheers,
simon


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

* Re: Emacs inside container: preserved DISPLAY unavailable etc
  2022-01-04 17:03 ` zimoun
@ 2022-01-04 17:11   ` Vlad Kozin
  0 siblings, 0 replies; 6+ messages in thread
From: Vlad Kozin @ 2022-01-04 17:11 UTC (permalink / raw)
  To: zimoun; +Cc: help-guix


> Are you using Guix System or Guix on foreign distro?

I am on Guix System

$ guix system describe
Generation 10	Nov 23 2021 13:05:39	(current)
guix:
      repository URL: https://git.savannah.gnu.org/git/guix.git
      branch: master
      commit: 21d390bf64ed96ad24363ae270408721eeed4f88



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

* Re: Emacs inside container: preserved DISPLAY unavailable etc
  2022-01-04 12:29 Emacs inside container: preserved DISPLAY unavailable etc t
  2022-01-04 17:03 ` zimoun
@ 2022-01-05 12:39 ` Daniel Meißner
  2022-01-05 13:09   ` t
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Meißner @ 2022-01-05 12:39 UTC (permalink / raw)
  To: t; +Cc: zimoun, help-guix

Hi,

t@fullmeta.me writes:

> Hi guix.
>
> Straigt out of manual:
>
> --------------------
>
> $ guix shell --container --no-cwd --network emacs-next
> --expose=$HOME/.emacs.d --preserve='^DISPLAY$' -- emacs
>
> No protocol specified
> Display :1 unavailable, simulating -nw
> Please set the environment variable TERM; see 'tset'.
>
> --------------------

I am now using Guix System at

guix 049851d
    Repository-URL: https://git.savannah.gnu.org/git/guix.git
    Branch: master
    Commit: 049851d16ebcf8736161b654291085c223972b7c

and the command fails for me as well:

--8<---------------cut here---------------start------------->8---
$ guix shell --container --no-cwd --network emacs-next --expose=$HOME/.emacs.d --preserve='^DISPLAY$' -- emacs
Authorization required, but no authorization protocol specified
Display :1 unavailable, simulating -nw
Please set the environment variable TERM; see 'tset'.
--8<---------------cut here---------------end--------------->8---

A similar error message happened to me with a chromium example from the
manual as described here:

<https://lists.gnu.org/archive/html/help-guix/2021-12/msg00077.html>

However, Simon wasn't able to reproduce this error with his system as
well.  Maybe it is something that happens on Guix system only.

Best,
Daniel


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

* Re: Emacs inside container: preserved DISPLAY unavailable etc
  2022-01-05 12:39 ` Daniel Meißner
@ 2022-01-05 13:09   ` t
  2022-01-05 14:48     ` Daniel Meißner
  0 siblings, 1 reply; 6+ messages in thread
From: t @ 2022-01-05 13:09 UTC (permalink / raw)
  To: Daniel Meißner; +Cc: help-guix

> Authorization required, but no authorization protocol specified

Actually, mine only said "No protocol specified" making it vague, yours at least hint at something to investigate. Googling around shows people don't seem to know what they are doing and afraid to dig into X internals, so most posts are just cargo-culting and trying random stuff. Sadly, I'm in that group, so lets just randomly try stuff:

$ echo $XAUTHORITY
/run/user/1000/gdm/Xauthority

which stores some magic cookie, so lets add

--expose=$XAUTHORITY --preserve='^XAUTHORITY$'

standing ovation, everyone congratulates everyone, noone really understands what just happened

I guess manual needs to be updated, or maybe guix shell --container Scheme code. Dunno

Thank you very much for that STDERR hint


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

* Re: Emacs inside container: preserved DISPLAY unavailable etc
  2022-01-05 13:09   ` t
@ 2022-01-05 14:48     ` Daniel Meißner
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Meißner @ 2022-01-05 14:48 UTC (permalink / raw)
  To: t; +Cc: zimoun, help-guix

t@fullmeta.me writes:
> > Authorization required, but no authorization protocol specified
> 
> Actually, mine only said "No protocol specified" making it vague, yours at least hint at something to investigate.

Yes, the error message changed indeed the last time I tried the container example. I just blindly copied and pasted the output from my shell without noticing really.

> Googling around shows people don't seem to know what they are doing and afraid to dig into X internals, so most posts are just cargo-culting and trying random stuff. Sadly, I'm in that group, so lets just randomly try stuff:
> 
> $ echo $XAUTHORITY
> /run/user/1000/gdm/Xauthority
> 
> which stores some magic cookie, so lets add
> 
> --expose=$XAUTHORITY --preserve='^XAUTHORITY$'
> 
> standing ovation, everyone congratulates everyone, noone really understands what just happened
> 
> I guess manual needs to be updated, or maybe guix shell --container Scheme code. Dunno
> 
> Thank you very much for that STDERR hint

Happy my comment helped and thank you for your solution I will try that for the chromium example as well.

Best,
Daniel



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

end of thread, other threads:[~2022-01-05 21:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 12:29 Emacs inside container: preserved DISPLAY unavailable etc t
2022-01-04 17:03 ` zimoun
2022-01-04 17:11   ` Vlad Kozin
2022-01-05 12:39 ` Daniel Meißner
2022-01-05 13:09   ` t
2022-01-05 14:48     ` Daniel Meißner

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