Install Ubuntu Desktop and VNC Server On Ubuntu Server


When i was a mobile user i always wanted a personal computer where i can do anything want but i can't afford a PC. I think you may know about Google Cloud Platform's(GCP) $300 dollar free trial for new user. Yes this offer changed me to think about Ubuntu and Linux. At first i used Google Cloud Platform to use windows through RDP but its costly(costs me around $70/month on GCP) because of windows license so started my research on Ubuntu(Costs me around $25/ month on GCP) to setup and use Ubuntu like windows on my phone. Then i found out a bunch of command which can be used to make a Ubuntu desktop on Ubuntu server. Here i will tell you about all command to Install Ubuntu desktop and VNC Server step by step.

Step-1(Create a Ubuntu Server):

(Our Test Ubuntu Server On MicroHost)
In this step you just have to create an Ubuntu server on any provider you choose. Here i suggest to Install Ubuntu 14.04 and above for this. Here i am using microhost.com to Setup our Test server. so do create your own server with any provider.

Step-2(Connect Your Server To Your SSH Client)

(Our server Connected to Termius SSH Client)
After 1st step you must have your server ip, username and password. So just Connect to any SSH client through this info. I suggest to use Termius.

Step-3(Install and Configure Components):

For this i have two types of method
  1. Automatically
  2. Manually
1. Automatically(Recommended):

I always use Ubuntu Desktop On Ubuntu server many times i need delete when i don't needed and need to install when i needed so i Developed a Script which will help you to Setup Everything Automatically.

In this method you don't have to anything it will automatically Install and Configure all component you just have to provide a password for VNC server when it asks.

Please Visit For Source of Script: GitHub

So lets Start Just Use Following Commands
wget https://raw.githubusercontent.com/sspradhan25/Install-Ubuntu-desktop-on-ununtu-server/master/OS/ubuntu
Now Run the Script by using following Commands
sh ubuntu
Note: It will ask for password after 22-25min as per Server Speed

Installation Done i will provide important information at last about how to start, stop and access

1. Manually:

In this method you have to run each command by yourself
so lets Start

* update your system
sudo apt-get update -y
* Install Components
 sudo apt-get install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y
Note: It will take Minimun 20min
* Install VNC Server
sudo apt-get install vnc4server -y
* Start VNC Server
vncserver
Note: Here system will ask you to set password
* Stop VNC Server
 vncserver -kill :1
* Edit /.vnc/xstartup file
Just have to Run Some commands to add some lines to this file

Run these commands one by one(Recomendend)
echo "gnome-panel &">>~/.vnc/xstartup
echo "gnome-settings-daemon &">>~/.vnc/xstartup
echo "metacity &">>~/.vnc/xstartup
echo "nautilus &">>~/.vnc/xstartup
 Done

Now all Types of Installation Done

Note: Everything is done Now i suggest to Restart your Server for Once for better performance.

Extra Information After Installation (How to Use):

Everything is ready Now

To Start VNC Server
vncserver
if you run it for 1st time after restart then
your access ip will be :  yourip:1
Password: Password system asked for while installtion

if you run it for 2st time after restart then
your access ip will be :  yourip:2
Password: Password system asked for while installtion

if you run it for 3st time after restart then
your access ip will be :  yourip:3
Password: Password system asked for while installtion

and so on
Note: Always reset access ip every time you reboot your server.


I hope it will be helpful for you 

For any Problem Comment Below I will help you to Understand

If you liked it just like and comment and Subscribe for Newsletter for new posts and helpful tutorials.

Thank you

*

Post a Comment (0)
Previous Post Next Post