This might be helpful to a few out there. When I first got into dedicated servers, I had trouble getting vnc4server to work my self. Even with all the tutorials out there, I found they were basically for people who know Linux and Terminal. So I thought I would redo the tutorials I found and add all needed commands and steps, for dedicated servers/seedbox noobs...
NOW WITH UBUNTU YOU DNT GET ROOT YOU GET SUPERUSER, UNTIL YOU CREATE ROOT WITH
THEN ENTER PASSWORD ""WHICH YOU NOW CREATE FOR ROOT"" LATER TO ACCESS ROOT JUST USE "SU" TO ACCESS ROOT.
SO IF YOU USER SUPER USER TO SETUP VNC, WHERE EVER YOUR ASKED TO USE ROOT, IN THIS POST, ALL YOU NEED TO DO IS USE SUDO AND THAT WILL GOVE YOU THE CREDENTIALS NEEDED.
This TUT is how to install VNC off a windows pc via SSH to your LINUX server.. If you use MAC or LINUX as your home pc then you might use a dif tool to SSH to the server, BUT THE SETUP PROCES IS THE SAME FROM SECTION 2 TO THE END....
First of all, You will need root credentials to be able to complete this tutorial...
After you receive your server, 9/10x the server already come with Linux OS installed.
1: Your first step is to download and run PUTTY for WINDOWS on your PC. After downloaing putty, double click on the .exe file & enter the host name or IP into the required section & enter port 22, in the port section next to the IP. Then down below you will see a section called Saved Session, Give your session a name & save.
Now you can always start your session, by highlighting your newly named session and clicking on Load then Open
OK now we have PUTTY installed and we are able to connect to our Server
2: Your next step is to make sure your Server is up to date, with all the latest UPDATES
So open PUTTY & login, then your first command would be
Let it run and install all the updates needed. Then reboot your server by typing the following command.
Now re-open PUTTY
3: Now we want to install vnc4server, by typing the following command.
Code:
apt-get install vnc4server
4: After all is installed you should complete the following as normal user and not root. So Login As what ever user you have, if not create a user by using the command
Because it is very unsafe to login to vnc as root, your just asking for trouble..
5: Again in PUTTY type the following. NOTICE AFTER vncserver there is a :1 that is the port numver of the user, so for 2nd user it would be vncserver :2 and so on...
Code:
vncserver :1 -geometry 1024x768 -depth 16
or
vncserver :1 -geometry 1024x768 -depth 24
6: Once you type the above command u will be prompted for a password. This is the password u will set for vnc to connect to the server.
Enter any password you like
Now that its installed, we can change the setting for the vnc4server.But before we do that we have to kill the server.
7: Type the following command into PUTTY
8: Then
Code:
nano /home/userXX/.vnc/xstartup
(userXX = your user name) This will open a text editor, where we will configure vnc.
Paste all this code into the text editor we just opened
Code:
Code:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
gnome-session &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
# xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Now everything is done. All you have to do is to restart the system which is good for the setting to work properly.
9: Type the following
10: Once you have restarted your server, we need to start the vnc server by typing the following into PUTTY & your done.
11: Install and Run VNC Viewer on your PC, and ENJOY
Now you can do the same for the following users, if required. For the next user, login as that user & follow on from step (4) to step (11)
i.e (4) #vncserver :2 -geometry 1024x768 -depth 16
to (10) Restart the server again and start vnc server..
Also make sure to start vnc server in the same order as the ports originally assigned for each user, otherwise which ever user u start first will be on port :1 etc
YOU CAN ALSO FOLLOW THE SAME STEPS, IF YOU ARE INSTALLING A HOME SERVER AND WANT TO SETUP VNC4SERVER SO YOU CAN CONNECT FROM WORK, ONLY YOU WOULDN'T NEED PUTTY. ALL YOU WOULD DO IS REPLACE THE PUTTY STEP FOR TERMINAL, SINCE YOU ARE WORKING ON THE SERVER LOCALLY
I hope this helps a few users out there.