Saturday, March 28, 2026

Multiple VNC Users on a debian / ubuntu

Problem: My kids want to VNC into a VM and use it.

Solution: 

apt update && apt install tigervnc-standalone-server xfce4 xfce4-goodies

adduser kid1

su - kid1

You should now be in the kid1 user.

==== KID1 ====

vncpasswd

nano ~/.vnc/xstartup

==== CODE ====

#!/bin/sh

unset SESSION_MANAGER

unset DBUS_SESSION_BUS_ADDRESS

exec startxfce4

==== CODE ====

chmod +x ~/.vnc/xstartup

exit

==== KID1 ====

On the server, 

nano /etc/tigervnc/vncserver.users 

==== CODE ====

:3=kid1 #This means port 5900 + 3 = kid1 screen

==== CODE ====

systemctl daemon-reload

systemctl enable tigervncserver@:3.service

systemctl start tigervncserver@:3.service


Might need UFW allow

ufw allow 5901:5905/tcp


Default is listen to 127.0.0.1

To listen to 0.0.0.0

vim /etc/tigervnc/vncserver-config-defaults 

enable > $localhost="no"

No comments: