GUI instance on Google Cloud Platform(GCP) & AWS

Published by Abhay Rastogi on

Are you looking for making cloud instance GUL friendly as CMD is much complex to work with? GUI instance make cloud computing ease to work with. It makes our job fast and easy in deploying your services on the cloud.

Create a new firewall rule: Navigate firewall rules of Network services. give it a tag name vnc-server and assign internet IP with TCP:5901

Assign a static IP to the instance

Assign firewall tag in instance networks tag

Connect with cloud instance and then update the source list

$ sudo apt-get update

tightvncserver : Tightvncserver allows to connect with instance remotely.

$ sudo apt-get install tightvncserver

Install tasksel for installing ubuntu GUI skins

$ sudo apt install tasksel

$ sudo tasksel install ubuntu-mate-core

Start vncserver

$ vncserver

After starting vncserver it will create .vnc/xstartup which we have to edit before connecting with the instance remotely

Stop the server and edit the .vnc/xstartup file

$vncserver -kill :1

Open and edit .vnc/xstartup

$nano .vnc/xstartup


xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
#export xkl_XMODMAP_DISABLE=1
# fix to make xfce work:i
startxfce4 &
exec /etc/X11/xinit/xinitrc
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

press control x then press y to modify the changes

Change the permission of the file

$chmod +x ~/.vnc/xstartup

Start the server again


Download vnserver viewer in Mac or Pc ( then connect it with instance static IP with port no 5901


Leave a Reply

Avatar placeholder

Your email address will not be published.