Service file to start TightVNC or TigerVNC as a service in kali
sudo wget -O /lib/systemd/system/[email protected] https://github.com/Re4son/vncservice/raw/master/[email protected]
sudo systemctl enable [email protected] && sudo systemctl start [email protected]
This service runs vncserver as root. You can change that and other startup parameters by editing /lib/systemd/system/[email protected]
The VNC server restricts connections from the localhost only for security reasons. To connect to the vnc server over the network use an ssh tunnel: Assuming your vnc server runs on 192.168.137.137, type this on your remote client:
ssh -L 5902:localhost:5901 [email protected]
vncviewer 127.0.0.1::5902
Since you are ssh'ing into your remote machine, you might as well just type "vncserver" and be done instead of running it as a service.
Xstartup file to allow multiple simultanious xfce sessions (fix for "xfce4-session: Another session manager is already running" error)
wget -O ~/.vnc/xstartup https://github.com/Re4son/vncservice/raw/master/xstartup
chmod 755 ~/.vnc/xstartup