10

can someone provide a step by step for vnc setup on ubuntu 10.10 desktop. I have ssh access to it at the moment with root user.

I tried installing vnc4server package, then after that did a vncpasswd with root and setup a password of 7characters and once of 6characters.

Then forwarded vnc ports via ssh tunnels but at first it gave me the prompt to type vnc password and won't accept, now it just won't connect.

name of my ubuntudesktop = ubuntuhome (192.168.1.22) name of my remote machine from where i want to connect from is = lockerpc

Which port shall I add in "Source and Destination" in Putty > SSH > Tunnels ?

in source I inputted localhost:5901 and in Destination IP Address 192.168.1.22:5900 (the private IP of my UbuntuDesktop

I can successfully ssh but not vnc. will be grateful for your help. Please if you can write the steps down for this scenario, as i have gone through a whole lot of links and its all very confusing.

Kind regards

6

I don't bother with any of the server jazz. I install x11vnc on the remote computer, connect to it by ssh, forwarding back the port and then just connect locally (to the forwarded port).

Here's the SSH command I use:

ssh oli@192.168.0.4 -L 5900:localhost:5900 "x11vnc -display :0 -noxdamage"

Once that's running, I just start my VNC client and connect to localhost:5900

You can script this to do one then the other. I'd tell you what I do but this is running on my phone and the client is different.

  • I will be ssh'ng and vnc'ng from a windows machine, using putty and real vnc viewer. is it possible, I can setup what you are referring to via ssh root prompt ? Thanks for the reply – rihatum Oct 14 '10 at 13:30
  • Yeah. The forwarding is the same, just using Putty's GUI to set it up. Here's a diagrammed walkthrough with VNC in mind: martybugs.net/smoothwall/puttyvnc.cgi – Oli Oct 14 '10 at 13:39
  • Just noticed it uses 5901 as the port so it doesn't clash with a locally running VNC server. You can follow them or just use 5900. – Oli Oct 14 '10 at 13:41
  • You can also have Putty run the command part on connect too to further simplify things. It's completely optional but if you're doing it five times a day, every day, you might appreciate it. – Oli Oct 14 '10 at 15:05
  • Note this solution requires that there is already an X11 display running on the remote host, and that your remote user can access it. (Which might not be the case if the remote X11 display is still showing the GDM login screen, for example.) If you have no remote X11 display, then SuperJames' solution applies. – Riccardo Murri Oct 14 '10 at 16:49
6

I did not see from your description that you started the vnc server.

vncserver :1 -name "My-Server" -geometry 1600x1100

don't do that as root tho. Run is as a regular user. I have a similar post for setting up vnc4server on SuperUser.com: connecting via VNC

Now for the putty setup, the Source port should be 5901 and the Destination should be localhost:5901

When you connect from windows your command should look like this:

vncviewer.exe -connect Server:1
0

There is two part in your question :

  • You should have vnc running on your computer.
  • You should create a tunnel that allow you to access it.

It's easier if you can test on the network where the machine is installed.

Starting vnc

Regarding the first part, I personally use vino. There is a quick setup guide for vino.

Install vino:

sudo apt-get install vino

Configure vino:

vino-preferences

By default, it open this windows :

alt text

If you can redirect your display, you can make that windows pop on another computer. If not, you'll need to check the vino man page to find out how to make the same configuration .

You start the server with :

/usr/lib/vino/vino-server

Once you connected to your VNC, I suggest you enter this command in your Autostarted Apps to start vino server.

There several tool out there. I used vino because it is the simplest to use (in my knowledge).

Tunnel

Regarding the second part of the question. The local port is what ever you feel like. By convention, we try to make the local and remote port the same. You will need to specify the port if you use something different.

The remote port is where your server is running. If you are using vino, it's localhost:5900 (unless you configure something else).

0

I find x11vnc very nice and easy to get quickly started. Just took 3 steps to get it installed:

  1. Install x11vnc:

    $ sudo apt-get install x11vnc
    
  2. Run x11vnc:

    $ x11vnc
    ...
    The VNC desktop is:      sun:0
    PORT=5900
    
  3. From another box VNC to this above box.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.