Setting up GUI on DigitalOcean Ubuntu OS
DigitalOcean offers affordable VPS for teams to collaborate anywhere in the world. It’s very easy to set up Linux servers on the platform.
I will document down the process to add a GUI according to this link
- SSH into VPS
ssh root@<ip address>
- Install Xfce and TightVNC
sudo apt-get update sudo apt install xfce4 xfce4-goodies tightvncserver
- Initial configurations VNCserver by setting passwords
vncserver
- Default port for VNCserver is 5901. In order to reconfigure VNCserver, we need to kill instance of VNCserver first. :1 represents port 5900+1
vncserver -kill :1
- Backup config file
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
- Modify config file. Tell VNCserver to read from resources files and start
#!/bin/bash xrdb $HOME/.Xresources startxfce4 &
- Grant executable privileges
sudo chmod +x ~/.vnc/xstartup
- Restart VNC server
vncserver
- Forward to localhost of VNC client on local machine
ssh -L 5901:127.0.0.1:5901 -N -f -l username server_ip_address
- Login using credentials
- Viola!
In case port is binded, run the following to check the pid and kill the process
lsof -i :<port number>
kill -9 <PID>
That’s all.
Leave a comment