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 0.0.0.0/0 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

#!/bin/sh

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
#/etc/X11/Xsession
# fix to make xfce work:i
startxfce4 &
unset SESSION_MANAGER
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

$vncserver

Download vnserver viewer in Mac or Pc (https://www.realvnc.com/en/connect/download/vnc/) then connect it with instance static IP with port no 5901


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.