Installing a VNC server on Linux (Ubuntu Mate)

Print Friendly, PDF & Email

For my Odroid U3 I wanted a default startup into a console login session to have the maximum amount of resources available but I also wanted a VNC Server configured so that I can start (and stop) a graphical session whenever I want.

As usual, the first thing to do (not strictly necessary but it’s always a good idea) is to update the packages to the most recent versions:

sudo apt-get update & sudo apt-get upgrade

we’ll then install the tightvnc server:

sudo apt-get install tightvnc

once installed we can run vncserver to setup a password:

vncserver

this will optionally let us also add a “view-only” password (sessions in which the VNC Client cannot interact with mouse or keyboard).
Now, before we go on, we have to kill the running server instance:

vncserver -kill :1

and we can proceed configuring the server; the configuration files are in the user sub-directory .vnc: we can backup the xstartup file (into something like xstartup.bak) and we can edit it with our preferred editor:

jed ~/.vnc/xstartup

the configuration of this file is generally not too complex, I have had some problem in running the window manager but in this end this version was the right one for me:

#!/bin/sh
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
mate-session &

and just to be sure, we’ll make it executable

sudo chmod +x ~/.vnc/xstartup

if we run the vncserver we’ll see something like this:

 

opening a VNC Client on our <your_IP_or_address>:1 we’ll see something like this:

 

6 thoughts to “Installing a VNC server on Linux (Ubuntu Mate)”

    1. Probably X started (the grey screen is the typical X background…) but no Window Manager was launched – try playing with the VNC config file and be sure to start the Desktop environment; in the sample above “mate-session” launches the DM but depending on your deployment you could need to start a different DM.

  1. I’m not able to install tightvnc. This package is still available?

    pi@pi-desktop:~$ sudo apt-get install tightvnc
    A ler as listas de pacotes… Pronto
    A construir árvore de dependências
    A ler a informação de estado… Pronto
    E: Não foi possível encontrar o pacote tightvnc <— Was not possible to finf the package tightvnc

Leave a Reply

Your email address will not be published. Required fields are marked *