tigervnc-server unable to connect

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question





















  • @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














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?










share|improve this question





















  • @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












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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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
















  • @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










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.






share|improve this answer



























    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






    share|improve this answer



























      up vote
      0
      down vote













      I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.





      share








      New contributor




      mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

















        Your Answer







        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "106"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        convertImagesToLinks: false,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













         

        draft saved


        draft discarded


















        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






























        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.






        share|improve this answer
























          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.






          share|improve this answer






















            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.






            share|improve this answer












            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 12 '16 at 13:48









            icarus

            4,8181825




            4,8181825






















                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






                share|improve this answer
























                  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






                  share|improve this answer






















                    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






                    share|improve this answer












                    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







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 19 '17 at 14:30









                    Sankarganesh Eswaran

                    1413




                    1413




















                        up vote
                        0
                        down vote













                        I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.





                        share








                        New contributor




                        mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.





















                          up vote
                          0
                          down vote













                          I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.





                          share








                          New contributor




                          mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.



















                            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.





                            share








                            New contributor




                            mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            I went to my ~/$HOME/.vnc directory and whacked the existing pid files. Problem solved.






                            share








                            New contributor




                            mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.








                            share


                            share






                            New contributor




                            mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            answered 1 min ago









                            mikenjenn

                            1




                            1




                            New contributor




                            mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.





                            New contributor





                            mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.






                            mikenjenn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                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













































































                                Popular posts from this blog

                                How to check contact read email or not when send email to Individual?

                                Bahrain

                                Postfix configuration issue with fips on centos 7; mailgun relay