Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question

4 Answers 4

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.

share|improve this answer
    
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

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
share|improve this answer

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).

share|improve this answer

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

Step 1)

$ sudo apt-get install x11vnc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libjpeg8 libjpeg-progs icewm-common feh giblib1 xfonts-terminus
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libvncserver0 tk tk8.4 x11vnc-data
Suggested packages:
  libvncserver0-dbg
The following NEW packages will be installed:
  libvncserver0 tk tk8.4 x11vnc x11vnc-data
0 upgraded, 5 newly installed, 0 to remove and 225 not upgraded.
Need to get 2,795 kB of archives.
After this operation, 6,124 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  libvncserver0 tk8.4 tk x11vnc-data x11vnc
Install these packages without verification [y/N]? y
Get:1 http://be.archive.ubuntu.com/ubuntu/ natty/main libvncserver0 amd64 0.9.7-2ubuntu1 [178 kB]
Get:2 http://be.archive.ubuntu.com/ubuntu/ natty/main tk8.4 amd64 8.4.19-4 [1,049 kB]
Get:3 http://be.archive.ubuntu.com/ubuntu/ natty/main tk all 8.4.16-2 [4,184 B]
Get:4 http://be.archive.ubuntu.com/ubuntu/ natty/universe x11vnc-data all 0.9.10-1.1 [529 kB]
Get:5 http://be.archive.ubuntu.com/ubuntu/ natty/universe x11vnc amd64 0.9.10-1.1 [1,035 kB]
Fetched 2,795 kB in 1s (2,220 kB/s)
Selecting previously deselected package libvncserver0.
(Reading database ... 155647 files and directories currently installed.)
Unpacking libvncserver0 (from .../libvncserver0_0.9.7-2ubuntu1_amd64.deb) ...
Selecting previously deselected package tk8.4.
Unpacking tk8.4 (from .../tk8.4_8.4.19-4_amd64.deb) ...
Selecting previously deselected package tk.
Unpacking tk (from .../archives/tk_8.4.16-2_all.deb) ...
Selecting previously deselected package x11vnc-data.
Unpacking x11vnc-data (from .../x11vnc-data_0.9.10-1.1_all.deb) ...
Selecting previously deselected package x11vnc.
Unpacking x11vnc (from .../x11vnc_0.9.10-1.1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for menu ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for desktop-file-utils ...
Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.en_US.utf8.cache...
Processing triggers for python-support ...
Setting up libvncserver0 (0.9.7-2ubuntu1) ...
Setting up tk8.4 (8.4.19-4) ...
update-alternatives: using /usr/bin/wish8.4 to provide /usr/bin/wish (wish) in auto mode.
Setting up tk (8.4.16-2) ...
update-alternatives: using /usr/bin/wish-default to provide /usr/bin/wish (wish) in auto mode.
Setting up x11vnc-data (0.9.10-1.1) ...
Setting up x11vnc (0.9.10-1.1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for menu ...

Step 2)

$ x11vnc
###############################################################
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@                                                           @#
#@  **  WARNING  **  WARNING  **  WARNING  **  WARNING  **   @#
#@                                                           @#
#@        YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!!        @#
#@                                                           @#
#@  This means anyone with network access to this computer   @#
#@  may be able to view and control your desktop.            @#
#@                                                           @#
#@ >>> If you did not mean to do this Press CTRL-C now!! <<< @#
#@                                                           @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@                                                           @#
#@  You can create an x11vnc password file by running:       @#
#@                                                           @#
#@       x11vnc -storepasswd password /path/to/passfile      @#
#@  or   x11vnc -storepasswd /path/to/passfile               @#
#@  or   x11vnc -storepasswd                                 @#
#@                                                           @#
#@  (the last one will use ~/.vnc/passwd)                    @#
#@                                                           @#
#@  and then starting x11vnc via:                            @#
#@                                                           @#
#@      x11vnc -rfbauth /path/to/passfile                    @#
#@                                                           @#
#@  an existing ~/.vnc/passwd file from another VNC          @#
#@  application will work fine too.                          @#
#@                                                           @#
#@  You can also use the -passwdfile or -passwd options.     @#
#@  (note -passwd is unsafe if local users are not trusted)  @#
#@                                                           @#
#@  Make sure any -rfbauth and -passwdfile password files    @#
#@  cannot be read by untrusted users.                       @#
#@                                                           @#
#@  Use x11vnc -usepw to automatically use your              @#
#@  ~/.vnc/passwd or ~/.vnc/passwdfile password files.       @#
#@  (and prompt you to create ~/.vnc/passwd if neither       @#
#@  file exists.)  Under -usepw, x11vnc will exit if it      @#
#@  cannot find a password to use.                           @#
#@                                                           @#
#@                                                           @#
#@  Even with a password, the subsequent VNC traffic is      @#
#@  sent in the clear.  Consider tunnelling via ssh(1):      @#
#@                                                           @#
#@    http://www.karlrunge.com/x11vnc/#tunnelling            @#
#@                                                           @#
#@  Or using the x11vnc SSL options: -ssl and -stunnel       @#
#@                                                           @#
#@  Please Read the documention for more info about          @#
#@  passwords, security, and encryption.                     @#
#@                                                           @#
#@    http://www.karlrunge.com/x11vnc/faq.html#faq-passwd    @#
#@                                                           @#
#@  To disable this warning use the -nopw option, or put     @#
#@  the setting in your ~/.x11vncrc file.                    @#
#@                                                           @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
###############################################################
30/11/2011 22:23:04 x11vnc version: 0.9.10 lastmod: 2010-04-28  pid: 7493
30/11/2011 22:23:04 Using X display :0.0
30/11/2011 22:23:04 rootwin: 0xad reswin: 0xe00001 dpy: 0x28b0990
30/11/2011 22:23:04 
30/11/2011 22:23:04 ------------------ USEFUL INFORMATION ------------------
30/11/2011 22:23:04 X DAMAGE available on display, using it for polling hints.
30/11/2011 22:23:04   To disable this behavior use: '-noxdamage'
30/11/2011 22:23:04 
30/11/2011 22:23:04   Most compositing window managers like 'compiz' or 'beryl'
30/11/2011 22:23:04   cause X DAMAGE to fail, and so you may not see any screen
30/11/2011 22:23:04   updates via VNC.  Either disable 'compiz' (recommended) or
30/11/2011 22:23:04   supply the x11vnc '-noxdamage' command line option.
30/11/2011 22:23:04 
30/11/2011 22:23:04 Wireframing: -wireframe mode is in effect for window moves.
30/11/2011 22:23:04   If this yields undesired behavior (poor response, painting
30/11/2011 22:23:04   errors, etc) it may be disabled:
30/11/2011 22:23:04    - use '-nowf' to disable wireframing completely.
30/11/2011 22:23:04    - use '-nowcr' to disable the Copy Rectangle after the
30/11/2011 22:23:04      moved window is released in the new position.
30/11/2011 22:23:04   Also see the -help entry for tuning parameters.
30/11/2011 22:23:04   You can press 3 Alt_L's (Left "Alt" key) in a row to 
30/11/2011 22:23:04   repaint the screen, also see the -fixscreen option for
30/11/2011 22:23:04   periodic repaints.
30/11/2011 22:23:04 
30/11/2011 22:23:04 XFIXES available on display, resetting cursor mode
30/11/2011 22:23:04   to: '-cursor most'.
30/11/2011 22:23:04   to disable this behavior use: '-cursor arrow'
30/11/2011 22:23:04   or '-noxfixes'.
30/11/2011 22:23:04 using XFIXES for cursor drawing.
30/11/2011 22:23:04 GrabServer control via XTEST.
30/11/2011 22:23:04 
30/11/2011 22:23:04 Scroll Detection: -scrollcopyrect mode is in effect to
30/11/2011 22:23:04   use RECORD extension to try to detect scrolling windows
30/11/2011 22:23:04   (induced by either user keystroke or mouse input).
30/11/2011 22:23:04   If this yields undesired behavior (poor response, painting
30/11/2011 22:23:04   errors, etc) it may be disabled via: '-noscr'
30/11/2011 22:23:04   Also see the -help entry for tuning parameters.
30/11/2011 22:23:04   You can press 3 Alt_L's (Left "Alt" key) in a row to 
30/11/2011 22:23:04   repaint the screen, also see the -fixscreen option for
30/11/2011 22:23:04   periodic repaints.
30/11/2011 22:23:04 
30/11/2011 22:23:04 XKEYBOARD: number of keysyms per keycode 6 is greater
30/11/2011 22:23:04   than 4 and 2 keysyms are mapped above 4.
30/11/2011 22:23:04   Automatically switching to -xkb mode.
30/11/2011 22:23:04   If this makes the key mapping worse you can
30/11/2011 22:23:04   disable it with the "-noxkb" option.
30/11/2011 22:23:04   Also, remember "-remap DEAD" for accenting characters.
30/11/2011 22:23:04 
30/11/2011 22:23:04 X FBPM extension not supported.
30/11/2011 22:23:04 X display is capable of DPMS.
30/11/2011 22:23:04 --------------------------------------------------------
30/11/2011 22:23:04 
30/11/2011 22:23:04 Default visual ID: 0x21
30/11/2011 22:23:04 Read initial data from X display into framebuffer.
30/11/2011 22:23:04 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120
30/11/2011 22:23:04 
30/11/2011 22:23:04 X display :0.0 is 32bpp depth=24 true color
30/11/2011 22:23:04 
30/11/2011 22:23:04 Autoprobing TCP port 
30/11/2011 22:23:04 Autoprobing selected port 5900
30/11/2011 22:23:04 Listening also on IPv6 port 5900 (socket 10)
30/11/2011 22:23:04 
30/11/2011 22:23:04 Xinerama is present and active (e.g. multi-head).
30/11/2011 22:23:04 Xinerama: number of sub-screens: 1
30/11/2011 22:23:04 Xinerama: no blackouts needed (only one sub-screen)
30/11/2011 22:23:04 
30/11/2011 22:23:04 fb read rate: 516 MB/sec
30/11/2011 22:23:04 fast read: reset wait  ms to: 10
30/11/2011 22:23:04 fast read: reset defer ms to: 10
30/11/2011 22:23:04 The X server says there are 10 mouse buttons.
30/11/2011 22:23:04 screen setup finished.
30/11/2011 22:23:04 
30/11/2011 22:23:04 WARNING: You are running x11vnc WITHOUT a password.  See
30/11/2011 22:23:04 WARNING: the warning message printed above for more info.
30/11/2011 22:23:04 

The VNC desktop is:      sun:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

30/11/2011 22:30:45 Got connection from client 192.168.1.3
30/11/2011 22:30:45   other clients:
30/11/2011 22:30:45 Disabled X server key autorepeat.
30/11/2011 22:30:45   to force back on run: 'xset r on' (3 times)
30/11/2011 22:30:45 incr accepted_client=1 for 192.168.1.3:40553  sock=11
30/11/2011 22:30:45 Client Protocol Version 3.8
30/11/2011 22:30:45 Protocol version sent 3.8, using 3.8
30/11/2011 22:30:45 rfbProcessClientSecurityType: executing handler for type 1
30/11/2011 22:30:45 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
30/11/2011 22:30:45 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFFFEFE)
30/11/2011 22:30:45 Enabling NewFBSize protocol extension for client 192.168.1.3
30/11/2011 22:30:45 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x574D5669)
30/11/2011 22:30:45 Enabling full-color cursor updates for client 192.168.1.3
30/11/2011 22:30:45 Enabling X-style cursor updates for client 192.168.1.3
30/11/2011 22:30:45 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFFFEFF)
30/11/2011 22:30:45 Using tight encoding for client 192.168.1.3
30/11/2011 22:30:51 client_set_net: 192.168.1.3  5.0307
30/11/2011 22:30:51 created   xdamage object: 0xe0002c
30/11/2011 22:30:51 copy_tiles: allocating first_line at size 41
30/11/2011 22:30:55 created selwin: 0xe0002d
30/11/2011 22:30:55 called initialize_xfixes()
30/11/2011 22:31:28 client 1 network rate 95.8 KB/sec (2159.8 eff KB/sec)
30/11/2011 22:31:28 client 1 latency:  0.8 ms
30/11/2011 22:31:28 dt1: 0.0300, dt2: 0.1040 dt3: 0.0008 bytes: 12795
30/11/2011 22:31:28 link_rate: LR_BROADBAND - 1 ms, 95 KB/s
30/11/2011 22:32:03 increased wireframe timeouts for slow network connection.
30/11/2011 22:32:03 netrate: 95 KB/sec, latency: 1 ms
30/11/2011 22:45:00 idle keyboard:   turning X autorepeat back on.

3) From another box vnc to this above box.

Connected. Having fun.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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