Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Connecting to Ubuntu using UltraVNC

Hybrid View

  1. #1
    Join Date
    Jun 2013
    Beans
    7

    Connecting to Ubuntu using UltraVNC

    I'm a beginner to Linux/Ubuntu (I know windows servers very well) and new to Amazon Web Services as well. I have deployed an instance of Ubuntu 12.04 on AWS.

    I successfully ran this command to install the desktop GUI sudo apt-get install ubuntu-desktop

    Now I'm trying to use UltraVNC viewer to connect to the instance but can't get it to work. I have opened port 5900 in AWS security groups but not sure if I have to open the port on Ubuntu server as well. I tried but not sure if it worked.

    What do I need to do in order to connect to the using UltraVNC? Keep in mind that I'm a beginner.

    When I run
    netstat -a there are the results I get

    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    tcp 0 0 *:ssh *:* LISTEN
    tcp 0 0 localhost:ipp *:* LISTEN
    tcp 0 224 ip-10-159-46-181.ec:ssh BMTNON37-30967769:29341 ESTABLISHED
    tcp6 0 0 [::]:ssh [::]:* LISTEN
    tcp6 0 0 ip6-localhost:ipp [::]:* LISTEN
    udp 0 0 *:mdns *:*
    udp 0 0 *:45024 *:*
    udp 0 0 *:bootpc *:*
    udp6 0 0 [::]:mdns [::]:*
    udp6 0 0 [::]:51923 [::]:*

  2. #2
    Join Date
    Feb 2006
    Location
    North Carolina, USA
    Beans
    410
    Distro
    Ubuntu

    Re: Connecting to Ubuntu using UltraVNC

    I don't see your system listening on port 5900. Is the VNC server running? Try the command "vnc4server" from the command line. Once you've done that and believe it is running, try the command "netstat -atpn" to ensure you see something in the neighborhood of port 5900 that looks like VNC.

    Next, have you tried checking on the Firewall running on your Ubuntu image? You may want to try updating your rules as well, with these commands:

    sudo iptables -A INPUT -p tcp --dport 5900 -j ACCEPT
    sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

  3. #3
    Join Date
    Jun 2013
    Beans
    7

    Re: Connecting to Ubuntu using UltraVNC

    @bswilson

    Thanks for helping but it is not working yet...


    vnc4server was not installed. After installing and starting vncserver it prompted me to enter a password which all worked fine

    Then I ran
    sudo iptables -A INPUT -p tcp --dport 5900 -j ACCEPT
    sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

    Then with this command netstat -atpnI get:

    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 2182/Xvnc4
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
    tcp 0 464 10.159.46.181:22 184.149.17.4:36664 ESTABLISHED -
    tcp6 0 0 :::5901 :::* LISTEN 2182/Xvnc4
    tcp6 0 0 :::22 :::* LISTEN -
    tcp6 0 0 ::1:631 :::* LISTEN -
    ubuntu@ip-10-159-46-181:~$

    From what I can tell vncserver is running now. Is there anything I'm missing? How can I find out if the port 5900 is open both on the server and on AWS?

  4. #4
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Connecting to Ubuntu using UltraVNC

    It looks like the vncserver is listening on 5901 not 5900 - basically unless you ask for a specific port / display number it chooses the next free one

    What I typically do is ssh in and then start vncserver on a specific display e.g.

    Code:
    vncserver -geometry 1440x900 :5
    (it will complain if display :5 / port 5905 is already in use) then you *know* which port to open (5900 + display #)

    In fact I'd recommend tunneling VNC over SSH - you still need to know which port/display you started the server on in order to set the tunnel end(s) - but you *don't* need to mess with your actual firewall / open ports because regardless of the VNC port, everything goes externally via your (fixed) SSH port.

  5. #5
    Join Date
    Jun 2013
    Beans
    7

    Re: Connecting to Ubuntu using UltraVNC

    I installed sudo apt-get install nmap

    Ran this command nmap -v -PN <host>

    These are the results and it appears that port 5900 is there but state is closed. How can I open the port?

    Starting Nmap 5.21 ( http://nmap.org ) at 2013-06-06 10:08 UTC
    Initiating Parallel DNS resolution of 1 host. at 10:08
    Completed Parallel DNS resolution of 1 host. at 10:08, 0.00s elapsed
    Initiating Connect Scan at 10:08
    Scanning <host> [1000 ports]
    Discovered open port 22/tcp on <host>
    Completed Connect Scan at 10:08, 4.41s elapsed (1000 total ports)
    Nmap scan report for<host>
    Host is up (0.00089s latency).
    Not shown: 998 filtered ports
    PORT STATE SERVICE
    22/tcp open ssh
    5900/tcp closed vnc

  6. #6
    Join Date
    Jun 2013
    Beans
    7

    Re: Connecting to Ubuntu using UltraVNC

    Thanks for the suggestion SlugSlug. Like I said I'm a beginner at Ubuntu/Linux

    What are the steps to setup VNC over ssh

  7. #7
    Join Date
    Nov 2008
    Location
    Sheffield, UK
    Beans
    1,514
    Distro
    Ubuntu

    Re: Connecting to Ubuntu using UltraVNC

    As suggested you should run VNC over ssh

    I find x11vnc works best for me


    I use putty at work with ssh tunnels setup to connect to home
    run
    x11vnc &

    then in works windows vnc to localhost
    Last edited by SlugSlug; June 6th, 2013 at 11:31 AM.

  8. #8
    Join Date
    Jun 2013
    Beans
    7

    Re: Connecting to Ubuntu using UltraVNC

    Also I can telnet to port 22 but not 5900

  9. #9
    Join Date
    Jun 2013
    Beans
    7

    Re: Connecting to Ubuntu using UltraVNC

    Ok I finally got it to work connecting directly with VNC Viewer. I'm still working on using SSH tunneling.

    But now when I connected with the VNC Viewer for the first time I got the terminal screen. I closed it and now I can't open it again and the desktop GIU does not start either.

    How can I get to the desktop GUI?

  10. #10
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Connecting to Ubuntu using UltraVNC

    Have you created an appropriate ~/.vnc/xstartup file on the server? That's what tells vncserver what kind of session you wan to run

    You probably *don't* want to run a regular (3d) ubuntu session over VNC - at least last time I tried it, handling of compiz was pretty flaky

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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