From charlesreid1

(Created page with "x11vnc is a virtual network client that allows you to log into a computer and see the desktop screen from a remote location (remote dekstop). This requires running x11vnc as a s...")
 
 
(8 intermediate revisions by the same user not shown)
Line 19: Line 19:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
#!/bin/sh
#!/bin/sh
#
# run configure
# make
# make install


./configure \
./configure \
  --prefix=/path/to/x11vnc \
  --prefix=/path/to/x11vnc \
  --with-jpeg=/sw
  --without-x
</syntaxhighlight>
</syntaxhighlight>


Then run make and make install.
Then run make and make install.


Once the installation is done, add the bin/ directory to your $PATH variable, and open a new shell.  Typing "which x11vnc" should print <code>/path/to/x11vnc/bin/x11vnc</code>.
And then add to your $PATH.


== Starting ==
== Starting ==
Line 45: Line 41:
</syntaxhighlight>
</syntaxhighlight>


== Tunneling ==
== Starting: Redux ==


This is where things get a little more tricky.  Since remote desktop shares such valuable information, it is important to take necessary security mesures.  One such measure is tunneling the remote desktop connection through an [SSH]] tunnel, encrypting all remote desktop traffic.  This can be done as described on the [SSH]] page, using the command (run from the client computer):
First, set your password by running


<syntaxhighlight lang="bash">
<pre>
ssh -f -N -L 5900:localhost:5900 server_username@server.com
x11vnc -storepasswd
</syntaxhighlight>
</pre>
 
Then set a VNC password. Start up x11vnc and tell it to use this stored password:
 
<pre>
x11vnc -rfbauth ~/.vnc/passwd
</pre>
 
note that <code>~/.vnc/passwd</code> is the default location of the stored password file.
 
You can also put these two arguments into your .x11vncrc file, which is read on startup.


One of the problems with tunneling the connection through an SSH tunnel is that it's very slow.  The reason for this is, SSH is encrypting all outgoing traffic and decrypting all incoming traffic - a time-consuming and slow process.  This makes the response time and graphics quality of remote desktop windows very poor.
== Tunneling Via SSH ==


[[SSH]] can be tweaked, however, to use a faster (albeit less secure) cipher called Arcfour (see [[wikipedia:RC4]] for details).  This is done by using the <code>-c</code> flag for the SSH command:
See also [[SSH#SSH Tunnels|SSH Tunnels]]


<syntaxhighlight lang="bash">
To tunnel a VNC connection through SSH, you'll want to make an ssh tunnel from local port 5900 to remote port 5901 (or whatever remote port VNC is listening on).
ssh -c arcfour -f -N -L 5900:localhost:5900 server_username@server.com
</syntaxhighlight>


If you run the command <code>man ssh</code> you can see all of the different options you have for the -c flag.  Arcfour is almost assured to be the fastest, unless your machine is unusual.


== Connecting with Chicken of the VNC ==


Once you've started x11vnc on the remote computer and created an SSH tunnel to your local machine's port 5900 (or whatever port you want your VNC to listen on), you can run Chicken of the VNC to connect the VNC to your local machine's port 5900.  Do this by connecting Chicken of the VNC to the host <code>localhost:5900</code> (once you type the <code>:5900</code>, the port box will be greyed out and will not be used). If you specify the host as <code>localhost</code> and then specify port 5900 in the "port" box, it won't work.


Your VNC server settings should look like this:


[[Image:ChickenOfTheVNC.png|400px]]








[[Category:Computers]]
{{Programs}}
[[Category:Programs]]

Latest revision as of 01:28, 17 December 2011

x11vnc is a virtual network client that allows you to log into a computer and see the desktop screen from a remote location (remote dekstop). This requires running x11vnc as a server on the server computer, then connecting to the x11vnc server using a host with a remote desktop client (I use Chicken of the VNC).

Installing

Prerequisites

Mac

To install x11vnc on a Mac, you will need a jpeg library, which I was able to download from Fink.

Linux

You can use a package management software like aptitude or yum to install x11vnc. This should resolve dependencies.

Configuring

For the Mac, my configure line looked like:

#!/bin/sh

./configure \
 --prefix=/path/to/x11vnc \
 --without-x

Then run make and make install.

And then add to your $PATH.

Starting

When you first run x11vnc, you will see a bunch of loud warnings about not setting a password. Follow the instructions given to set a password. This is a password used to access your desktop - without it, anyone who connects to your server can control the screen.

Once you have set your password, create a script for starting x11vnc. Mine looks like this:

#!/bin/sh

sudo x11vnc -usepw -display :0 -ncache 10 -forever

Starting: Redux

First, set your password by running

x11vnc -storepasswd 

Then set a VNC password. Start up x11vnc and tell it to use this stored password:

x11vnc -rfbauth ~/.vnc/passwd

note that ~/.vnc/passwd is the default location of the stored password file.

You can also put these two arguments into your .x11vncrc file, which is read on startup.

Tunneling Via SSH

See also SSH Tunnels

To tunnel a VNC connection through SSH, you'll want to make an ssh tunnel from local port 5900 to remote port 5901 (or whatever remote port VNC is listening on).


Connecting with Chicken of the VNC

Once you've started x11vnc on the remote computer and created an SSH tunnel to your local machine's port 5900 (or whatever port you want your VNC to listen on), you can run Chicken of the VNC to connect the VNC to your local machine's port 5900. Do this by connecting Chicken of the VNC to the host localhost:5900 (once you type the :5900, the port box will be greyed out and will not be used). If you specify the host as localhost and then specify port 5900 in the "port" box, it won't work.

Your VNC server settings should look like this:

ChickenOfTheVNC.png