VNC remote desktop
mouse 200 · person cloud · link
Last update
2018-12-04
2018
12-04
« — »

Install TigerVNC server (a fork of TightVNC 4 optimized for 3D and video):

1
2
3
4
5
6
7
8
9
10
11
12
apt install tigervnc-standalone-server tigervnc-viewer tigervnc-xorg-extension

# sets a password for current user
tigervncpasswd

# choose your window manager
echo '#!/bin/bash -l' >  .vnc/xstartup
echo 'startxfce4'     >> .vnc/xstartup

# launch server (detached from an eventual login manager)
env -u SESSION_MANAGER -u DBUS_SESSION_BUS_ADDRESS \
  nohup tigervncserver :10 -geometry 1920x1080

Connect to it via the standard viewer:

1
2
xtigervncviewer localhost:10     # choose either display #10
xtigervncviewer localhost::5910  # or the port 5910

or better use Remmina client because it has many useful features:

  • full keyboard grab with escape key
  • scaling (very useful on HiDPI/retina screens)
  • remote resize (only on TigerVNC servers)
  • zoom
  • toggle fullscreen/windowed mode
  • servers/connection list
  • screenshooter

and the latest packaged version is available for stable debian and raspbian.

You can also share your main display :0 via the efficient tigervnc-xorg-extension, put this in /etc/X11/xorg.conf.d/vnc.conf or merge it in your /etc/X11/xorg.conf:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Section "Module"
  Load "vnc"
EndSection

Section "Screen"
  Identifier "my_monitor"

  # use this in a secure environment...
  Option "SecurityTypes"       "None"
  # ...or these if you need authentication
  #Option "SecurityTypes"      "VncAuth"
  #Option "UserPasswdVerifier" "VncAuth"
  #Option "PasswordFile" "/root/.vnc/passwd"
EndSection

Source: xorg vnc module howto, where to put xorg config files