Howto get X to listen for TCP connections?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Locked
leetwanker
Level 1
Level 1
Posts: 29
Joined: Sat Jan 17, 2015 5:34 pm

Howto get X to listen for TCP connections?

Post by leetwanker » Thu Feb 25, 2016 11:49 pm

I've edited a few files that should have done the trick, I thought:

Code: Select all

$ cat /etc/X11/xinit/xserverrc 
#!/bin/sh
exec /usr/bin/X "$@"
I also tried "exec /usr/bin/X -listen tcp "$@"" here.

Code: Select all

$ cat /etc/mdm/mdm.conf 
...
[security]
DisallowTCP=false
...

Code: Select all

$ cat /usr/share/mdm/defaults.conf 
[security]
...
# If true this will basically append -nolisten tcp to every X command line, a
# good default to have (why is this a "negative" setting? because if it is
# false, you could still not allow it by setting command line of any particular
# server).  It's probably better to ship with this on since most users will not
# need this and it's more of a security risk then anything else.
# Note: Anytime we find a -query or -indirect on the command line we do not add
# a "-nolisten tcp", as then the query just wouldn't work, so this setting only
# affects truly attached sessions.
DisallowTCP=false
...
I even made a mdm custom.conf

Code: Select all

$ cat /etc/mdm/custom.conf 
[security]
DisallowTCP=false
...

Testing port from another LAN computer:

Code: Select all

$ nmap -p6000 192.168.1.199

Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-25 22:48 EST
Host is up (0.00031s latency).
PORT     STATE  SERVICE
6000/tcp closed X11

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

User avatar
LinuxJim
Level 5
Level 5
Posts: 659
Joined: Tue Jan 26, 2016 8:01 pm
Location: Oregon, USA

Re: Howto get X to listen for TCP connections?

Post by LinuxJim » Fri Feb 26, 2016 1:02 am

Have you opened port 6000 for TCP on your firewall?

leetwanker
Level 1
Level 1
Posts: 29
Joined: Sat Jan 17, 2015 5:34 pm

Re: Howto get X to listen for TCP connections?

Post by leetwanker » Fri Feb 26, 2016 1:11 am

LinuxJim wrote:Have you opened port 6000 for TCP on your firewall?
I don't have any firewall installed on my computer and there's no firewall/NAT between these two PCs.

Do I need to specifically open this port with iptables? That wasn't a part of any of the guides I've read.

User avatar
LinuxJim
Level 5
Level 5
Posts: 659
Joined: Tue Jan 26, 2016 8:01 pm
Location: Oregon, USA

Re: Howto get X to listen for TCP connections?

Post by LinuxJim » Fri Feb 26, 2016 2:44 am

leetwanker wrote: Do I need to specifically open this port with iptables? That wasn't a part of any of the guides I've read.
No. The firewall in Mint (ufw) is installed but disabled by default. You would only need to open the port if you enabled it.

dkpco
Level 1
Level 1
Posts: 1
Joined: Tue Aug 23, 2016 8:00 pm

Re: Howto get X to listen for TCP connections?

Post by dkpco » Tue Aug 23, 2016 8:09 pm

This problem took me forever to figure out. Apparently, merely turning off the -nolisten flag is no longer enough. You have to get aggressive and specify -listen tcp. I accomplished that by adding the following lines to my /etc/mdm/mdm.conf file:

[server-Standard]
name=Standard server
command=/usr/bin/X -listen tcp -audit 0
flexible=true

This is just a clone of the lines for that server from the /usr/share/mdm/defaults.conf file with the exception of the command line. I added the "-listen tcp" option and that took care of the issue for me.

kcaran
Level 1
Level 1
Posts: 1
Joined: Fri Apr 20, 2018 1:05 pm

Re: Howto get X to listen for TCP connections?

Post by kcaran » Fri Apr 20, 2018 1:29 pm

I just ran into this issue and dkpco's solution worked perfectly. Thank you!

Locked

Return to “Cinnamon”