KDE and VNC server inside OpenVZ Container
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 that will be used by KDE:
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.
April 26, 2011
good tutorial, not worked for me first time or even second. But, guess that’s my fault, because just tried it again and now this time vnc works fine
thanks
December 26, 2011
If you are having problem with this line :nano /home/kusr/.vnc/xstartup, then nano is not already installed in your system. To install it, try yum -y install nano , and try again. It should work now. These days I have seen I lot of server which doesn’t have nano already installed. Hope it helps somebody. cheers