So you have your linux system at home, and from a remote location (e.g. work) you would like to see what is happening on your home system's screen, or run something at home that needs an X session in order for it to work. For example the latest Ubuntu has just come out and you really want to download the .iso using Transmission during the day so that when you get home you can try it out, without having to start the download then and still wait for it to finish downloading before you can try it out.
For this to work you will need the following in place:
- Home router with port forwarding (need tcp port 22 (ssh) forwarding to your home pc).
- Firewall rules on your home PC must allow incoming/outgoing tcp ports 22 and 5900.
- x11vnc package installed on your home PC. (apt-get install x11vnc)
- PuTTy installed on the local Windows PC.
- TightVNC viewer on the local Windows PC.
- The local PC needs to listen on tcp port 5900 so that the ssh connection can tunnel it's X session traffic through to you.
To setup PuTTY so that it listens locally on tcp port 5900, you need to add a tunnel between the remote system and the local system, as shown in this screenshot:
Now connect to your remote linux system using PuTTy, and with a Command Prompt in Windows confirm that you are listening locally on port 5900, as shown in the screenshot below:
Now in the PuTTy session you must forward all tcp port 5900 traffic from the remote linux system to your local Windows PC as follows:
clive@dogmatix > x11vnc -noxdamage -xkb -geometry 1024x768 -safer -localhost -nopw -once -display :0
14/11/2012 09:52:11 -safer mode:
14/11/2012 09:52:11 vnc_connect=0
14/11/2012 09:52:11 accept_remote_cmds=0
14/11/2012 09:52:11 safe_remote_only=1
14/11/2012 09:52:11 launch_gui=0
14/11/2012 09:52:11 x11vnc version: 0.9.12 lastmod: 2010-09-09 pid: 12521
14/11/2012 09:52:11 Using X display :0
14/11/2012 09:52:11 ------------------ USEFUL INFORMATION ------------------
etc...
etc...
14/11/2012 09:52:11 X display is capable of DPMS.
--------------------------------------------------------
14/11/2012 09:52:11 Default visual ID: 0x21
etc...
etc...
14/11/2012 09:52:11 The X server says there are 10 mouse buttons.
14/11/2012 09:52:11 screen setup finished.
14/11/2012 09:52:11
The VNC desktop is: localhost: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
Note: I have removed a large amount of the output lines from x11vnc command to save space here.
The final step now is to use TightVNC viewer on the local Windows PC to connect to the local tcp port 5900, as shown in the screenshot below:
You should now have a window that shows your remote linux system's desktop where you can run Transmission to get the latest Ubuntu .iso torrent, or run any graphical program on the remote system.
Here are some links for more information and download links for PuTTy and TightVNC (which are freeware products):
https://help.ubuntu.com/community/VNC
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
http://www.tightvnc.com/download.php
Please feel free to leave a comment if this helps you, or if you would like to ask me a question.



No comments:
Post a Comment