Install xfce4 and tightvncserver

1.Install xfce4 using below command

sudo apt update;sudo apt install xfce4

2.Select a desktop manager ,here we chose ligthtdm

2.Install tight vnc server

sudo apt install tightvncserver

Setup vnc server

1.Create a test vnc session for password setup and xstartup file creation

  1. kill the session created in step one because we need to modify xstartup file
vncserver -kill :1
  1. Modify .vnc/xstartup from your home directory to let vnc use xfce4
j@j:~/.vnc$ cat xstartup
xrdb $HOME/.Xresources
xsetroot -solid grey
startxfce4 &

4.Create a new vnc session using below command


Or add option -geometry if you need bigger window

vncserver -geometry 1920x1080

Connect to vnc server from client

1.Here we are using windows 10 , download and install a Vnc viewer like

2.Connect to you vnc server via hostname:port or IpAddress:port


Use Gnome as Desktop Environment

If you want to use gnome instead of xfce , you can try below steps

1.install ubuntu deskop if you are using ubuntu 20.04 server which doesn’t get gnome installed

sudo apt update
sudo apt install tasksel
sudo tasksel

install ubuntu desktop or ubuntu minimal desktop base on your need

2.install tightvncserver

sudo apt install tightvncserver

3.Install gnome-session-flashback

sudo apt install gnome-session-flashback

4.Make your xstartup file like below

 autocutsel -fork
 xrdb $HOME/.Xresources
 xsetroot -solid grey
 export XDG_CURRENT_DESKTOP="GNOME-Flashback:Unity"
 export XDG_MENU_PREFIX="gnome-flashback-"
 gnome-session --session=gnome-flashback-metacity --disable-acceleration-check --debug &