All command is run on root user,if you run another user,please add sudo before the command.
Part1:

apt update
apt upgrade -y
apt-get install unzip -y
apt-get install bzip2 -y
apt-get install vnc4server -y
apt-get install perl
vncserver #Enter your VNC password for yourself and repeat once

Part2:

cat <<- EOF >> ~/.vnc/xstartup
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
EOF

Part3:

#setup 123.perl file for autorun VNC, please set #### for yourself vnc port:

vi 123.perl
i
#! /usr/bin/perl
while(1)

{
$ck=`ps -ef | grep ‘Xvnc4’ | grep -v grep | wc -l`;
if ($ck == 0){
print “SASL Down, Start up now\n”;
`killall Xvnc4`;
`/usr/bin/vncserver -geometry 1024×768 -rfbport ####`;

}else{
print “SASL Running\n”;
}

sleep(60);

}

Part4:

#Add 123.perl autorun:

vi /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0” on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
su root -c “nohup /usr/bin/perl ~/123.perl 1>/root/123.log 2>&1 &”
exit 0

Part5:
#Install Gnome Desktop for system
apt-get install –no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y

Part6:
reboot

Part 7:
Download the VNC viewer client setup and enter your ip:prot,and then enter your password.

Done. Have a enjoy!