Setting up and trouble-shooting Linux Remote Desktops using VNC server
Posted by amol shejole on May 26th, 2009
All of us webmasters have to move from shared to dedicated hosting some day when the traffic to our sites becomes more than what can be handled by shared servers or some of us decide to move to dedicated servers to ensure privacy and get complete control. Whatever may be the reason to move from shared to dedicated environment we all prefer linux servers over windows this is because they are way cheaper than their windows counterparts. But a big concern to a new user is the user-friendliness of linux. This is mainly because most of the linux servers come with commandline based linux operating system pre-installed which is convenient for the web-server-experts who say “command line based operations are faster” but what about a general user who finds desktop systems more convenient.
Many different versions of desktop environments are available for all linux distributions which include GNOME and KDE which are the most widely used desktop environments for linux. If you are running a server with low resources then KDE is a better choice as it is a less resource hungry environment. Lets see the steps to install these desktop environments. I assume you have got the basic CentOS,Red-hat,ubuntu or Fedora installed from the data center of your server. Log in to the server using a SSH client like “Putty” as the root user.
In CentOS you can use the YUM tool to install KDE. Type the following command to install K Desktop environment.
yum groupinstall kde-desktop
This will install the KDE alongwith resolving all the dependencies. If you are on a VPS it may happen that you get an error “Server refused to allocate pty” while trying to login via SSH. This happens mainly on the openvz based VPS’s as while resolving the dependencies YUM may accdently install and enable the package “udev” which changes the startup configuration of the system and sometimes rendering it useless and inaccessible which means all your important data can be locked inside. In this case only the server administrator can help you solve the problem without loosing the data when you come accross “Server refused to allocate pty” error. A simple way to solve this problem by adding the following lines to the file “/etc/rc.local”
/bin/rm -rf /dev/null
/bin/rm -rf /dev/random
/bin/rm -rf /dev/tty*
/bin/rm -rf /dev/pty*
/bin/mknod /dev/null c 1 3
/bin/mknod /dev/random c 1 8
/sbin/MAKEDEV tty
/sbin/MAKEDEV pty
This will force the system to allocate the devices every time the Machine is restarted. To install GNOME use the following command -
yum groupinstall “X Window System” “GNOME Desktop Environment”
After this has been done you will need to install the vnc server in order to access the desktop remotely. It can be done by the following command -
yum install vnc-server
This will make your server ready to accept remote deskop connections as soon as we start the server by starting the server and setting the password -
vncpasswd “yourpasswd”
Where your password is the password you desire to select and then you can start the server using -
vncserver
We need a vnc client to make connections to the server we just created. VNC clients are readily available for windows as well as linux which means you can access the desktop of your linux server using your windows machine. “real vnc viwer” is one such vnc viewer which is freely available. Following is to be entered in the vnc viewer to make the connection
192.168.1.1:5901
where 192.168.1.1 is the ip address of your server and 5901 is the port number on which the vnc server service runs by default.
Posted in Linux | No Comments »
