tigervnc-server unable to connect
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have followed all the steps described in https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-remote-access-for-the-gnome-desktop-on-centos-7
I am able to start the vncserver service
[root@server ~]# systemctl start vncserver@:1.service
[root@server ~]# systemctl status vncserver@:1.service
â vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2016-11-12 01:40:25 EET; 5s ago
Process: 32470 ExecStop=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Process: 3023 ExecStart=/usr/sbin/runuser -l user -c /usr/bin/vncserver %i -geometry 1280x1024 (code=exited, status=0/SUCCESS)
Process: 3004 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Main PID: 3070 (Xvnc)
CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
⣠3070 /usr/bin/Xvnc :1 -desktop server:1 (user) -auth /home/user/.Xauthority -geometry 1280x1024 -rfbwait 30000 -rfbauth /home/user/.vnc...
Nov 12 01:40:22 server systemd[1]: Starting Remote desktop service (VNC)...
Nov 12 01:40:25 server systemd[1]: Started Remote desktop service (VNC).
I deleted all iptables rules
[root@server ~]# iptables -nvL
Chain INPUT (policy ACCEPT 2710 packets, 297K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 2515 packets, 478K bytes)
pkts bytes target prot opt in out source destination
Firewall is disabled
[root@server ~]# firewall-cmd --state
not running
Port 5901 is open and listening
[root@server ~]# netstat -tpln | grep "5901"
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 3070/Xvnc
tcp6 0 0 :::5901 :::* LISTEN 3070/Xvnc
I also have the socket file /tmp/.X11-unix/X1
But when I try to connect through vncviewer using IP:5901 I get the same error "The connection was refused by the host computer".
I have multiple servers running this same configuration and everything works fine but all of them were configured after installation, unlike this one which has been running for quite some time. The server is running CentOS 7. Is there anything I can do without physical access to it (no wiping all data/reinstalling the OS) in order to make it work?
centos vnc
add a comment |Â
up vote
0
down vote
favorite
I have followed all the steps described in https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-remote-access-for-the-gnome-desktop-on-centos-7
I am able to start the vncserver service
[root@server ~]# systemctl start vncserver@:1.service
[root@server ~]# systemctl status vncserver@:1.service
â vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2016-11-12 01:40:25 EET; 5s ago
Process: 32470 ExecStop=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Process: 3023 ExecStart=/usr/sbin/runuser -l user -c /usr/bin/vncserver %i -geometry 1280x1024 (code=exited, status=0/SUCCESS)
Process: 3004 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Main PID: 3070 (Xvnc)
CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
⣠3070 /usr/bin/Xvnc :1 -desktop server:1 (user) -auth /home/user/.Xauthority -geometry 1280x1024 -rfbwait 30000 -rfbauth /home/user/.vnc...
Nov 12 01:40:22 server systemd[1]: Starting Remote desktop service (VNC)...
Nov 12 01:40:25 server systemd[1]: Started Remote desktop service (VNC).
I deleted all iptables rules
[root@server ~]# iptables -nvL
Chain INPUT (policy ACCEPT 2710 packets, 297K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 2515 packets, 478K bytes)
pkts bytes target prot opt in out source destination
Firewall is disabled
[root@server ~]# firewall-cmd --state
not running
Port 5901 is open and listening
[root@server ~]# netstat -tpln | grep "5901"
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 3070/Xvnc
tcp6 0 0 :::5901 :::* LISTEN 3070/Xvnc
I also have the socket file /tmp/.X11-unix/X1
But when I try to connect through vncviewer using IP:5901 I get the same error "The connection was refused by the host computer".
I have multiple servers running this same configuration and everything works fine but all of them were configured after installation, unlike this one which has been running for quite some time. The server is running CentOS 7. Is there anything I can do without physical access to it (no wiping all data/reinstalling the OS) in order to make it work?
centos vnc
@icarus I tried with telnet and I also get connection refused
â M B
Nov 12 '16 at 7:35
@icarus Thanks for the help, I completely forgot that the server was behind a router... which didn't forward port 5901 to it. Adding a port forward rule for the router fixed it.
â M B
Nov 12 '16 at 13:18
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have followed all the steps described in https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-remote-access-for-the-gnome-desktop-on-centos-7
I am able to start the vncserver service
[root@server ~]# systemctl start vncserver@:1.service
[root@server ~]# systemctl status vncserver@:1.service
â vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2016-11-12 01:40:25 EET; 5s ago
Process: 32470 ExecStop=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Process: 3023 ExecStart=/usr/sbin/runuser -l user -c /usr/bin/vncserver %i -geometry 1280x1024 (code=exited, status=0/SUCCESS)
Process: 3004 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Main PID: 3070 (Xvnc)
CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
⣠3070 /usr/bin/Xvnc :1 -desktop server:1 (user) -auth /home/user/.Xauthority -geometry 1280x1024 -rfbwait 30000 -rfbauth /home/user/.vnc...
Nov 12 01:40:22 server systemd[1]: Starting Remote desktop service (VNC)...
Nov 12 01:40:25 server systemd[1]: Started Remote desktop service (VNC).
I deleted all iptables rules
[root@server ~]# iptables -nvL
Chain INPUT (policy ACCEPT 2710 packets, 297K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 2515 packets, 478K bytes)
pkts bytes target prot opt in out source destination
Firewall is disabled
[root@server ~]# firewall-cmd --state
not running
Port 5901 is open and listening
[root@server ~]# netstat -tpln | grep "5901"
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 3070/Xvnc
tcp6 0 0 :::5901 :::* LISTEN 3070/Xvnc
I also have the socket file /tmp/.X11-unix/X1
But when I try to connect through vncviewer using IP:5901 I get the same error "The connection was refused by the host computer".
I have multiple servers running this same configuration and everything works fine but all of them were configured after installation, unlike this one which has been running for quite some time. The server is running CentOS 7. Is there anything I can do without physical access to it (no wiping all data/reinstalling the OS) in order to make it work?
centos vnc
I have followed all the steps described in https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-remote-access-for-the-gnome-desktop-on-centos-7
I am able to start the vncserver service
[root@server ~]# systemctl start vncserver@:1.service
[root@server ~]# systemctl status vncserver@:1.service
â vncserver@:1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@:1.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2016-11-12 01:40:25 EET; 5s ago
Process: 32470 ExecStop=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Process: 3023 ExecStart=/usr/sbin/runuser -l user -c /usr/bin/vncserver %i -geometry 1280x1024 (code=exited, status=0/SUCCESS)
Process: 3004 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Main PID: 3070 (Xvnc)
CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
⣠3070 /usr/bin/Xvnc :1 -desktop server:1 (user) -auth /home/user/.Xauthority -geometry 1280x1024 -rfbwait 30000 -rfbauth /home/user/.vnc...
Nov 12 01:40:22 server systemd[1]: Starting Remote desktop service (VNC)...
Nov 12 01:40:25 server systemd[1]: Started Remote desktop service (VNC).
I deleted all iptables rules
[root@server ~]# iptables -nvL
Chain INPUT (policy ACCEPT 2710 packets, 297K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 2515 packets, 478K bytes)
pkts bytes target prot opt in out source destination
Firewall is disabled
[root@server ~]# firewall-cmd --state
not running
Port 5901 is open and listening
[root@server ~]# netstat -tpln | grep "5901"
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 3070/Xvnc
tcp6 0 0 :::5901 :::* LISTEN 3070/Xvnc
I also have the socket file /tmp/.X11-unix/X1
But when I try to connect through vncviewer using IP:5901 I get the same error "The connection was refused by the host computer".
I have multiple servers running this same configuration and everything works fine but all of them were configured after installation, unlike this one which has been running for quite some time. The server is running CentOS 7. Is there anything I can do without physical access to it (no wiping all data/reinstalling the OS) in order to make it work?
centos vnc
centos vnc
asked Nov 12 '16 at 0:07
M B
312
312
@icarus I tried with telnet and I also get connection refused
â M B
Nov 12 '16 at 7:35
@icarus Thanks for the help, I completely forgot that the server was behind a router... which didn't forward port 5901 to it. Adding a port forward rule for the router fixed it.
â M B
Nov 12 '16 at 13:18
add a comment |Â
@icarus I tried with telnet and I also get connection refused
â M B
Nov 12 '16 at 7:35
@icarus Thanks for the help, I completely forgot that the server was behind a router... which didn't forward port 5901 to it. Adding a port forward rule for the router fixed it.
â M B
Nov 12 '16 at 13:18
@icarus I tried with telnet and I also get connection refused
â M B
Nov 12 '16 at 7:35
@icarus I tried with telnet and I also get connection refused
â M B
Nov 12 '16 at 7:35
@icarus Thanks for the help, I completely forgot that the server was behind a router... which didn't forward port 5901 to it. Adding a port forward rule for the router fixed it.
â M B
Nov 12 '16 at 13:18
@icarus Thanks for the help, I completely forgot that the server was behind a router... which didn't forward port 5901 to it. Adding a port forward rule for the router fixed it.
â M B
Nov 12 '16 at 13:18
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
0
down vote
accepted
Ensure that you can connect from the server itself to port 5901 using 127.0.0.1. You can use programs like telnet 127.0.0.1 5901
or socat stdin tcp:127.0.0.1:5901
to do this if you don't have a display on the server.
Ensure that there is nothing in the network filtering the traffic to port 5901.
add a comment |Â
up vote
1
down vote
It worked for me after modifying the firewall
sudo systemctl daemon-reload
sudo firewall-cmd --permanent --zone=public --add-port=5901/tcp
sudo firewall-cmd --reload
Note:port no 5901 in mycase
add a comment |Â
up vote
0
down vote
I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.
New contributor
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Ensure that you can connect from the server itself to port 5901 using 127.0.0.1. You can use programs like telnet 127.0.0.1 5901
or socat stdin tcp:127.0.0.1:5901
to do this if you don't have a display on the server.
Ensure that there is nothing in the network filtering the traffic to port 5901.
add a comment |Â
up vote
0
down vote
accepted
Ensure that you can connect from the server itself to port 5901 using 127.0.0.1. You can use programs like telnet 127.0.0.1 5901
or socat stdin tcp:127.0.0.1:5901
to do this if you don't have a display on the server.
Ensure that there is nothing in the network filtering the traffic to port 5901.
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Ensure that you can connect from the server itself to port 5901 using 127.0.0.1. You can use programs like telnet 127.0.0.1 5901
or socat stdin tcp:127.0.0.1:5901
to do this if you don't have a display on the server.
Ensure that there is nothing in the network filtering the traffic to port 5901.
Ensure that you can connect from the server itself to port 5901 using 127.0.0.1. You can use programs like telnet 127.0.0.1 5901
or socat stdin tcp:127.0.0.1:5901
to do this if you don't have a display on the server.
Ensure that there is nothing in the network filtering the traffic to port 5901.
answered Nov 12 '16 at 13:48
icarus
4,8181825
4,8181825
add a comment |Â
add a comment |Â
up vote
1
down vote
It worked for me after modifying the firewall
sudo systemctl daemon-reload
sudo firewall-cmd --permanent --zone=public --add-port=5901/tcp
sudo firewall-cmd --reload
Note:port no 5901 in mycase
add a comment |Â
up vote
1
down vote
It worked for me after modifying the firewall
sudo systemctl daemon-reload
sudo firewall-cmd --permanent --zone=public --add-port=5901/tcp
sudo firewall-cmd --reload
Note:port no 5901 in mycase
add a comment |Â
up vote
1
down vote
up vote
1
down vote
It worked for me after modifying the firewall
sudo systemctl daemon-reload
sudo firewall-cmd --permanent --zone=public --add-port=5901/tcp
sudo firewall-cmd --reload
Note:port no 5901 in mycase
It worked for me after modifying the firewall
sudo systemctl daemon-reload
sudo firewall-cmd --permanent --zone=public --add-port=5901/tcp
sudo firewall-cmd --reload
Note:port no 5901 in mycase
answered Mar 19 '17 at 14:30
Sankarganesh Eswaran
1413
1413
add a comment |Â
add a comment |Â
up vote
0
down vote
I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.
New contributor
add a comment |Â
up vote
0
down vote
I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.
New contributor
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.
New contributor
I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.
New contributor
New contributor
answered 1 min ago
mikenjenn
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f322728%2ftigervnc-server-unable-to-connect%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
@icarus I tried with telnet and I also get connection refused
â M B
Nov 12 '16 at 7:35
@icarus Thanks for the help, I completely forgot that the server was behind a router... which didn't forward port 5901 to it. Adding a port forward rule for the router fixed it.
â M B
Nov 12 '16 at 13:18