VNC for remote desktop access if you are running on a remote machine. Install the required packages for VNC and XFCE desktop environment:
sudo apt install -y xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils
sudo apt install -y tigervnc-standalone-server tigervnc-commonCreate the ~/.vnc/xstartup file and add the following content, and chmod +x ~/.vnc/xstartup to make it executable:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4Or if you prefer to use Gnome desktop, create the ~/.vnc/xstartup file with the following content:
#!/bin/sh
# Start Gnome Desktop
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
source /etc/profile.d/apps-bin-path.sh
source /etc/profile.d/xdg_dirs_desktop_session.sh
export GNOME_SHELL_SESSION_MODE=ubuntu
XAUTHORITY=$HOME/.Xauthority
export XAUTHORITY
/usr/bin/gnome-session
x-window-manager# start the VNC server, default port is 5901
vncserver
# kill the VNC server
vncserver -kill :1Use a VNC client to connect to the remote machine. The default port is 5901, so you can connect to machine_ip:5901,
change the port number if you have started the VNC server on a different port (e.g., 5902 for :2). If you have set a password for VNC, you will be prompted to enter it. As a security measure, it is recommended to use SSH tunneling to connect to the VNC server. You can do this by running the following command on your local machine:
ssh -L 5901:localhost:5901 your_remote_ip_or_hostnameThen, open your VNC client and connect to localhost:5901.
Recommanded VNC clients include: