Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Disk crisis, please clean up!


devel / comp.unix.shell / Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

SubjectAuthor
* Failed to run Emacs in X windows mode on remote host over ssh withhongy...@gmail.com
+* Re: Failed to run Emacs in X windows mode on remote host over sshGrant Taylor
|`* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| +* Re: Failed to run Emacs in X windows mode on remote host over sshGrant Taylor
| |`* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| | +- Re: Failed to run Emacs in X windows mode on remote host over sshDavid W. Hodgins
| | `* Re: Failed to run Emacs in X windows mode on remote host over sshGrant Taylor
| |  +* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
| |  |`* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| |  | +* Re: Failed to run Emacs in X windows mode on remote host over sshGrant Taylor
| |  | |+* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
| |  | ||+* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| |  | |||`- Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaDan Espen
| |  | ||`* Re: Failed to run Emacs in X windows mode on remote host over sshJanis Papanagnou
| |  | || `* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
| |  | ||  `- Re: Failed to run Emacs in X windows mode on remote host over sshGrant Taylor
| |  | |`* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| |  | | `* Re: Failed to run Emacs in X windows mode on remote host over sshGrant Taylor
| |  | |  `- Re: Failed to run Emacs in X windows mode on remote host over sshGrant Taylor
| |  | `* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaSpiros Bousbouras
| |  |  `- Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| |  `* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| |   +* Re: Failed to run Emacs in X windows mode on remote host over sshGrant Taylor
| |   |`- Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| |   +* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
| |   |`- Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| |   `* Re: Failed to run Emacs in X windows mode on remote host over sshWilliam Unruh
| |    +- Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
| |    `- Re: Failed to run Emacs in X windows mode on remote host over sshJanis Papanagnou
| `* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
|  `* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
|   +* Re: Failed to run Emacs in X windows mode on remote host over sshDavid W. Hodgins
|   |`* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
|   | `* Re: Failed to run Emacs in X windows mode on remote host over sshDavid W. Hodgins
|   |  `* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
|   |   `* Re: Failed to run Emacs in X windows mode on remote host over sshDavid W. Hodgins
|   |    `* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
|   |     `* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
|   |      +- Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
|   |      `* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
|   |       `* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
|   |        +- Re: Failed to run Emacs in X windows mode on remote host over sshJanis Papanagnou
|   |        `* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
|   |         +* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwahongy...@gmail.com
|   |         |`* Re: Failed to run Emacs in X windows mode on remote host over sshWilliam Unruh
|   |         | `* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwahongy...@gmail.com
|   |         |  `* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
|   |         |   `- Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwahongy...@gmail.com
|   |         `* Re: Failed to run Emacs in X windows mode on remote host over sshPeter van Hooft
|   |          `* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
|   |           `- Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaSpiros Bousbouras
|   `* Re: Failed to run Emacs in X windows mode on remote host over sshDavid W. Hodgins
|    `- Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
+* Re: Failed to run Emacs in X windows mode on remote host over sshDavid W. Hodgins
|`- Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
`* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson
 `* Re: Failed to run Emacs in X windows mode on remote host over sshhongy...@gmail.com
  `- Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwaKeith Thompson

Pages:123
Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<sdt5cr$ivj$1@news-1.m-online.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4148&group=comp.unix.shell#4148

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!news.karotte.org!news.space.net!news.m-online.net!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
Date: Thu, 29 Jul 2021 04:56:27 +0200
Organization: (posted via) M-net Telekommunikations GmbH
Lines: 30
Message-ID: <sdt5cr$ivj$1@news-1.m-online.net>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<87o8angpmu.fsf@nosuchdomain.example.com>
<a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com>
<op.06717tfya3w0dxdave@hodgins.homeip.net>
<b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com>
<op.0676hnzna3w0dxdave@hodgins.homeip.net>
<72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com>
<op.0677u7bya3w0dxdave@hodgins.homeip.net>
<687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com>
<5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com>
<874kceh5y0.fsf@nosuchdomain.example.com>
<923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com>
NNTP-Posting-Host: 2001:a61:241e:cc01:10d0:e283:d601:c4c7
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news-1.m-online.net 1627527387 19443 2001:a61:241e:cc01:10d0:e283:d601:c4c7 (29 Jul 2021 02:56:27 GMT)
X-Complaints-To: news@news-1.m-online.net
NNTP-Posting-Date: Thu, 29 Jul 2021 02:56:27 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
In-Reply-To: <923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com>
 by: Janis Papanagnou - Thu, 29 Jul 2021 02:56 UTC

On 29.07.2021 04:51, hongy...@gmail.com wrote:
> On Wednesday, July 28, 2021 at 10:24:45 PM UTC+8, Keith Thompson wrote:
>> "hongy...@gmail.com" <hongy...@gmail.com> writes:
>> [...]
>>>> Got it. To be sure, your method is right, but I happened to use an
>>>> error value of "$DISPLAY". Here, I summarize the successful methods
>>>> as follows:
>>>>
>>>> Obtain the value of `$DISPLAY' locally on the ssh server:
>>>>
>>>> $ echo $DISPLAY
>>>> :1
>>>
>>> Or use the following method:
>>>
>>> $ xdpyinfo | grep -i display
>>> name of display: :1
>> That seems pointless. xdpyinfo gets the value to show by looking at
>> $DISPLAY. (I had suggested running xdpyinfo just to see whether it
>> succeeds or fails.)
>
> Then, where does $DISPLAY come from?

From the environment. (As the man page also tells you.)

Janis

> HY
>

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<87r1fhg1vk.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4149&group=comp.unix.shell#4149

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
Date: Wed, 28 Jul 2021 21:50:07 -0700
Organization: None to speak of
Lines: 54
Message-ID: <87r1fhg1vk.fsf@nosuchdomain.example.com>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<87o8angpmu.fsf@nosuchdomain.example.com>
<a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com>
<op.06717tfya3w0dxdave@hodgins.homeip.net>
<b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com>
<op.0676hnzna3w0dxdave@hodgins.homeip.net>
<72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com>
<op.0677u7bya3w0dxdave@hodgins.homeip.net>
<687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com>
<5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com>
<874kceh5y0.fsf@nosuchdomain.example.com>
<923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="f7dbd806dd1436700e4487cff600874e";
logging-data="26171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/y9BTMhi7laPTrXNUXDF/n"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:mlk/jBDiAKhLI2BUlfeutIaBMEA=
sha1:OtLv4x2itpRLGfa2XYzXHnlkEMs=
 by: Keith Thompson - Thu, 29 Jul 2021 04:50 UTC

"hongy...@gmail.com" <hongyi.zhao@gmail.com> writes:
> On Wednesday, July 28, 2021 at 10:24:45 PM UTC+8, Keith Thompson wrote:
>> "hongy...@gmail.com" <hongy...@gmail.com> writes:
>> [...]
>> >> Got it. To be sure, your method is right, but I happened to use an
>> >> error value of "$DISPLAY". Here, I summarize the successful methods
>> >> as follows:
>> >>
>> >> Obtain the value of `$DISPLAY' locally on the ssh server:
>> >>
>> >> $ echo $DISPLAY
>> >> :1
>> >
>> > Or use the following method:
>> >
>> > $ xdpyinfo | grep -i display
>> > name of display: :1
>> That seems pointless. xdpyinfo gets the value to show by looking at
>> $DISPLAY. (I had suggested running xdpyinfo just to see whether it
>> succeeds or fails.)
>
> Then, where does $DISPLAY come from?

It's an environment variable, of course. It's set by sshd (if X
forwarding is enabled) and inherited by your shell, or it's set by
whatever invokes your terminal emulator if you launch it on the system
itself, or by anything else that sets it.

emacs displays the message
Display localhost:10.0 unavailable, simulating -nw
if and only if XOpenDisplay("localhost:10.0") returns a null pointer.

Is it correct that running `emacs` displays that error message and
running `xlogo` *from the same shell process* successfully displays a
window with the X logo? (Please verify before answering.) If so, then
something weird is going on. I don't know why xlogo's call to
XOpenDisplay would succeed while emacs's call would fail. If that is
what's happening, try running emacs followed by xlogo, and xlogo
followed by emacs.

I suggest setting PS1 to some unique value so you can be sure you're
running all the commands from the same shell process. (Since you're
ssh'ing from one system to another, it's conceivable that you could
return to another shell without noticing it if the prompt never
changes.)

It's odd that in your original article your $DISPLAY was
"localhost:10.0" and in later followups it's ":1". I haven't followed
all the details.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<d412d85c-b3d9-4d34-9144-a43584170f91n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4150&group=comp.unix.shell#4150

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:6709:: with SMTP id e9mr3369757qtp.149.1627549513782; Thu, 29 Jul 2021 02:05:13 -0700 (PDT)
X-Received: by 2002:a37:4042:: with SMTP id n63mr4067448qka.425.1627549513610; Thu, 29 Jul 2021 02:05:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 02:05:13 -0700 (PDT)
In-Reply-To: <87r1fhg1vk.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=211.23.211.37; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 211.23.211.37
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com> <sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com> <87o8angpmu.fsf@nosuchdomain.example.com> <a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com> <op.06717tfya3w0dxdave@hodgins.homeip.net> <b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com> <op.0676hnzna3w0dxdave@hodgins.homeip.net> <72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com> <op.0677u7bya3w0dxdave@hodgins.homeip.net> <687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com> <5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com> <874kceh5y0.fsf@nosuchdomain.example.com> <923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com> <87r1fhg1vk.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d412d85c-b3d9-4d34-9144-a43584170f91n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Thu, 29 Jul 2021 09:05:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 80
 by: hongy...@gmail.com - Thu, 29 Jul 2021 09:05 UTC

On Thursday, July 29, 2021 at 12:50:12 PM UTC+8, Keith Thompson wrote:
> "hongy...@gmail.com" <hongy...@gmail.com> writes:
> > On Wednesday, July 28, 2021 at 10:24:45 PM UTC+8, Keith Thompson wrote:
> >> "hongy...@gmail.com" <hongy...@gmail.com> writes:
> >> [...]
> >> >> Got it. To be sure, your method is right, but I happened to use an
> >> >> error value of "$DISPLAY". Here, I summarize the successful methods
> >> >> as follows:
> >> >>
> >> >> Obtain the value of `$DISPLAY' locally on the ssh server:
> >> >>
> >> >> $ echo $DISPLAY
> >> >> :1
> >> >
> >> > Or use the following method:
> >> >
> >> > $ xdpyinfo | grep -i display
> >> > name of display: :1
> >> That seems pointless. xdpyinfo gets the value to show by looking at
> >> $DISPLAY. (I had suggested running xdpyinfo just to see whether it
> >> succeeds or fails.)
> >
> > Then, where does $DISPLAY come from?
> It's an environment variable, of course. It's set by sshd (if X
> forwarding is enabled) and inherited by your shell, or it's set by
> whatever invokes your terminal emulator if you launch it on the system
> itself, or by anything else that sets it.
>
> emacs displays the message
> Display localhost:10.0 unavailable, simulating -nw
> if and only if XOpenDisplay("localhost:10.0") returns a null pointer.

Thank you for your explanation. I found the following option of sshd_config:

$ man sshd_config |egrep -A4 '^[ ]*X11DisplayOffset$'
X11DisplayOffset
Specifies the first display number available for sshd(8)'s X11 for‐
warding. This prevents sshd from interfering with real X11 servers.
The default is 10.

> Is it correct that running `emacs` displays that error message and
> running `xlogo` *from the same shell process* successfully displays a
> window with the X logo? (Please verify before answering.)

Yes.

> If so, then something weird is going on. I don't know why xlogo's call to
> XOpenDisplay would succeed while emacs's call would fail. If that is
> what's happening, try running emacs followed by xlogo, and xlogo
> followed by emacs.

Same results observed.
> I suggest setting PS1 to some unique value so you can be sure you're
> running all the commands from the same shell process. (Since you're
> ssh'ing from one system to another, it's conceivable that you could
> return to another shell without noticing it if the prompt never
> changes.)

Thank you for your suggestions. I always notice the host name part of the prompt string, which is different from each other for the test case discussed here, when I'm on different hosts.
> It's odd that in your original article your $DISPLAY was
> "localhost:10.0" and in later followups it's ":1". I haven't followed
> all the details.

If I logged in to the ssh server from the noVNC console of vitrual machine running in pve, the $DISPLAY value will be
"localhost:10.0"; if I locally check the variable's value on the ssh server, it will be ":1".

HY

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<slrnsg4sl9.c90.pjvh@xs9.xs4all.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4151&group=comp.unix.shell#4151

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost2.xs4all.net!not-for-mail
Newsgroups: comp.unix.shell
From: pjv...@xs9.xs4all.nl (Peter van Hooft)
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<87o8angpmu.fsf@nosuchdomain.example.com>
<a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com>
<op.06717tfya3w0dxdave@hodgins.homeip.net>
<b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com>
<op.0676hnzna3w0dxdave@hodgins.homeip.net>
<72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com>
<op.0677u7bya3w0dxdave@hodgins.homeip.net>
<687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com>
<5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com>
<874kceh5y0.fsf@nosuchdomain.example.com>
<923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com>
<87r1fhg1vk.fsf@nosuchdomain.example.com>
User-Agent: slrn/1.0.3 (Linux)
Message-ID: <slrnsg4sl9.c90.pjvh@xs9.xs4all.nl>
Date: 29 Jul 2021 09:19:37 GMT
Lines: 21
NNTP-Posting-Host: df339022.usenet.xs4all.nl
X-Trace: G=fjlEu76g,C=U2FsdGVkX1+mc9FPKJOjJq7L0/2noTiUP8Ztw3kA9kntuAGAwrM57Glo95qimNuMzcKoqHHVq/dK7izIGKtXkuQlFLewzI5jKwFaR63qJvNAB6s5Amwo3HjI3it2y1I0
X-Complaints-To: abuse@xs4all.nl
 by: Peter van Hooft - Thu, 29 Jul 2021 09:19 UTC

On 2021-07-29, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>
> I suggest setting PS1 to some unique value so you can be sure you're
> running all the commands from the same shell process. (Since you're
> ssh'ing from one system to another, it's conceivable that you could
> return to another shell without noticing it if the prompt never
> changes.)

*this*

>
> It's odd that in your original article your $DISPLAY was
> "localhost:10.0" and in later followups it's ":1". I haven't followed
> all the details.
>

A common pitfall is that xauth hasn't been installed on the ssh server,
so you may want to check that (which xauth).

Peter

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<sducb1$l9e$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4152&group=comp.unix.shell#4152

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: unr...@invalid.ca (William Unruh)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
Date: Thu, 29 Jul 2021 14:01:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <sducb1$l9e$1@dont-email.me>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<87o8angpmu.fsf@nosuchdomain.example.com>
<a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com>
<op.06717tfya3w0dxdave@hodgins.homeip.net>
<b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com>
<op.0676hnzna3w0dxdave@hodgins.homeip.net>
<72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com>
<op.0677u7bya3w0dxdave@hodgins.homeip.net>
<687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com>
<5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com>
<874kceh5y0.fsf@nosuchdomain.example.com>
<923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com>
<87r1fhg1vk.fsf@nosuchdomain.example.com>
<d412d85c-b3d9-4d34-9144-a43584170f91n@googlegroups.com>
Injection-Date: Thu, 29 Jul 2021 14:01:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="44bc07c8f0f2c441c105ecb34c28bfb0";
logging-data="21806"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8xJriCurIbb6XCoMZA1fe"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:AILIuzP7F3OwMVy7VUHTOdzZMWE=
 by: William Unruh - Thu, 29 Jul 2021 14:01 UTC

On 2021-07-29, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
.....
>
>> It's odd that in your original article your $DISPLAY was
>> "localhost:10.0" and in later followups it's ":1". I haven't followed
>> all the details.
>
> If I logged in to the ssh server from the noVNC console of vitrual machine running in pve, the $DISPLAY value will be
> "localhost:10.0"; if I locally check the variable's value on the ssh server, it will be ":1".

Not sure what you are saying but that sounds as it should be. The
display on the machine itself should be :1 (or whatever you logged in
as) while the display into the ssh from a remote machine should be :10.
Different X displays, different numbers. Imagine it is not a virtual
machine but is a different physical machine. One is "put the X stuff
onto the local screen" and the other one is "put the X stuff onto the
screen of the system which sshed into me"
That both screens are the actually the same physical piece of hardware is
irrelevant.
>
> HY

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<d6dffd6a-6181-4367-91e0-bebcd028f0f6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4153&group=comp.unix.shell#4153

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:6214:3001:: with SMTP id ke1mr123172qvb.52.1627606214576;
Thu, 29 Jul 2021 17:50:14 -0700 (PDT)
X-Received: by 2002:a37:411:: with SMTP id 17mr8089927qke.225.1627606214381;
Thu, 29 Jul 2021 17:50:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 17:50:14 -0700 (PDT)
In-Reply-To: <slrnsg4sl9.c90.pjvh@xs9.xs4all.nl>
Injection-Info: google-groups.googlegroups.com; posting-host=172.105.229.161; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.105.229.161
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<87o8angpmu.fsf@nosuchdomain.example.com> <a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com>
<op.06717tfya3w0dxdave@hodgins.homeip.net> <b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com>
<op.0676hnzna3w0dxdave@hodgins.homeip.net> <72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com>
<op.0677u7bya3w0dxdave@hodgins.homeip.net> <687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com>
<5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com> <874kceh5y0.fsf@nosuchdomain.example.com>
<923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com> <87r1fhg1vk.fsf@nosuchdomain.example.com>
<slrnsg4sl9.c90.pjvh@xs9.xs4all.nl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d6dffd6a-6181-4367-91e0-bebcd028f0f6n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 00:50:14 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Fri, 30 Jul 2021 00:50 UTC

On Thursday, July 29, 2021 at 5:30:06 PM UTC+8, Peter van Hooft wrote:
> On 2021-07-29, Keith Thompson <Keith.S.T...@gmail.com> wrote:
> >
> > I suggest setting PS1 to some unique value so you can be sure you're
> > running all the commands from the same shell process. (Since you're
> > ssh'ing from one system to another, it's conceivable that you could
> > return to another shell without noticing it if the prompt never
> > changes.)
> *this*

What's your meaning by saying the above word?

> >
> > It's odd that in your original article your $DISPLAY was
> > "localhost:10.0" and in later followups it's ":1". I haven't followed
> > all the details.
> >
> A common pitfall is that xauth hasn't been installed on the ssh server,
> so you may want to check that (which xauth).

Yes, see below:

werner@X10DAi:~$ which xauth
/usr/bin/xauth

HY

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4155&group=comp.unix.shell#4155

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.alpha.home.tnetconsulting.net!not-for-mail
From: gtay...@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
Date: Wed, 28 Jul 2021 17:45:08 -0600
Organization: TNet Consulting
Message-ID: <sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net>
<46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Jul 2021 23:46:54 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="alpha.home.tnetconsulting.net:198.18.18.251";
logging-data="10067"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.9.0
In-Reply-To: <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
Content-Language: en-US
 by: Grant Taylor - Wed, 28 Jul 2021 23:45 UTC

On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
> Xterm works, but Emacs still report the same problem.

I'm starting to question the "emacs" command.

Please do a "which emacs" and then "file /path/to/emacs" to see what
type of file emacs is.

I'm wondering if it's by chance a script that's artificially changing /
overriding the DISPLAY environment variable.

It might not be, but it's something simple to check and it quite likely
would keep it from working if such shenanigans were afoot.

--
Grant. . . .
unix || die

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<8045588e-9fee-4358-a119-45406ead2b36n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4156&group=comp.unix.shell#4156

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:6708:: with SMTP id e8mr200075qtp.166.1627607045884; Thu, 29 Jul 2021 18:04:05 -0700 (PDT)
X-Received: by 2002:a05:6214:29c7:: with SMTP id gh7mr8274056qvb.36.1627607045764; Thu, 29 Jul 2021 18:04:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 18:04:05 -0700 (PDT)
In-Reply-To: <sducb1$l9e$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=103.142.140.221; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 103.142.140.221
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com> <sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com> <87o8angpmu.fsf@nosuchdomain.example.com> <a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com> <op.06717tfya3w0dxdave@hodgins.homeip.net> <b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com> <op.0676hnzna3w0dxdave@hodgins.homeip.net> <72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com> <op.0677u7bya3w0dxdave@hodgins.homeip.net> <687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com> <5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com> <874kceh5y0.fsf@nosuchdomain.example.com> <923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com> <87r1fhg1vk.fsf@nosuchdomain.example.com> <d412d85c-b3d9-4d34-9144-a43584170f91n@googlegroups.com> <sducb1$l9e$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8045588e-9fee-4358-a119-45406ead2b36n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 01:04:05 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 35
 by: hongy...@gmail.com - Fri, 30 Jul 2021 01:04 UTC

On Thursday, July 29, 2021 at 10:01:11 PM UTC+8, William Unruh wrote:
> On 2021-07-29, hongy...@gmail.com <hongy...@gmail.com> wrote:
> ....
> >
> >> It's odd that in your original article your $DISPLAY was
> >> "localhost:10.0" and in later followups it's ":1". I haven't followed
> >> all the details.
> >
> > If I logged in to the ssh server from the noVNC console of vitrual machine running in pve, the $DISPLAY value will be
> > "localhost:10.0"; if I locally check the variable's value on the ssh server, it will be ":1".
> Not sure what you are saying but that sounds as it should be. The
> display on the machine itself should be :1 (or whatever you logged in
> as) while the display into the ssh from a remote machine should be :10.
> Different X displays, different numbers. Imagine it is not a virtual
> machine but is a different physical machine. One is "put the X stuff
> onto the local screen" and the other one is "put the X stuff onto the
> screen of the system which sshed into me"
> That both screens are the actually the same physical piece of hardware is
> irrelevant.

Now, I've set the following on the ssh server:

$ grep -i ^x11 /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
$ sudo systemctl restart sshd

Then I ssh on to it:
$ ssh werner@192.168.10.100
$ echo $DISPLAY

$

As you can see, the `$DISPLAY' is still empty. Why?

HY

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<871r7gfraw.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4157&group=comp.unix.shell#4157

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
Date: Thu, 29 Jul 2021 19:50:47 -0700
Organization: None to speak of
Lines: 28
Message-ID: <871r7gfraw.fsf@nosuchdomain.example.com>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net>
<46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="a2365495de71cceec5c7a6c9f6767045";
logging-data="3634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nFqAgx260I+rkFK6c4+dS"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:VznaR6p+cYrOd/R+yB4B5NHWGbQ=
sha1:NjC8yneuTuA+C6GHAH5rYrkmwiE=
 by: Keith Thompson - Fri, 30 Jul 2021 02:50 UTC

Grant Taylor <gtaylor@tnetconsulting.net> writes:
> On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
>> Xterm works, but Emacs still report the same problem.
>
> I'm starting to question the "emacs" command.
>
> Please do a "which emacs" and then "file /path/to/emacs" to see what
> type of file emacs is.

I suggest "type emacs" rather than "which emacs".

"which" is an external command, which means it doesn't know about shell
functions or aliases. "type" is a shell builtin that tells you what
typing "emacs" will actually do.

For bash, "help type" shows more information about the capabilities of
the "type" command.

> I'm wondering if it's by chance a script that's artificially changing
> / overriding the DISPLAY environment variable.
>
> It might not be, but it's something simple to check and it quite
> likely would keep it from working if such shenanigans were afoot.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<87wnp8ec7m.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4158&group=comp.unix.shell#4158

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
Date: Thu, 29 Jul 2021 20:02:05 -0700
Organization: None to speak of
Lines: 63
Message-ID: <87wnp8ec7m.fsf@nosuchdomain.example.com>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<87o8angpmu.fsf@nosuchdomain.example.com>
<a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com>
<op.06717tfya3w0dxdave@hodgins.homeip.net>
<b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com>
<op.0676hnzna3w0dxdave@hodgins.homeip.net>
<72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com>
<op.0677u7bya3w0dxdave@hodgins.homeip.net>
<687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com>
<5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com>
<874kceh5y0.fsf@nosuchdomain.example.com>
<923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com>
<87r1fhg1vk.fsf@nosuchdomain.example.com>
<d412d85c-b3d9-4d34-9144-a43584170f91n@googlegroups.com>
<sducb1$l9e$1@dont-email.me>
<8045588e-9fee-4358-a119-45406ead2b36n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="a2365495de71cceec5c7a6c9f6767045";
logging-data="3634"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/m+bv4DshurG3F5Lp7LVP0"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:GyZexa1WtHNzOYg08gHWvBrZKUQ=
sha1:QriyL/rJF/6IVYY3+7kNXgqdMF4=
 by: Keith Thompson - Fri, 30 Jul 2021 03:02 UTC

"hongy...@gmail.com" <hongyi.zhao@gmail.com> writes:
> On Thursday, July 29, 2021 at 10:01:11 PM UTC+8, William Unruh wrote:
>> On 2021-07-29, hongy...@gmail.com <hongy...@gmail.com> wrote:
>> ....
>> >
>> >> It's odd that in your original article your $DISPLAY was
>> >> "localhost:10.0" and in later followups it's ":1". I haven't followed
>> >> all the details.
>> >
>> > If I logged in to the ssh server from the noVNC console of vitrual machine running in pve, the $DISPLAY value will be
>> > "localhost:10.0"; if I locally check the variable's value on the ssh server, it will be ":1".
>> Not sure what you are saying but that sounds as it should be. The
>> display on the machine itself should be :1 (or whatever you logged in
>> as) while the display into the ssh from a remote machine should be :10.
>> Different X displays, different numbers. Imagine it is not a virtual
>> machine but is a different physical machine. One is "put the X stuff
>> onto the local screen" and the other one is "put the X stuff onto the
>> screen of the system which sshed into me"
>> That both screens are the actually the same physical piece of hardware is
>> irrelevant.
>
> Now, I've set the following on the ssh server:
>
> $ grep -i ^x11 /etc/ssh/sshd_config
> X11Forwarding yes
> X11DisplayOffset 10
> $ sudo systemctl restart sshd
>
> Then I ssh on to it:
> $ ssh werner@192.168.10.100
> $ echo $DISPLAY

We can't tell whether the ssh command silently failed and left you in
the same shell, or whether it was successful and the echo command was
run on the target system. The former is unlikely, but this is why I
requested that you set the prompt to some unique value that shows where
you are. I suggest:

PS1="\u@\h pid=$$ \!\$ "

> $
>
> As you can see, the `$DISPLAY' is still empty. Why?

What is $DISPLAY on the initial system, before you run ssh?

What happens when you replace "ssh" by "ssh -X" or "ssh -Y"?

X11 forwarding has to be enabled by both the client and the server.

Is $DISPLAY unset or empty? The behavior should be similar either way,
but it could be helpful to know. Consider `set -o nounset`, at least
temporarily, so you get an error message referring to an unset variable.

$DISPLAY being either empty or unset is inconsistent with the symptom
you reported originally, emacs complaining about "localhost:10.0".
It's not at all clear what significance the information you're giving us
now has to your original problem.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<08024bf2-12d9-464f-8ad0-1272e9fc423cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4159&group=comp.unix.shell#4159

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:75d4:: with SMTP id z20mr594138qtq.360.1627616711049;
Thu, 29 Jul 2021 20:45:11 -0700 (PDT)
X-Received: by 2002:a0c:c3d1:: with SMTP id p17mr456936qvi.44.1627616710885;
Thu, 29 Jul 2021 20:45:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 20:45:10 -0700 (PDT)
In-Reply-To: <sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
Injection-Info: google-groups.googlegroups.com; posting-host=211.23.211.39; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 211.23.211.39
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net> <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <08024bf2-12d9-464f-8ad0-1272e9fc423cn@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 03:45:11 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Fri, 30 Jul 2021 03:45 UTC

On Friday, July 30, 2021 at 9:00:59 AM UTC+8, Grant Taylor wrote:
> On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
> > Xterm works, but Emacs still report the same problem.
> I'm starting to question the "emacs" command.
>
> Please do a "which emacs" and then "file /path/to/emacs" to see what
> type of file emacs is.
>
> I'm wondering if it's by chance a script that's artificially changing /
> overriding the DISPLAY environment variable.

I use a self-written wrapper script to start Emacs, but I really haven't overridden the DISPLAY environment variable in the script. See the following for more detailed info:

$ which emacs
/home/werner/.local/bin/emacs

$ which emacs |xargs egrep '^[^#]'| grep -v '^[ ]*#'
script_name_sh=$HOME/.local/libexec/script_name.sh
source $script_name_sh ${BASH_SOURCE[0]}
EMACS=/usr/local/bin/emacs
if [ -e $EMACS ]; then
proxychains-ng-socks5 $EMACS "$@"
fi

HY
> It might not be, but it's something simple to check and it quite likely
> would keep it from working if such shenanigans were afoot.
> --
> Grant. . . .
> unix || die

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4160&group=comp.unix.shell#4160

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:620a:2446:: with SMTP id h6mr340526qkn.497.1627616981154;
Thu, 29 Jul 2021 20:49:41 -0700 (PDT)
X-Received: by 2002:a37:aca:: with SMTP id 193mr343943qkk.353.1627616981016;
Thu, 29 Jul 2021 20:49:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 20:49:40 -0700 (PDT)
In-Reply-To: <871r7gfraw.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=172.104.76.156; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.104.76.156
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net> <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net> <871r7gfraw.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 03:49:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3269
 by: hongy...@gmail.com - Fri, 30 Jul 2021 03:49 UTC

On Friday, July 30, 2021 at 10:50:56 AM UTC+8, Keith Thompson wrote:
> Grant Taylor <gta...@tnetconsulting.net> writes:
> > On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
> >> Xterm works, but Emacs still report the same problem.
> >
> > I'm starting to question the "emacs" command.
> >
> > Please do a "which emacs" and then "file /path/to/emacs" to see what
> > type of file emacs is.
> I suggest "type emacs" rather than "which emacs".

$ type emacs
emacs is hashed (/home/werner/.local/bin/emacs)

$ type -a emacs
emacs is /home/werner/.local/bin/emacs
emacs is /usr/local/bin/emacs
emacs is /usr/bin/emacs
emacs is /bin/emacs

So, the first entry will be picked by shell, and see the following for more detailed info about the corresponding script:

$ egrep '^[^#]' /home/werner/.local/bin/emacs | grep -v '^[ ]*#'
script_name_sh=$HOME/.local/libexec/script_name.sh
source $script_name_sh ${BASH_SOURCE[0]}
EMACS=/usr/local/bin/emacs
if [ -e $EMACS ]; then
proxychains-ng-socks5 $EMACS "$@"
fi


> "which" is an external command, which means it doesn't know about shell
> functions or aliases. "type" is a shell builtin that tells you what
> typing "emacs" will actually do.
>
> For bash, "help type" shows more information about the capabilities of
> the "type" command.
> > I'm wondering if it's by chance a script that's artificially changing
> > / overriding the DISPLAY environment variable.
> >
> > It might not be, but it's something simple to check and it quite
> > likely would keep it from working if such shenanigans were afoot.
>
> --
> Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
> Working, but not speaking, for Philips
> void Void(void) { Void(); } /* The recursive call of the void */

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<sdvtv3$jbd$1@tncsrv09.home.tnetconsulting.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4161&group=comp.unix.shell#4161

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.alpha.home.tnetconsulting.net!not-for-mail
From: gtay...@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
Date: Thu, 29 Jul 2021 22:06:15 -0600
Organization: TNet Consulting
Message-ID: <sdvtv3$jbd$1@tncsrv09.home.tnetconsulting.net>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net>
<46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
<871r7gfraw.fsf@nosuchdomain.example.com>
<4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 30 Jul 2021 04:08:03 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="alpha.home.tnetconsulting.net:198.18.18.251";
logging-data="19821"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.9.0
In-Reply-To: <4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com>
Content-Language: en-US
 by: Grant Taylor - Fri, 30 Jul 2021 04:06 UTC

On 7/29/21 9:49 PM, hongy...@gmail.com wrote:
> proxychains-ng-socks5 $EMACS "$@"

Why are you running emacs via proxychains?

That's almost definitely going to mess with it's ability to connect to
an X11 server, wherever it is, unless said proxy can communicate with
said X11 server.

Try running /usr/local/bin/emacs and seeing if that works.

--
Grant. . . .
unix || die

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<sdvu1g$jbd$2@tncsrv09.home.tnetconsulting.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4162&group=comp.unix.shell#4162

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.alpha.home.tnetconsulting.net!not-for-mail
From: gtay...@tnetconsulting.net (Grant Taylor)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
Date: Thu, 29 Jul 2021 22:07:32 -0600
Organization: TNet Consulting
Message-ID: <sdvu1g$jbd$2@tncsrv09.home.tnetconsulting.net>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net>
<46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
<08024bf2-12d9-464f-8ad0-1272e9fc423cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 30 Jul 2021 04:09:20 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="alpha.home.tnetconsulting.net:198.18.18.251";
logging-data="19821"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.9.0
In-Reply-To: <08024bf2-12d9-464f-8ad0-1272e9fc423cn@googlegroups.com>
Content-Language: en-US
 by: Grant Taylor - Fri, 30 Jul 2021 04:07 UTC

On 7/29/21 9:45 PM, hongy...@gmail.com wrote:
> I use a self-written wrapper script to start Emacs, but I really
> haven't overridden the DISPLAY environment variable in the script. See
> the following for more detailed info:

No, you're not altering the DISPLAY environment variable. But you are
quite likely intercepting any and all network connection attempts and
routing them through the configured proxy, including attempts to connect
to the value of $DISPLAY.

--
Grant. . . .
unix || die

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<QRJS69uy01KC2Gdgu@bongo-ra.co>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4163&group=comp.unix.shell#4163

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!aioe.org!OC6U9UkZn9R/lnxSpxG5YA.user.46.165.242.91.POSTED!not-for-mail
From: spi...@gmail.com (Spiros Bousbouras)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
Date: Fri, 30 Jul 2021 04:15:27 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <QRJS69uy01KC2Gdgu@bongo-ra.co>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com> <sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<87o8angpmu.fsf@nosuchdomain.example.com> <a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com> <op.06717tfya3w0dxdave@hodgins.homeip.net>
<b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com> <op.0676hnzna3w0dxdave@hodgins.homeip.net> <72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com>
<op.0677u7bya3w0dxdave@hodgins.homeip.net> <687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com> <5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com>
<874kceh5y0.fsf@nosuchdomain.example.com> <923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com> <87r1fhg1vk.fsf@nosuchdomain.example.com>
<slrnsg4sl9.c90.pjvh@xs9.xs4all.nl> <d6dffd6a-6181-4367-91e0-bebcd028f0f6n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="62647"; posting-host="OC6U9UkZn9R/lnxSpxG5YA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Server-Commands: nowebcancel
X-Organisation: Weyland-Yutani
 by: Spiros Bousbouras - Fri, 30 Jul 2021 04:15 UTC

On Thu, 29 Jul 2021 17:50:14 -0700 (PDT)
"hongy...@gmail.com" <hongyi.zhao@gmail.com> wrote:
> On Thursday, July 29, 2021 at 5:30:06 PM UTC+8, Peter van Hooft wrote:
> > On 2021-07-29, Keith Thompson <Keith.S.T...@gmail.com> wrote:
> > >
> > > I suggest setting PS1 to some unique value so you can be sure you're
> > > running all the commands from the same shell process. (Since you're
> > > ssh'ing from one system to another, it's conceivable that you could
> > > return to another shell without noticing it if the prompt never
> > > changes.)
> > *this*
>
> What's your meaning by saying the above word?

It means he emphatically agrees with Keith Thompson.

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<50f7baf1-05dd-4455-9068-fe207cd0102en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4164&group=comp.unix.shell#4164

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:6214:27e7:: with SMTP id jt7mr811541qvb.28.1627618637070; Thu, 29 Jul 2021 21:17:17 -0700 (PDT)
X-Received: by 2002:ac8:44da:: with SMTP id b26mr663049qto.81.1627618636876; Thu, 29 Jul 2021 21:17:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 21:17:16 -0700 (PDT)
In-Reply-To: <87wnp8ec7m.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=103.138.53.113; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 103.138.53.113
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com> <sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com> <87o8angpmu.fsf@nosuchdomain.example.com> <a0f718fc-988c-4b80-81ec-eda66a0b91e9n@googlegroups.com> <op.06717tfya3w0dxdave@hodgins.homeip.net> <b5052939-b63c-4b4c-adb1-e6fa9fae6885n@googlegroups.com> <op.0676hnzna3w0dxdave@hodgins.homeip.net> <72fa5f22-3a1d-43eb-9510-97fa8b477a2en@googlegroups.com> <op.0677u7bya3w0dxdave@hodgins.homeip.net> <687c564c-51f6-4648-b0e5-3d8cb165a7c7n@googlegroups.com> <5ce30e75-776c-48b6-9ff0-496b2728fbe2n@googlegroups.com> <874kceh5y0.fsf@nosuchdomain.example.com> <923b93f9-2eae-4249-8411-133ad0898874n@googlegroups.com> <87r1fhg1vk.fsf@nosuchdomain.example.com> <d412d85c-b3d9-4d34-9144-a43584170f91n@googlegroups.com> <sducb1$l9e$1@dont-email.me> <8045588e-9fee-4358-a119-45406ead2b36n@googlegroups.com> <87wnp8ec7m.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <50f7baf1-05dd-4455-9068-fe207cd0102en@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 04:17:17 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 84
 by: hongy...@gmail.com - Fri, 30 Jul 2021 04:17 UTC

On Friday, July 30, 2021 at 11:02:10 AM UTC+8, Keith Thompson wrote:
> "hongy...@gmail.com" <hongy...@gmail.com> writes:
> > On Thursday, July 29, 2021 at 10:01:11 PM UTC+8, William Unruh wrote:
> >> On 2021-07-29, hongy...@gmail.com <hongy...@gmail.com> wrote:
> >> ....
> >> >
> >> >> It's odd that in your original article your $DISPLAY was
> >> >> "localhost:10.0" and in later followups it's ":1". I haven't followed
> >> >> all the details.
> >> >
> >> > If I logged in to the ssh server from the noVNC console of vitrual machine running in pve, the $DISPLAY value will be
> >> > "localhost:10.0"; if I locally check the variable's value on the ssh server, it will be ":1".
> >> Not sure what you are saying but that sounds as it should be. The
> >> display on the machine itself should be :1 (or whatever you logged in
> >> as) while the display into the ssh from a remote machine should be :10.
> >> Different X displays, different numbers. Imagine it is not a virtual
> >> machine but is a different physical machine. One is "put the X stuff
> >> onto the local screen" and the other one is "put the X stuff onto the
> >> screen of the system which sshed into me"
> >> That both screens are the actually the same physical piece of hardware is
> >> irrelevant.
> >
> > Now, I've set the following on the ssh server:
> >
> > $ grep -i ^x11 /etc/ssh/sshd_config
> > X11Forwarding yes
> > X11DisplayOffset 10
> > $ sudo systemctl restart sshd
> >
> > Then I ssh on to it:
> > $ ssh wer...@192.168.10.100
> > $ echo $DISPLAY
> We can't tell whether the ssh command silently failed and left you in
> the same shell, or whether it was successful and the echo command was
> run on the target system. The former is unlikely, but this is why I
> requested that you set the prompt to some unique value that shows where
> you are. I suggest:
>
> PS1="\u@\h pid=$$ \!\$ "

Now, on the ssh server, I append the following lines at the bottom of my ~/.bashrc file:

set -o nounset
export PS1="\u@\h pid=$$ \!\$ "

> > $
> >
> > As you can see, the `$DISPLAY' is still empty. Why?
> What is $DISPLAY on the initial system, before you run ssh?

werner@X10DAi pid=1948000 501$ echo $DISPLAY
:1


> What happens when you replace "ssh" by "ssh -X" or "ssh -Y"?

If I don't log in to the ssh server from the pve noVNC console:

$ ssh -X werner@192.168.10.100
werner@X10DAi pid=2452674 501$ echo $DISPLAY

werner@X10DAi pid=2452674 495$

> X11 forwarding has to be enabled by both the client and the server.
>
> Is $DISPLAY unset or empty? The behavior should be similar either way,
> but it could be helpful to know. Consider `set -o nounset`, at least
> temporarily, so you get an error message referring to an unset variable.
>
> $DISPLAY being either empty or unset is inconsistent with the symptom
> you reported originally, emacs complaining about "localhost:10.0".

If I log in to the ssh server from the pve noVNC console:

$ ssh -X werner@192.168.10.100
werner@X10DAi pid=1622407 501$ echo $DISPLAY
localhost:10.0
werner@X10DAi pid=1622407 496$

> It's not at all clear what significance the information you're giving us
> now has to your original problem.
> --
> Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
> Working, but not speaking, for Philips
> void Void(void) { Void(); } /* The recursive call of the void */

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<dcfb1b2b-6f38-4cd6-9541-7282ce4d7c99n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4165&group=comp.unix.shell#4165

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:6214:1c4d:: with SMTP id if13mr564144qvb.56.1627619093316;
Thu, 29 Jul 2021 21:24:53 -0700 (PDT)
X-Received: by 2002:a05:622a:54e:: with SMTP id m14mr721346qtx.74.1627619093182;
Thu, 29 Jul 2021 21:24:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 21:24:53 -0700 (PDT)
In-Reply-To: <sdvu1g$jbd$2@tncsrv09.home.tnetconsulting.net>
Injection-Info: google-groups.googlegroups.com; posting-host=103.138.53.127; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 103.138.53.127
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net> <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net> <08024bf2-12d9-464f-8ad0-1272e9fc423cn@googlegroups.com>
<sdvu1g$jbd$2@tncsrv09.home.tnetconsulting.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dcfb1b2b-6f38-4cd6-9541-7282ce4d7c99n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 04:24:53 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Fri, 30 Jul 2021 04:24 UTC

On Friday, July 30, 2021 at 12:07:25 PM UTC+8, Grant Taylor wrote:
> On 7/29/21 9:45 PM, hongy...@gmail.com wrote:
> > I use a self-written wrapper script to start Emacs, but I really
> > haven't overridden the DISPLAY environment variable in the script. See
> > the following for more detailed info:
> No, you're not altering the DISPLAY environment variable. But you are
> quite likely intercepting any and all network connection attempts and
> routing them through the configured proxy, including attempts to connect
> to the value of $DISPLAY.

Wonderful analysis, I confirmed the above assertion, as described below:

After I logged in to the ssh server, if the `xlogo' can run correctly, the `/usr/local/bin/emacs', i.e., without using the wrapper script, hence bypassing the proxychains proxy set there, will work with X smoothly.

HY

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<0tuIW6iE01hoBbkF5@bongo-ra.co>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4166&group=comp.unix.shell#4166

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!aioe.org!OC6U9UkZn9R/lnxSpxG5YA.user.46.165.242.91.POSTED!not-for-mail
From: spi...@gmail.com (Spiros Bousbouras)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
Date: Fri, 30 Jul 2021 04:25:26 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <0tuIW6iE01hoBbkF5@bongo-ra.co>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com> <sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net> <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com> <sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
<871r7gfraw.fsf@nosuchdomain.example.com> <4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="3125"; posting-host="OC6U9UkZn9R/lnxSpxG5YA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
 by: Spiros Bousbouras - Fri, 30 Jul 2021 04:25 UTC

On Thu, 29 Jul 2021 20:49:40 -0700 (PDT)
"hongy...@gmail.com" <hongyi.zhao@gmail.com> wrote:
> On Friday, July 30, 2021 at 10:50:56 AM UTC+8, Keith Thompson wrote:
> > Grant Taylor <gta...@tnetconsulting.net> writes:
> > > On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
> > >> Xterm works, but Emacs still report the same problem.
> > >
> > > I'm starting to question the "emacs" command.
> > >
> > > Please do a "which emacs" and then "file /path/to/emacs" to see what
> > > type of file emacs is.
> > I suggest "type emacs" rather than "which emacs".
>
> $ type emacs
> emacs is hashed (/home/werner/.local/bin/emacs)
>
> $ type -a emacs
> emacs is /home/werner/.local/bin/emacs
> emacs is /usr/local/bin/emacs
> emacs is /usr/bin/emacs
> emacs is /bin/emacs
>
> So, the first entry will be picked by shell, and see the following for more detailed info about the corresponding script:
>
> $ egrep '^[^#]' /home/werner/.local/bin/emacs | grep -v '^[ ]*#'
> script_name_sh=$HOME/.local/libexec/script_name.sh
> source $script_name_sh ${BASH_SOURCE[0]}
>
> EMACS=/usr/local/bin/emacs
> if [ -e $EMACS ]; then
> proxychains-ng-socks5 $EMACS "$@"
> fi

Unless the comments in the script have some private information you don't want
the world to see or are very long , it would have been better to also show
the comments because they might give some valuable clue. In any case , instead
of
egrep '^[^#]' /home/werner/.local/bin/emacs | grep -v '^[ ]*#'

using
grep -v '^ *#' /home/werner/.local/bin/emacs

does the same job.

Perhaps $HOME/.local/libexec/script_name.sh does something with the DISPLAY
variable. I suggest modifying your script as follows

echo "Point A : the value of DISPLAY is =$DISPLAY="
script_name_sh=$HOME/.local/libexec/script_name.sh
source $script_name_sh ${BASH_SOURCE[0]}
echo "Point B : the value of DISPLAY is =$DISPLAY="
[ ... Rest the same ...]

I also second the advice to try running emacs directly.

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<87pmv0e7o2.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4167&group=comp.unix.shell#4167

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
Date: Thu, 29 Jul 2021 21:40:13 -0700
Organization: None to speak of
Lines: 45
Message-ID: <87pmv0e7o2.fsf@nosuchdomain.example.com>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net>
<46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
<08024bf2-12d9-464f-8ad0-1272e9fc423cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="a2365495de71cceec5c7a6c9f6767045";
logging-data="25591"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8oXp8YawKw+4v2SWZ/01g"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:M8D4Jbwf4xTXjNlkZGGq8UJb6x4=
sha1:uZBFcZJMNqlopQ48//pf/SJcXtw=
 by: Keith Thompson - Fri, 30 Jul 2021 04:40 UTC

"hongy...@gmail.com" <hongyi.zhao@gmail.com> writes:
> On Friday, July 30, 2021 at 9:00:59 AM UTC+8, Grant Taylor wrote:
>> On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
>> > Xterm works, but Emacs still report the same problem.
>> I'm starting to question the "emacs" command.
>>
>> Please do a "which emacs" and then "file /path/to/emacs" to see what
>> type of file emacs is.
>>
>> I'm wondering if it's by chance a script that's artificially changing /
>> overriding the DISPLAY environment variable.
>
> I use a self-written wrapper script to start Emacs, but I really
> haven't overridden the DISPLAY environment variable in the script. See
> the following for more detailed info:

Then the obvious next step is to try the same thing, but running
/usr/bin/emacs directly rather than your wrapper script.

> $ which emacs
> /home/werner/.local/bin/emacs
>
> $ which emacs |xargs egrep '^[^#]'| grep -v '^[ ]*#'
> script_name_sh=$HOME/.local/libexec/script_name.sh
> source $script_name_sh ${BASH_SOURCE[0]}
>
> EMACS=/usr/local/bin/emacs
> if [ -e $EMACS ]; then
> proxychains-ng-socks5 $EMACS "$@"
> fi

Frankly, it should already have occurred to you to try invoking
the emacs executable directly. It's an added layer, and you need
to strip away any such layers while trying to figure out what's causing
the problem. Do the simplest set of steps that reproduces the problem.

Even more obvious than bypassing your wrapper script: Telling us that
you're using one. You should have mentioned that in your original post.
Don't withhold information like that, and don't make us drag it out of
you.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<32304c0c-f87b-42e9-83c4-02b64e0c4858n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4168&group=comp.unix.shell#4168

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:57c8:: with SMTP id w8mr718948qta.153.1627620049340;
Thu, 29 Jul 2021 21:40:49 -0700 (PDT)
X-Received: by 2002:ac8:5a8d:: with SMTP id c13mr750236qtc.100.1627620049208;
Thu, 29 Jul 2021 21:40:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 21:40:49 -0700 (PDT)
In-Reply-To: <0tuIW6iE01hoBbkF5@bongo-ra.co>
Injection-Info: google-groups.googlegroups.com; posting-host=8.210.99.126; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 8.210.99.126
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net> <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net> <871r7gfraw.fsf@nosuchdomain.example.com>
<4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com> <0tuIW6iE01hoBbkF5@bongo-ra.co>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <32304c0c-f87b-42e9-83c4-02b64e0c4858n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 04:40:49 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Fri, 30 Jul 2021 04:40 UTC

On Friday, July 30, 2021 at 12:25:34 PM UTC+8, Spiros Bousbouras wrote:
> On Thu, 29 Jul 2021 20:49:40 -0700 (PDT)
> "hongy...@gmail.com" <hongy...@gmail.com> wrote:
> > On Friday, July 30, 2021 at 10:50:56 AM UTC+8, Keith Thompson wrote:
> > > Grant Taylor <gta...@tnetconsulting.net> writes:
> > > > On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
> > > >> Xterm works, but Emacs still report the same problem.
> > > >
> > > > I'm starting to question the "emacs" command.
> > > >
> > > > Please do a "which emacs" and then "file /path/to/emacs" to see what
> > > > type of file emacs is.
> > > I suggest "type emacs" rather than "which emacs".
> >
> > $ type emacs
> > emacs is hashed (/home/werner/.local/bin/emacs)
> >
> > $ type -a emacs
> > emacs is /home/werner/.local/bin/emacs
> > emacs is /usr/local/bin/emacs
> > emacs is /usr/bin/emacs
> > emacs is /bin/emacs
> >
> > So, the first entry will be picked by shell, and see the following for more detailed info about the corresponding script:
> >
> > $ egrep '^[^#]' /home/werner/.local/bin/emacs | grep -v '^[ ]*#'
> > script_name_sh=$HOME/.local/libexec/script_name.sh
> > source $script_name_sh ${BASH_SOURCE[0]}
> >
> > EMACS=/usr/local/bin/emacs
> > if [ -e $EMACS ]; then
> > proxychains-ng-socks5 $EMACS "$@"
> > fi
> Unless the comments in the script have some private information you don't want
> the world to see or are very long , it would have been better to also show
> the comments because they might give some valuable clue. In any case , instead
> of
> egrep '^[^#]' /home/werner/.local/bin/emacs | grep -v '^[ ]*#'
> using
> grep -v '^ *#' /home/werner/.local/bin/emacs

No difference, but thank you for the more concise grep command:
$ grep -v '^ *#' /home/werner/.local/bin/emacs
script_name_sh=$HOME/.local/libexec/script_name.sh
source $script_name_sh ${BASH_SOURCE[0]}
EMACS=/usr/local/bin/emacs
if [ -e $EMACS ]; then
proxychains-ng-socks5 $EMACS "$@"
fi

$

> does the same job.
>
> Perhaps $HOME/.local/libexec/script_name.sh does something with the DISPLAY
> variable. I suggest modifying your script as follows
>
> echo "Point A : the value of DISPLAY is =$DISPLAY="
> script_name_sh=$HOME/.local/libexec/script_name.sh
> source $script_name_sh ${BASH_SOURCE[0]}
> echo "Point B : the value of DISPLAY is =$DISPLAY="
> [ ... Rest the same ...]

werner@X10DAi pid=2452674 483$ emacs
Point A : the value of DISPLAY is ==
Point B : the value of DISPLAY is ==
[...]


> I also second the advice to try running emacs directly.

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<87lf5oe7ld.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4169&group=comp.unix.shell#4169

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
Date: Thu, 29 Jul 2021 21:41:50 -0700
Organization: None to speak of
Lines: 22
Message-ID: <87lf5oe7ld.fsf@nosuchdomain.example.com>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net>
<46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
<871r7gfraw.fsf@nosuchdomain.example.com>
<4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com>
<sdvtv3$jbd$1@tncsrv09.home.tnetconsulting.net>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="a2365495de71cceec5c7a6c9f6767045";
logging-data="25591"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Qpmzwk8fJedprQpO7iHGt"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:9nbuiZvWMbgV1VmEdXVNOoCxgzQ=
sha1:gUfSYA1nGNqRD2ydcpZenhXBUuA=
 by: Keith Thompson - Fri, 30 Jul 2021 04:41 UTC

Grant Taylor <gtaylor@tnetconsulting.net> writes:
> On 7/29/21 9:49 PM, hongy...@gmail.com wrote:
>> proxychains-ng-socks5 $EMACS "$@"
>
> Why are you running emacs via proxychains?
>
> That's almost definitely going to mess with it's ability to connect to
> an X11 server, wherever it is, unless said proxy can communicate with
> said X11 server.
>
> Try running /usr/local/bin/emacs and seeing if that works.

That's assuming that /usr/local/bin/emacs is an executable.

You have /usr/bin/emacs, /bin/emacs, and /usr/local/bin/emacs in your
path. I'm guessing /usr/bin/emacs and /bin/emacs are the same -- but
check that. Try all three.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<9c72c829-95f1-423f-b2d2-316cb19c64f3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4170&group=comp.unix.shell#4170

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:620a:1087:: with SMTP id g7mr551417qkk.436.1627620552247;
Thu, 29 Jul 2021 21:49:12 -0700 (PDT)
X-Received: by 2002:ac8:7c54:: with SMTP id o20mr766051qtv.142.1627620552117;
Thu, 29 Jul 2021 21:49:12 -0700 (PDT)
Path: i2pn2.org!rocksolid2!news.neodome.net!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 21:49:11 -0700 (PDT)
In-Reply-To: <87lf5oe7ld.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=172.104.76.156; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 172.104.76.156
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net> <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net> <871r7gfraw.fsf@nosuchdomain.example.com>
<4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com> <sdvtv3$jbd$1@tncsrv09.home.tnetconsulting.net>
<87lf5oe7ld.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9c72c829-95f1-423f-b2d2-316cb19c64f3n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 04:49:12 +0000
Content-Type: text/plain; charset="UTF-8"
 by: hongy...@gmail.com - Fri, 30 Jul 2021 04:49 UTC

On Friday, July 30, 2021 at 12:41:55 PM UTC+8, Keith Thompson wrote:
> Grant Taylor <gta...@tnetconsulting.net> writes:
> > On 7/29/21 9:49 PM, hongy...@gmail.com wrote:
> >> proxychains-ng-socks5 $EMACS "$@"
> >
> > Why are you running emacs via proxychains?
> >
> > That's almost definitely going to mess with it's ability to connect to
> > an X11 server, wherever it is, unless said proxy can communicate with
> > said X11 server.
> >
> > Try running /usr/local/bin/emacs and seeing if that works.
> That's assuming that /usr/local/bin/emacs is an executable.

This is the self-compiled git master version.
> You have /usr/bin/emacs, /bin/emacs, and /usr/local/bin/emacs in your
> path. I'm guessing /usr/bin/emacs and /bin/emacs are the same -- but
> check that. Try all three.

These are the system versions, they are equivalent:

$ realpath -e /usr/bin/emacs
/usr/bin/emacs-nox

$ realpath -e /bin/emacs
/usr/bin/emacs-nox

HY

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<67ce2d07-9ace-44b8-b3eb-006b8daf7fb7n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4171&group=comp.unix.shell#4171

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:622a:30d:: with SMTP id q13mr732673qtw.147.1627620776356;
Thu, 29 Jul 2021 21:52:56 -0700 (PDT)
X-Received: by 2002:a05:620a:22a5:: with SMTP id p5mr526722qkh.251.1627620776223;
Thu, 29 Jul 2021 21:52:56 -0700 (PDT)
Path: i2pn2.org!rocksolid2!news.neodome.net!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 21:52:56 -0700 (PDT)
In-Reply-To: <87pmv0e7o2.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=103.138.53.96; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 103.138.53.96
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net> <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net> <08024bf2-12d9-464f-8ad0-1272e9fc423cn@googlegroups.com>
<87pmv0e7o2.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <67ce2d07-9ace-44b8-b3eb-006b8daf7fb7n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 04:52:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: hongy...@gmail.com - Fri, 30 Jul 2021 04:52 UTC

On Friday, July 30, 2021 at 12:40:18 PM UTC+8, Keith Thompson wrote:
> "hongy...@gmail.com" <hongy...@gmail.com> writes:
> > On Friday, July 30, 2021 at 9:00:59 AM UTC+8, Grant Taylor wrote:
> >> On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
> >> > Xterm works, but Emacs still report the same problem.
> >> I'm starting to question the "emacs" command.
> >>
> >> Please do a "which emacs" and then "file /path/to/emacs" to see what
> >> type of file emacs is.
> >>
> >> I'm wondering if it's by chance a script that's artificially changing /
> >> overriding the DISPLAY environment variable.
> >
> > I use a self-written wrapper script to start Emacs, but I really
> > haven't overridden the DISPLAY environment variable in the script. See
> > the following for more detailed info:
> Then the obvious next step is to try the same thing, but running
> /usr/bin/emacs directly rather than your wrapper script.
> > $ which emacs
> > /home/werner/.local/bin/emacs
> >
> > $ which emacs |xargs egrep '^[^#]'| grep -v '^[ ]*#'
> > script_name_sh=$HOME/.local/libexec/script_name.sh
> > source $script_name_sh ${BASH_SOURCE[0]}
> >
> > EMACS=/usr/local/bin/emacs
> > if [ -e $EMACS ]; then
> > proxychains-ng-socks5 $EMACS "$@"
> > fi
> Frankly, it should already have occurred to you to try invoking
> the emacs executable directly. It's an added layer, and you need
> to strip away any such layers while trying to figure out what's causing
> the problem. Do the simplest set of steps that reproduces the problem.
>
> Even more obvious than bypassing your wrapper script: Telling us that
> you're using one. You should have mentioned that in your original post.

I didn’t realize this until I got the relevant tips here.

> Don't withhold information like that, and don't make us drag it out of
> you.

TBF, I really omit the fact the X11 communication is also effected by the proxy settings by proxychains.

HY

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<819113dc-3e74-42d7-bbaa-268f087d4902n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4172&group=comp.unix.shell#4172

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:6214:21ee:: with SMTP id p14mr708553qvj.8.1627621384341;
Thu, 29 Jul 2021 22:03:04 -0700 (PDT)
X-Received: by 2002:ac8:698f:: with SMTP id o15mr755934qtq.365.1627621384203;
Thu, 29 Jul 2021 22:03:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 29 Jul 2021 22:03:04 -0700 (PDT)
In-Reply-To: <sdvtv3$jbd$1@tncsrv09.home.tnetconsulting.net>
Injection-Info: google-groups.googlegroups.com; posting-host=8.210.99.126; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 8.210.99.126
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net> <be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net> <46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net> <871r7gfraw.fsf@nosuchdomain.example.com>
<4b93f46b-8d85-4919-bc65-674ec857efb7n@googlegroups.com> <sdvtv3$jbd$1@tncsrv09.home.tnetconsulting.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <819113dc-3e74-42d7-bbaa-268f087d4902n@googlegroups.com>
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Fri, 30 Jul 2021 05:03:04 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: hongy...@gmail.com - Fri, 30 Jul 2021 05:03 UTC

On Friday, July 30, 2021 at 12:06:09 PM UTC+8, Grant Taylor wrote:
> On 7/29/21 9:49 PM, hongy...@gmail.com wrote:
> > proxychains-ng-socks5 $EMACS "$@"
>
> Why are you running emacs via proxychains?
As far as this problem is concerned, I am in a dilemma: Emacs itself don't support socks5 very well, and I want to install packages from melpa and github repos, which will need socks5 proxy for working smoothly at my location.
> That's almost definitely going to mess with it's ability to connect to
> an X11 server, wherever it is, unless said proxy can communicate with
> said X11 server.

I really have taken it for granted that X11 protocol should work seamlessly with TCP/IP stack and all standard proxy protocols built on it.
> Try running /usr/local/bin/emacs and seeing if that works.

This works, as I've tested later in another thread of this issue.

HY

Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.

<se01jn$946$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4173&group=comp.unix.shell#4173

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: unr...@invalid.ca (William Unruh)
Newsgroups: comp.unix.shell
Subject: Re: Failed to run Emacs in X windows mode on remote host over ssh
with X11 forwarding enabled.
Date: Fri, 30 Jul 2021 05:10:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <se01jn$946$1@dont-email.me>
References: <b3b337bf-afba-4e59-9a86-f1c4fae3603fn@googlegroups.com>
<sdpjlv$abd$1@tncsrv09.home.tnetconsulting.net>
<be2c5dbb-e72e-4e77-961a-783e289d128dn@googlegroups.com>
<sdqcmq$n8d$1@tncsrv09.home.tnetconsulting.net>
<46659bf7-0cdc-4e0d-8879-5892653be3efn@googlegroups.com>
<sdsq9e$9qj$1@tncsrv09.home.tnetconsulting.net>
<08024bf2-12d9-464f-8ad0-1272e9fc423cn@googlegroups.com>
Injection-Date: Fri, 30 Jul 2021 05:10:16 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5a5402c12e9d55298cf5496b904db2e8";
logging-data="9350"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Ny7nMg0vRbI4BkIrr16XW"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:EVAbiYVgZ8DfXbBqAWbBjz9cy2U=
 by: William Unruh - Fri, 30 Jul 2021 05:10 UTC

On 2021-07-30, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
> On Friday, July 30, 2021 at 9:00:59 AM UTC+8, Grant Taylor wrote:
>> On 7/27/21 8:07 PM, hongy...@gmail.com wrote:
>> > Xterm works, but Emacs still report the same problem.
>> I'm starting to question the "emacs" command.
>>
>> Please do a "which emacs" and then "file /path/to/emacs" to see what
>> type of file emacs is.
>>
>> I'm wondering if it's by chance a script that's artificially changing /
>> overriding the DISPLAY environment variable.
>

Why the *&^&(* don't you just run
/bin/emacs
and see if that works. Or are you afraid that it will work and you will
not have anything to complian about?

> I use a self-written wrapper script to start Emacs, but I really haven't overridden the DISPLAY environment variable in the script. See the following for more detailed info:

So find out whether you self written script is a piece of junk and run
/bin/emacs directly to see what happens.

>
> $ which emacs
> /home/werner/.local/bin/emacs
>
> $ which emacs |xargs egrep '^[^#]'| grep -v '^[ ]*#'
> script_name_sh=$HOME/.local/libexec/script_name.sh
> source $script_name_sh ${BASH_SOURCE[0]}
>
> EMACS=/usr/local/bin/emacs
> if [ -e $EMACS ]; then
> proxychains-ng-socks5 $EMACS "$@"
> fi
>
> HY
>> It might not be, but it's something simple to check and it quite likely
>> would keep it from working if such shenanigans were afoot.
>> --
>> Grant. . . .
>> unix || die

Pages:123
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor