notes.dt.in.th

Situation:

  • I have a cloud server running Ubuntu Linux. I want to add a desktop environment to it. I want to be able to use the server as a desktop computer without using Docker.

  • I want to run each component on-demand (e.g. by SSHing and running them inside tmux) without using e.g. systemd.

  • I want to remotely access the desktop environment from my laptop via VNC.

Install a desktop environment

sudo apt install tigervnc-standalone-server xfce4 xfce4-terminal

Create a password file

vncpasswd

Start VNC + X server

Xtigervnc -geometry 1920x1080 -listen tcp -localhost -AlwaysShared -AcceptKeyEvents -AcceptPointerEvents -SendCutText -AcceptCutText -PasswordFile ~/.vnc/passwd :0

Start desktop environment

env DISPLAY=:0 xfce4-session