Ubuntu install desktop and xfce
Use tasksel install desktop environment and xfce, if the server don’t have tasksel, you should install it.
apt install taskseltaskselandrebootIf tasksel not include xfce, please use below command install xfce which contains a few enhancements for the desktop environment:
sudo apt install xfce4 xfce4-goodiesAdd user to connect to server with VNC
adduser wwwAdd user to the sudo group
usermod -aG sudo wwwchange to the new user www, install VNC server
sudo apt install tightvncserverrun the
vncservercommand to set a VNC access password, create the initial configuration files, and start a VNC server instance:vncserverYou can use vncpasswd to change password
vncpasswdConfiguring the VNC Server
vncserver -kill :1Before you modify the
xstartupfile, back up the originalmv ~/.vnc/xstartup ~/.vnc/xstartup.bakThen
sudo vim ~/.vnc/xstartup1 2 3
#!/bin/bash xrdb $HOME/.Xresources startxfce4 &
chmod +x ~/.vnc/xstartupI have been stuck for this step for a long time, If you use root installation, starting the vncserver service requires using a user, such as ‘www’.
sudo -u www vncserver -localhost-localhost means VNC to only allow connections localhost.
start a ssh tunnel in you local,
ssh -L 59000:localhost:5901 -C -N -l www your_server_ipthen use VNC client connect to the server.