* Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
@ 2021-07-27 13:29 Hongyi Zhao
2021-07-27 14:17 ` Skip Montanaro
0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2021-07-27 13:29 UTC (permalink / raw)
To: help-gnu-emacs
On LAN, I'm trying to run Emacs on another machine, as shown below:
$ ssh -X werner@192.168.10.100
$ emacs
At this moment, I noticed the following information:
Display localhost:10.0 unavailable, simulating -nw
As a result, Emacs will run in console mode and can't be able to
communicate with X.
Any hints for this problem?
Regards,
HY
--
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
2021-07-27 13:29 Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled Hongyi Zhao
@ 2021-07-27 14:17 ` Skip Montanaro
2021-07-27 14:52 ` Hongyi Zhao
0 siblings, 1 reply; 7+ messages in thread
From: Skip Montanaro @ 2021-07-27 14:17 UTC (permalink / raw)
To: Hongyi Zhao; +Cc: help-gnu-emacs
> $ ssh -X werner@192.168.10.100
> $ emacs
>
> At this moment, I noticed the following information:
>
> Display localhost:10.0 unavailable, simulating -nw
Are you able to run other X-loving applications on the remote host?
Maybe substitute "xeyes" or "xterm" for "emacs." Also, run ssh in
verbose mode (-v) to see if it gives you clues about why X forwarding
is (apparently) disabled.
Skip
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
2021-07-27 14:17 ` Skip Montanaro
@ 2021-07-27 14:52 ` Hongyi Zhao
2021-07-27 15:07 ` Skip Montanaro
0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2021-07-27 14:52 UTC (permalink / raw)
To: Skip Montanaro; +Cc: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]
On Tue, Jul 27, 2021 at 10:18 PM Skip Montanaro
<skip.montanaro@gmail.com> wrote:
>
> > $ ssh -X werner@192.168.10.100
> > $ emacs
> >
> > At this moment, I noticed the following information:
> >
> > Display localhost:10.0 unavailable, simulating -nw
>
> Are you able to run other X-loving applications on the remote host?
> Maybe substitute "xeyes" or "xterm" for "emacs." Also, run ssh in
> verbose mode (-v) to see if it gives you clues about why X forwarding
> is (apparently) disabled.
I run ssh in verbose mode (-v):
$ ssh -vX werner@192.168.10.100
Then xterm also fails to open display, and it says that X11 connection
rejected because of wrong authentication. But I've enabled the
`X11Forwarding' option for sshd:
$ grep ^X11Forwarding /etc/ssh/sshd_config
X11Forwarding yes
So I still can't figure out what's the problem. I attached the error
message here.
Regards
--
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province
[-- Attachment #2: Selection_002.png --]
[-- Type: image/png, Size: 212402 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
2021-07-27 14:52 ` Hongyi Zhao
@ 2021-07-27 15:07 ` Skip Montanaro
2021-07-27 15:35 ` Hongyi Zhao
0 siblings, 1 reply; 7+ messages in thread
From: Skip Montanaro @ 2021-07-27 15:07 UTC (permalink / raw)
To: Hongyi Zhao; +Cc: help-gnu-emacs
> $ grep ^X11Forwarding /etc/ssh/sshd_config
> X11Forwarding yes
Is this on the remote host or your ssh client host? Have you checked
for X11 forwarding at both ends? Maybe this web page will help you
debug the problem:
https://www.poftut.com/linux-x11-connection-rejected-wrong-authentication-error-solution/
Skip
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
2021-07-27 15:07 ` Skip Montanaro
@ 2021-07-27 15:35 ` Hongyi Zhao
2021-07-28 7:14 ` Hongyi Zhao
0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2021-07-27 15:35 UTC (permalink / raw)
To: Skip Montanaro; +Cc: help-gnu-emacs
On Tue, Jul 27, 2021 at 11:07 PM Skip Montanaro
<skip.montanaro@gmail.com> wrote:
>
> > $ grep ^X11Forwarding /etc/ssh/sshd_config
> > X11Forwarding yes
>
> Is this on the remote host or your ssh client host? Have you checked
> for X11 forwarding at both ends?
On server side:
$ grep ^X11Forwarding /etc/ssh/sshd_config
X11Forwarding yes
On client side:
$ grep '^[ ]*ForwardX11' /etc/ssh/ssh_config
ForwardX11 yes
> Maybe this web page will help you debug the problem:
>
> https://www.poftut.com/linux-x11-connection-rejected-wrong-authentication-error-solution/
I've checked all the aspects list there, but still meet the same error.
Regards
--
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
2021-07-27 15:35 ` Hongyi Zhao
@ 2021-07-28 7:14 ` Hongyi Zhao
2021-07-28 7:19 ` Hongyi Zhao
0 siblings, 1 reply; 7+ messages in thread
From: Hongyi Zhao @ 2021-07-28 7:14 UTC (permalink / raw)
To: Skip Montanaro; +Cc: help-gnu-emacs
On Tue, Jul 27, 2021 at 11:35 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Tue, Jul 27, 2021 at 11:07 PM Skip Montanaro
> <skip.montanaro@gmail.com> wrote:
> >
> > > $ grep ^X11Forwarding /etc/ssh/sshd_config
> > > X11Forwarding yes
> >
> > Is this on the remote host or your ssh client host? Have you checked
> > for X11 forwarding at both ends?
>
> On server side:
>
> $ grep ^X11Forwarding /etc/ssh/sshd_config
> X11Forwarding yes
>
> On client side:
>
> $ grep '^[ ]*ForwardX11' /etc/ssh/ssh_config
> ForwardX11 yes
>
> > Maybe this web page will help you debug the problem:
> >
> > https://www.poftut.com/linux-x11-connection-rejected-wrong-authentication-error-solution/
>
> I've checked all the aspects list there, but still meet the same error.
Finally, I figured out the solution. See the discussion on
comp.unix.shell [1] for more details. I listed below, for reference
only, the successful methods that I finally tried out.
[1]. https://groups.google.com/g/comp.unix.shell/c/7Y6_ISexpzU/m/AmIMlC6qBgAJ
Regards
--
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled.
2021-07-28 7:14 ` Hongyi Zhao
@ 2021-07-28 7:19 ` Hongyi Zhao
0 siblings, 0 replies; 7+ messages in thread
From: Hongyi Zhao @ 2021-07-28 7:19 UTC (permalink / raw)
To: Skip Montanaro; +Cc: help-gnu-emacs
On Wed, Jul 28, 2021 at 3:14 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Tue, Jul 27, 2021 at 11:35 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
> >
> > On Tue, Jul 27, 2021 at 11:07 PM Skip Montanaro
> > <skip.montanaro@gmail.com> wrote:
> > >
> > > > $ grep ^X11Forwarding /etc/ssh/sshd_config
> > > > X11Forwarding yes
> > >
> > > Is this on the remote host or your ssh client host? Have you checked
> > > for X11 forwarding at both ends?
> >
> > On server side:
> >
> > $ grep ^X11Forwarding /etc/ssh/sshd_config
> > X11Forwarding yes
> >
> > On client side:
> >
> > $ grep '^[ ]*ForwardX11' /etc/ssh/ssh_config
> > ForwardX11 yes
> >
> > > Maybe this web page will help you debug the problem:
> > >
> > > https://www.poftut.com/linux-x11-connection-rejected-wrong-authentication-error-solution/
> >
> > I've checked all the aspects list there, but still meet the same error.
>
> Finally, I figured out the solution. See the discussion on
> comp.unix.shell [1] for more details. I listed below, for reference
> only, the successful methods that I finally tried out.
Sorry, I'm in a hurry and missed the content that I should post here.
Please see below:
Obtain the value of `$DISPLAY' locally on the ssh server:
$ echo $DISPLAY
:1
Then all the following methods will do the trick:
Method 1:
$ ssh -X -f wer...@192.168.10.100 DISPLAY=:1 emacs
or
$ ssh -X -f wer...@192.168.10.100 env DISPLAY=:1 emacs
Method 2:
$ ssh -X wer...@192.168.10.100
Then run any of the following commands:
$ DISPLAY=:1 emacs
$ env DISPLAY=:1 emacs
$ emacs -d :1
$ emacs --display :1
NB.
[1]. I obtain the clues from here: <https://kb.iu.edu/d/acxu>
[2]. X server relevant options supplied by Emacs:
werner@X10DAi:~$ man emacs|grep -A 4 -- '-d '
-d displayname, --display=displayname
Create the Emacs window on the display specified by dis‐
playname. Must be the first option specified in the com‐
mand line.
werner@X10DAi:~$ emacs --help|grep -- '-d '
--display, -d DISPLAY use X server DISPLAY
Regards
--
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-07-28 7:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-27 13:29 Failed to run Emacs in X windows mode on remote host over ssh with X11 forwarding enabled Hongyi Zhao
2021-07-27 14:17 ` Skip Montanaro
2021-07-27 14:52 ` Hongyi Zhao
2021-07-27 15:07 ` Skip Montanaro
2021-07-27 15:35 ` Hongyi Zhao
2021-07-28 7:14 ` Hongyi Zhao
2021-07-28 7:19 ` Hongyi Zhao
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).