Archive

Archive for March, 2011

KDE and VNC server inside OpenVZ Container

March 26th, 2011 No comments

Well I think a GUI based system is very important as most of us hates CUI (although its extremely fast and consumes less resources), so I just figured out how to connect to my new server with GUI at http://dotkb.com. After a whole day of study over the internet I was finally able to make out, how to install GUI on a VZ server. FYI, its posted below:

Running KDE inside an OpenVZ container is a rather easy task. And this may help you in case you wanna have an online office available from any where in the world.

In order to accomplish this you will need a CentOS VPS, this can be done with other linux distributions also, but I’ll stick to CentOS.

First of all let’s make sure we have the latest packages installed:

yum update

Now let’s install KDE:

yum install kdebase kdelibs kdeaccessibility kdemultimedia kdeadmin kdeutils kdegraphics kdenetwork kdeaddons xorg-x11-server-Xorg

Here you have a list from which you can add more, or remove:
kdemultimedia.i386 : Multimedia applications for the K Desktop Environment
kdegames.i386 : K Desktop Environment – Games
kdeaccessibility.i386 : K Desktop Environment – Accessibility
kdepim.i386 : PIM (Personal Information Manager) for KDE
kdeutils.i386 : K Desktop Environment – Utilities
kdeadmin.i386 : Administrative tools for KDE.
kdegraphics.i386 : K Desktop Environment – Graphics Applications
kdenetwork.i386 : K Desktop Environment – Network Applications
kdeaddons.i386 : K Desktop Environment – Plugins
kdeartwork.i386 : Additional artwork (themes, sound themes, …) for KDE
kdeartwork-icons.i386 : icon themes (kdeclassic, slick ….) for KDE

Now that KDE is installed, it’s time to install the vnc server:

yum install vnc-server

Next we’ll need to add an user under KDE will run:

useradd kusr -d /home/kusr -G users -m
passwd kusr

The final step is to configure and start the vnc server:

vncpasswd
vncserver

With the above commands you configured the password and the vnc server started, but the problem now is that it’s not using KDE.
Let’s kill the vnc server and edit the configuration file that was automatically generated:

killall -9 Xvnc
nano /home/kusr/.vnc/xstartup

Make sure the configuration file looks like this:

#!/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 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startkde &

The only thing I changed was the last line.
Start the vnc server once more:

vncserver

Now you are ready to use the new desktop, simply connect using your favorite VNC viewer, but remember to use the port 5901 (some VNC servers use port 5801).

You may start VNC on browsers by typing <your IP adress like 192.0.0.27>:5801

Please comment for in case you need any further clarifications.

Categories: Internet, Linux, Tragedy Tags: