---SERVER SETUP---
For the VNC server we will be using X11VNC simply because it is the easiest to setup for forwarding an existing X session.
NOTE: Make sure you are logged as the person who will be needing assistance.
To install open a terminal (Applications -> Accessories -> Terminal) and copy+paste/type:
Code:
sudo apt-get install -y x11vnc vnc4server
and enter your password (for sudo). This will install the X11VNC and VNC4server packages. VNC4server is needed because X11VNC does not provide a vncpasswd utility which is needed to secure the system. Now we start securing the system.
Code:
mkdir -p ~/.vnc
vncpasswd ~/.vnc/passwd
Note, the vncpasswd password must be less than or equal to 8 characters in length.
This will prompt you for a password and then store an encrypted form of it in ~/.vnc/passwd (if you want to see the encrypted form: cat ~/.vnc/passwd).
We have installed the VNC server and ran the basic setup. The next step is to create a launcher for X11VNC that will:
1) Stop any currently running sessions.
2) Tell you what port X11VNC is running on,
3) Tell you what the Public IP Address of that computer is.
To do this, in the terminal type (Actually, read on past this group of commands and come back so that you know what this does):
Code:
mkdir ~/.tech
cd ~/.tech
cat > vnc-launcher << _EOF
What we are doing is:
With the first command creating a folder that is hidden (hence the . before the word tech).
The second command moves into the hidden tech directory.
But the third command is a bit harder to explain. Cat is a utility to view plaintext documents. But with advanced re-direction, we can turn it into something that will take what ever you type/paste and save it in the file. Paste the following bit of code into the terminal (it should give you a > as a prompt). Then press the enter key once (to give us a new line), and then type '_EOF' without the quotes.
Code:
#!/bin/bash
## A help script to start X11 for remote assistance.
## Copyright (C) 2010 Cipherboy_LOC (of the Ubuntu Forums).
## Licensed under the GNU General Public License version 3.
## Kill all other instances of the X11VNC server to ensure that you will always get port 5900.
pkill x11vnc
## Start the server and print out the display that the server is on...
x11vnc -nap -bg -many -rfbauth ~/.vnc/passwd -desktop "VNC ${USER}@${HOSTNAME}" -ncache 2>&1 | grep -i 'PORT='
## Tell the user to give the Public IP Address to the person who will be helping them.
echo -e 'Please give this number to the tech guy:'
## Print out the number:
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"
## Pause before exiting.
sleep 50
The next thing to do is to (from the terminal) give the hidden tech folder better permissions (to prevent others from running this bit of code (could be a security threat).
Code:
chmod 754 ~/.tech/ -R
chmod +x ~/.tech/vnc-launch
The last thing left to do is to create a desktop icon. Remember that use of cat as a one time editor? Lets do that again:
Code:
cat > ~/Desktop/vnclauncher.desktop << _EOF
Paste the following block of code into the prompt (again > should be the prompt), then hit the enter key once, and then type '_EOF' again without the quotes.
Code:
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Tech Support
Comment=Allow your Tech Support guy to remotely help you.
TryExec=gnome-terminal
Exec=gnome-terminal -e "bash /home/*/.tech/vnc-launch"
Icon=utilities-terminal
Type=Application
OnlyShowIn=GNOME;
When clicked, GNOME-Terminal will open and print something like the following:
PORT=5900
Please give this number to the tech guy:
xxx.xxx.xxx.xxx
The only thing that is left for you to do is forward the 5900 port from the router, but that is not something that I can walk you through (due to the differences in routers).
---CLIENT SETUP---
The client setup is simple now that the server is set up. You need to install a VNC viewer:
Code:
sudo apt-get install vinagre -y
will install the default GNOME VNC viewer.
---HOWTO CONNECT THE TWO COMPUTERS---
When the person with the VNC server needs help, get them to click on the desktop icon and tell you the "magic number" (their Public IP Address). Start vinagre (Applications -> Internet -> Remote Desktop Viewer), and click the connect button. In the box that comes up, it should look something like the following, except with their PublIc IP Address instead of 'X's:
2010-12-26-100605_1280x800_scrot.png
If you have any questions, please post them here or in another thread,
Cipherboy