I have installed tightvncserver on my ubuntu ec2 server and I am able to get the remote desktop access but when I restart my server and connect to the ec2 remote desktop then I am not able to open the terminal.
I have installed the tightvncserver with help of this digitalocean's article https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-20-04
My xstartup looks like this
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
It appears that you are running this script via the User Data field on the Amazon EC2 instance.
User data scripts only run on first boot. They do not run on subsequent boots.
You can either:
/var/lib/cloud/scripts/per-boot/
-- it will automatically run on every boot