Find the answer to your Linux question:
Results 1 to 4 of 4
I installed vncserver on my redhat, i installed same setup as i used on my last server where it worked. But now after start vncserver and trying to connect it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User postcd's Avatar
    Join Date
    Apr 2011
    Posts
    327

    vnc server connection refused and port appears closed


    I installed vncserver on my redhat, i installed same setup as i used on my last server where it worked.

    But now after start vncserver and trying to connect it says "Connection refused"
    I tried to check if port is open from external computer and it says its Closed.

    I tried service iptables stop
    and it still refused. Then i did iptables status and it shown some iptables things, so not sure if it was really stopped. so i added this rule to iptables: iptables -I INPUT -p tcp --dport 1 -j ACCEPT
    my port is 1 of vnc.

    but still refused. So i want to ask how to open that port? Or what to check?

    the log file shows this:
    Failed to read: session.screen0.iconbar.iconWidth
    Setting default value
    Failed to read: session.screen0.iconbar.iconTextPadding
    Setting default value
    Failed to read: session.screen0.iconbar.usePixmap
    Setting default value
    Failed to read: session.screen0.titlebar.left
    Setting default value
    Failed to read: session.screen0.titlebar.right
    Setting default value
    "Avoid the Gates of Hell. Use Linux affordable VPS."

  2. #2
    Just Joined!
    Join Date
    May 2014
    Posts
    2
    Quote Originally Posted by postcd View Post
    I installed vncserver on my redhat, i installed same setup as i used on my last server where it worked.

    But now after start vncserver and trying to connect it says "Connection refused"
    I tried to check if port is open from external computer and it says its Closed.

    I tried service iptables stop
    and it still refused. Then i did iptables status and it shown some iptables things, so not sure if it was really stopped. so i added this rule to iptables: iptables -I INPUT -p tcp --dport 1 -j ACCEPT
    my port is 1 of vnc.

    but still refused. So i want to ask how to open that port? Or what to check?

    the log file shows this:
    Simply stopping iptables is enough, if your vncserver is started correctly.

    You are mixing display numbers with vnc port numbers. However, there is a correlation between them (eg. display 1 = vnc port 5901, 6001 etc.)

    What display you are trying to connect vs. what is configured in /etc/sysconfig/vncservers?

    What your server returns on: netstat -tulp | grep vnc?
    You should see the output similar to this:

    tcp 0 0 *:5901 *:* LISTEN 7250/Xvnc
    tcp 0 0 *:6001 *:* LISTEN 7250/Xvnc
    Last edited by msekara; 05-24-2014 at 12:37 PM.

  3. #3
    Linux User postcd's Avatar
    Join Date
    Apr 2011
    Posts
    327
    It returns:

    netstat -tulp | grep vnc

    tcp 0 0 *:5801 *:* LISTEN 5493/Xvnc
    tcp 0 0 *:5901 *:* LISTEN 5493/Xvnc
    tcp 0 0 *:6001 *:* LISTEN 5493/Xvnc
    tcp 0 0 *:6001 *:* LISTEN 5493/Xvnc

    Also after doing command ps aux | grep vnc
    i was able to see there is 5901 port mentioned, and when tried to connect this port, it worked. not sure why port 1 failed. i remember i was able to connect at port 1 when used this vnc setup, but somehow it not worked now
    "Avoid the Gates of Hell. Use Linux affordable VPS."

  4. #4
    Just Joined!
    Join Date
    May 2014
    Posts
    2
    Quote Originally Posted by postcd View Post
    It returns:

    netstat -tulp | grep vnc

    tcp 0 0 *:5801 *:* LISTEN 5493/Xvnc
    tcp 0 0 *:5901 *:* LISTEN 5493/Xvnc
    tcp 0 0 *:6001 *:* LISTEN 5493/Xvnc
    tcp 0 0 *:6001 *:* LISTEN 5493/Xvnc

    Also after doing command ps aux | grep vnc
    i was able to see there is 5901 port mentioned, and when tried to connect this port, it worked. not sure why port 1 failed. i remember i was able to connect at port 1 when used this vnc setup, but somehow it not worked now
    Glad you got it sorted.

    In your vnc client you specify display number you are connecting to not a port number (unless the default port number has been changed).

    eg. VNC Server: <ip_address>:<display_number>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •