You are not logged in.

#1 2018-08-25 06:56:14

Kirill Bugaev
Member
Registered: 2018-08-03
Posts: 173

[SOLVED] Telnet and X

I want to use telnet to display graphical applications running on a remote machine.
I give the remote machine access to my X server using the xhost command.

xhost +192.168.4.140

After that, connect to remote machine.

telnet 192.168.4.140

Then, set the environment variable DISPLAY on remote machine.

export DISPLAY="192.168.4.1:0.0"

After that, try to run X application (e.g. firefox) on remote machine, but get message:

Unable to init server: Broadway display type not supported: 192.168.4.1:0.0
Error: cannot open display: 192.168.4.1:0.0

Last edited by Kirill Bugaev (2018-08-27 07:16:49)

Offline

#2 2018-08-25 16:17:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,842

Re: [SOLVED] Telnet and X

Before going into details: why do you want to use telnet?
telnet is more or less superseded by ssh and on top of that, firefox (and other fat clients based on gtk or Qt) make remote X11 *very* expensive because they basically don't use X11. The render images and upload them to the X11 server, what consumes quite some bandwidth. VNC is a better alternative for this, because it compresses the transferred "video" quite efficiently.

Offline

#3 2018-08-25 16:36:03

Kirill Bugaev
Member
Registered: 2018-08-03
Posts: 173

Re: [SOLVED] Telnet and X

I just read this book and studying network utils.
Yes, I know that rlogin, rsh and telnet is bad choice, because they are blatantly insecure. I already have done what I want with ssh, but still interesting in why telnet method doesn't work.

Last edited by Kirill Bugaev (2018-08-25 16:39:59)

Offline

#4 2018-08-25 16:49:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,842

Re: [SOLVED] Telnet and X

X11 "over" telnet works fundamentally different from X11 over ssh, on what tcp port does the remote X11 server listen? What's the output of "ps aux | grep Xorg" on the remote machine? Does it say "-nolisten tcp"?

Offline

#5 2018-08-27 05:17:33

Kirill Bugaev
Member
Registered: 2018-08-03
Posts: 173

Re: [SOLVED] Telnet and X

ps aux | grep Xorg
user1      561  1.6  1.8 487432 69572 tty1     Rl   13:01   0:15 /usr/lib/Xorg -nolisten tcp :0 vt1 -keeptty -auth /tmp/serverauth.tFORcDH27x

Offline

#6 2018-08-27 05:56:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,842

Re: [SOLVED] Telnet and X

Well, yes…

seth wrote:

On what tcp port does the remote X11 server listen?

Try nmap.
Why is that?
Did you check the Xorg manpage?

Offline

#7 2018-08-27 06:33:31

Kirill Bugaev
Member
Registered: 2018-08-03
Posts: 173

Re: [SOLVED] Telnet and X

seth, thanks a lot for the direction of exploring.

I have found in xorg man

NETWORK CONNECTIONS
       Xorg  supports  connections  made  using  the  following reliable byte-
       streams:
...
       TCP/IP
           Xorg  listens  on port 6000+n, where n is the display number.  This
           connection type is usually disabled by default, but may be  enabled
           with the -listen option (see the Xserver(1) man page for details).

So it should be port 6000 for display 0, of course if tcp/ip connection is enabled.

I don't have experience with nmap. On machine with X-server listing is following

nmap 192.168.43.79
Starting Nmap 7.70 ( https://nmap.org ) at 2018-08-27 14:30 +08
Nmap scan report for myhostname (192.168.43.79)
Host is up (0.00033s latency).
Not shown: 997 closed ports
PORT    STATE SERVICE
25/tcp  open  smtp
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds

Nmap done: 1 IP address (1 host up) scanned in 0.16 seconds

Does this mean that TCP/IP connection for X-server isn't enabled?

Last edited by Kirill Bugaev (2018-08-27 06:35:24)

Offline

#8 2018-08-27 06:36:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,842

Re: [SOLVED] Telnet and X

Yup, and the manpage and your post #5 actually explain "why" ;-)

Offline

#9 2018-08-27 07:16:14

Kirill Bugaev
Member
Registered: 2018-08-03
Posts: 173

Re: [SOLVED] Telnet and X

seth, thanks a lot. Everything works fine.
I have changed /etc/X11/xinit/xserverrc

#!/bin/sh
#exec /usr/bin/X -nolisten tcp "$@"
exec /usr/bin/X -listen tcp "$@"

Now nmap say

nmap 192.168.4.1
Starting Nmap 7.70 ( https://nmap.org ) at 2018-08-27 15:15 +08
Nmap scan report for 192.168.4.1
Host is up (0.00032s latency).
Not shown: 996 closed ports
PORT     STATE SERVICE
25/tcp   open  smtp
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
6000/tcp open  X11

Now 6000/tcp open  X11.
I give the remote machine access to my X server using the xhost command on local machine

xhost +192.168.4.140

Then, i connect to remote machine

telnet 192.168.4.140

Set the environment variable DISPLAY on remote machine.

export DISPLAY="192.168.4.1:0.0"

Finally start X-application on remote machine

xclock

Last edited by Kirill Bugaev (2018-08-27 07:21:13)

Offline

Board footer

Powered by FluxBB