Debian 9+ - VNC server with MATE Desktop


Install

Install it:
sudo bash
apt-get install vnc4server

Set password:
vncpasswd


Startup file for desktop


Edit ~/.vnc/xstartup so it looks like this:

# unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
# exec /etc/X11/xinit/xinitrc

[ -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 &

Note the commented out line about terminal emulator, this is otherwise pops up a terminal window on login, also node the addition of x-window-manager, without it you get errors about Xrandr it seems.


Create start and stop files

Create startvnc and put it somewhere in your path (like /usr/bin), fill it with:

#!/bin/bash
vncserver -geometry 1920x1080 -depth 24 -localhost no

Note the need for localhost no. Without this will the server ONLY accept local connections and not even tell ANYTHING in the logs about denying logins. You only get errors about cannot connect to server (connection refused).

Then create /usr/bin/stopvnc and put it somewhere in your path (like /usr/bin), fill it with:

#!/bin/bash
vncserver -kill :1

This is a personal note. Last updated: 2019-06-21 00:27:04.



GitHub

My

GitLab

My

LinkedIn

My

Klebe.se

Don't forget to pay my friend a visit too. Joakim