<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc=" http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>briancarper.net (λ) (Tag: VNC)</title><link>http://briancarper.net/tag/53/vnc</link><description>Some guy's blog about programming and Linux and cows.</description><item><title>SSH Tunneling VNC</title><link>http://briancarper.net/blog/ssh-tunneling-vnc</link><guid>http://briancarper.net/blog/ssh-tunneling-vnc</guid><pubDate>Tue, 14 Mar 2006 12:50:48 -0800</pubDate><description>&lt;p&gt;Just so I don't forget this: How to SSH-tunnel VNC.  It took me forever to figure out.  (This will work with any service, not just VNC.)&lt;/p&gt;

&lt;p&gt;Home: 2 computers, both behind a firewall.  Linux = 192.168.15.15, OS X = 192.168.15.16.
The Linux computer is running sshd (but you can only SSH to the Linux box via the LAN, i.e. it's behind the firewall).  The OS X computer is running sshd too; port 22 is the only port open on the firewall, and it's forwarded to the OS X machine only.
Remote: 1 computer, Windows.  Can't run any services, but can run TightVNC viewer.
Goal: Run VNC on the home Linux computer and use TightVNC at the remote site to view it.&lt;/p&gt;

&lt;p&gt;Here's how I did it.  First SSH to my home IP using PuTTY on the remote computer, which takes me to the OS X machine.  SSH from there to the Linux box.  Run VNC on the Linux computer:&lt;/p&gt;

&lt;pre&gt;x11vnc -display :0&lt;/pre&gt;

&lt;p&gt;This shares an already-running X session.  To run an independent session I could've run&lt;/p&gt;

&lt;pre&gt;vncserver :1&lt;/pre&gt;

&lt;p&gt;Leave that running.  Now, I SSH again in a separate session to my home IP.  In the Tunnels section, put Source port 5900 (or 5901, whatever port VNC is using on the Linux machine).  For Destination put 192.168.15.15:5900 (or 5901).  Open the connection and login.&lt;/p&gt;

&lt;p&gt;Now on the remote machine, run TightVNC and connect to 127.0.0.1::5900 (or 5901).  That's it!  Now I see my Linux desktop on the remote machine.  The whole &quot;local&quot; vs. &quot;remote&quot; distinction for SSH tunnels is a bit confusing, especially when you're bouncing around to a bunch of different computers.&lt;/p&gt;</description></item></channel></rss>

