Installing VNC Server on Linux

There isn’t a very automatic way to install vnc server on Debian or any linux distro for that matter. This install is specific for Debian based distros but should work for others providing you use the distro specific startup/service config application and package manager.

For debian:

First, install vnc server:

sudo aptitude install x11vnc

This will install all the required packages for VNC

Next we will configure the vnc server
To comply with the current standards, all config files should be stored in ~/.config/{appname}/ so:

mkdir -p ~/.config/vnc
vncpasswd ~/.config/vnc/passwd

Insert your desired VNC password, then verify.
Next create your init script

echo "x11vnc -ncache 10 -nap -bg -many -rfbauth ~/.config/vnc/passwd -desktop "VNC ${USER}@${HOSTNAME}"|grep -Eo "[0-9]{4}">~/.config/vnc/port" > ~/.config/vnc/vnc-server

sudo ln -s ~/.config/vnc/vnc-server /etc/init.d/vnc-server

sudo update-rc.d vnc-server defaults 99

This will create the service and set it to start on system start, and exit on system reboot/shutdown. To manually start or restart the service, do:

sudo /etc/init.d/vnc-server start | restart

You can connect to this server using the many popular vnc clients such as Ultra VNC, Win VNC, Tight VNC, etc.

Leave a Reply

CommentLuv Enabled