Install vncserver

vncserver will open a new X session to be accessed with a VNC client software only. After having made some tests I decided to replace it with x11vnc, which accesses the real X session currently running. Since the installation of vncserver took me some time, I will leave the hints in my Wiki.

Install server script

apt-get install vncserver

Settings for vncserver

changes to vnc.conf. Notice that I mainly just uncommented a few things and wrote some lines following his examples of things that seem like they should be in there, such as the authority file, etc. The main change I made was doing: $vncStartup = “$ENV{HOME}/.vnc/xstartup”; instead of: $vncStartup = /etc/X11/Xsession“;

# User configuration
# ------------------
#
# This section contains entries that may change from user to user.

# $vncUserDir contains the filename for the log files directory of Xvnc
#             (the server) and the viewers that are connected to it.
# $vncUserDir = "$ENV{HOME}/.vnc";

# $vncPasswdFile contains the filename of the password file for Xvnc.
# $vncPasswdFile = $vncUserDir . "/passwd";

# $vncStartup points to a script that will be started at the very beginning.
# $vncStartup = "/etc/X11/Xsession";
$vncStartup = "$ENV{HOME}/.vnc/xstartup";

# $xauthorityFile should be the path to the authority file that should be used
#                 by your vnc X server.
$xauthorityFile = "$ENV{HOME}/.Xauthority";

# $defaultDesktopName should be set to the default name of the desktop.
#                     This can be changed at the command line with -name.
# $defaultDesktopName = "X";

# $geometry sets framebuffer width & height. Default will be calculated if
#           server is started from within a running X servers. Can be changed at
#           the commandline (-geometry). A fixed default will be used if
#           vncserver is not invoked in a running X session.
# Example:  $geometry ="640x480";
$geometry = "1024x768";

# $depth       sets the framebuffer color depth. Must be between 8 and 32.
# $pixelformat sets the default pixelformat.
#              The default will be calculated if none of both is specified
#              and when vncserver is called from within a running X servers.
#              Can be changed at the command line with option -depth.
#              A fixed default value will be used if vncserver is not
#              invoked in a running X session.
# Example:  $depth = "16";
#           $pixelformat = "rgb565";
#depth = "16";
$pixelformat = "rgb656";

xstartup file looks like this:

#!/bin/sh
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

change execute permissions:

chmod a+x /etc/X11/xinit/xinitrc
cmmod a+x /home/bco/.vnc/xstartup

X display settings

After having started the vncserver for the first time, any X apps won't start anymore from KDE desktop or from the terminal windows. To resolve this, add username to the X server access list:

xhost +local:username

This allows “username” to connect to the local running X server.