web stats
Setting VNCServer GUI Console for Debian and Ubuntu | Why Cloud Computing

Setting VNCServer GUI Console for Debian and Ubuntu

Often at times I will be asked to work on remote servers to finish tasks. SSH has always been a good choice to complete things that involves just a terminal. But what if you want need a GUI terminal from the remote server to get the work done. Well, if you need a GUI terminal, having VNC server on the server can help. So, in this article I will tell you how to make this setup.

Share our stuff and help us grow. Need help to create something new or fix something old? Contact us to know if we can help ๐Ÿ™‚

Debian SETUP:

STEP1: If you are working on a debian machine, just install vnc4server package.

apt-get install vnc4server

STEP2: Create a .vnc directory in your home directory.

mkdir ~/.vnc

STEP3: Now, just go to .vnc directory and run the following command.

vncserver :5 -pn -geometry 1024×968

STEP4: If you are doing it for the first time, you will be asked for vnc password. Enter the password twice and you should be done with the setup.

Now, to access this machine on another machine on the network all you have to do is to run the following command. Note that you have to install “xtightvncviewer” package before running this command. Let me write the sytax first followed by actual command.

Syntax:
vncviewer IP-OF-SERVER:VNC-PORT

Example:
vncviewer 192.168.1.10:5

In the above example, 192.168.1.10 is the ipaddress of my debian server to be accessed.

STEP5: Now, if you have any problem viewing the remove servers GUI, then you may have to tweak the xstartup file in your .vnc directory.

Using the following script might work. Make sure to take a backup of original xstartup script before using the code below.

#!/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 &
x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
unset SESSION_MANAGER
gnome-session&

UBUNTU SETUP:

If you are doing the same setup for UBUNTU, every things remains same until STEP4. You may have to use the following script in your “xstartup” file to get the GUI. Again, make sure to backup your original file before editing it.

#!/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โ€ &
gnome-session &

I think this setup should also work for setting up a VNCServer GUI for Ubuntu server running on amazon ec2 cloud. It would be great if somebody can give it a try and get back to me with the feedback.

I hope this article helped you folks. Do let me know if you have any smart tips and tricks that might make this post even informative and useful.

Share our stuff and help us grow. Need help to create something new or fix something old? Contact us to know if we can help ๐Ÿ™‚

Related Posts:

  • No Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Why ask?