15 February, 2016

How to install Ubuntu on VPS and access remotely

First of all I am going to show you how to install Ubuntu OS on VPS and run XFCE Desktop Environment on it.

Let's start with Control Panel. I currently have this VPS.

[Image: Xn2W5l.jpg]

To access the Console press the Serial Console button. After enabling java you will get something like this.

[Image: w73pgl.jpg]



So just paste the root password and press OK.
So now you are in the server's console and you can type in it these commands. You can type commands with or without sudo since you are logged in as root but I will type it like this. Each time you are prompted with question to type Y for yes or N for no type Y of course.

Code:
sudo apt-get update

Code:
sudo apt-get upgrade

Code:
sudo apt-get install xfce4

With this we have installed XFCE Desktop Environment.

For GNOME installation the code is:

Code:
sudo apt-get install ubuntu-desktop

And for KDE the code is:

Code:
sudo apt-get install kubuntu-desktop

But in order to connect the server remotely we need VNC server installed so just type this command (there is no need to download anything):

Code:
sudo apt-get install vnc4server

And follow the instructions.

The next step is to create new user and give it sudo rights. We will name it normaluser and give it password (something easy to remember). I did it like this but there could be different ways of doing it.

Code:
adduser normaluser

When prompted for password type in password.

Code:
sudo adduser normaluser sudo

And with this normaluser has sudo rights.

Next step is to download program called Putty and put it on your Desktop of Windows computer. You will find it here .
Next step is to open Putty, paste the server's IP, make sure SSH is marked and click Open. It looks like this.

[Image: 4putty.jpg]

Now using putty we have a console from which we can change settings on our VPS. I am not sure about this (since I didn't check it 100%) but it seams that you can't connect as root on Ubuntu/Debian using Putty. So that is the main reason why I created new user and added it sudo rights.

So when Putty prompts for user you will type normaluser and enter correct password for normaluser (not root)
Now here comes the tricky part (just a little bit tricky) . In order to access remotely VPS and get proper Desktop Environment we have to do this. First open Putty again (if you closed it open again and log in as normaluser) and type this command.

Code:
vi /home/normaluser/.vnc/xstartup

This will open text editor vi and open the file xstartup. Then press the Insert key on your Keyboard and you are ready to edit the file. Hold down Delete key on Keyboard until you delete everything.
The next step is to copy this code, then open Putty again and right click on the top left corner. With that you will paste the code inside the xstartup file using Putty. This is the code you need to copy and paste.

Code:
#!/bin/sh

# Uncomment the following two lines for normal desktop:

# unset SESSION_MANAGER

# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

vncconfig -iconic &

xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &

startxfce4 &

# twm &

For GNOME xstartup you paste:
Code:
#!/bin/sh

# Uncomment the following two lines for normal desktop:

# unset SESSION_MANAGER

# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

vncconfig -iconic &

xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &

startx

And for KDE the xstartup file looks like :
Code:
#!/bin/sh

# Uncomment the following two lines for normal desktop:

# unset SESSION_MANAGER

# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

xsetroot -solid grey

vncconfig -iconic &

xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &

startkde

Since I couldn't run GNOME or KDE on my VPS I will not post Screen Shots of it running. But when I tried to connect remotely I did get message that there is not enough hardware to run GNOME and proper Close button on my VNC screen. I think that means it works.

After that you should press Esc key on Keyboard and if you did everything properly it looks like this.

[Image: LUfCpl.jpg]

To save the file type this in Putty and hit Enter.

Code:
:x

OK, so we are almost there. Next step is to run vncserver with this command.

Code:
vncserver :3000

And server is up and running on VPS. Next step is to connect it remotely via TightVNC. You can download it from here . Just install the .exe file and run TightVNC Viewer.
When you run the viewer it looks like this.

[Image: 9FbnCl.jpg]

The important part is to put server's address in this form XX:XX:XX:XX:8900 so it will connect using port 8900.
If we had typed this command

Code:
vncserver :1

Then the port would be 5901. What ever you type instead of number 1 the port will be changed into 5900 + that number . In my case I typed 3000 and the port is 8900 (5900+3000).

So when you hit Connect the Screen opens and it looks like this.

[Image: NGCvcl.jpg]

So we have classic Linux Terminal and we are almost there. Just type this command in the terminal.

Code:
startxfce4

And it will start so you will get this picture.

[Image: VXoZGl.jpg]

Weather you want to hit Close or click on Next it's up to you but once everything is finished XFCE looks like this.

[Image: jcUZul.jpg]


So there you have it. XFCE on your VPS. For Debian I think the procedure is almost the same and for Centos there are some command line differences (apt-get becomes yum) . I will see about setting up GNOME and KDE some time later and make a tutorial about that too.

Edit: I've added GNOME and KDE.

This is how the GNOME session looks like. Even on VPS such as VPS3 it was possible to run it.

[Image: oK7Uhl.jpg]

Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home