Developing KDE 4 Inside a KDE 3 Session

When I started to get a full blown KDE 4 environment running, I found it very inconvenient to constantly switch screens. On the other hand, Xnest was not bearable, because it cannot handle extensions like Xrender. Lucky enough, there is Xephyr, a Xnest replacement that I have briefly blogged about before.

If you want to get a minimal KDE session up and running, just launch Xephyr (available in Kubuntu as xserver-xephyr):

# Xephyr :1&

You can now launch KDE:

export DISPLAY=:1
/path/to/kde4/bin/startkde-modified &

startkde-modified is a copy of the startkde-script which includes the following lines on the top:

export LD_LIBRARY_PATH=/opt/kde4/lib
export KDEDIR=/opt/kde-trunk
export PATH=$KDEDIR/bin/:$PATH
export KDEHOME=~/.kde4

You can also use Xephyr with KDM via the Xdmcp protocol and simply a new KDE 4 session to Kubuntu as indicated on

On Kubuntu, you can enable it by changing

# Whether KDM should listen to incoming XDMCP requests.
# Default is true

in /etc/kde3/kdm/kdmrc to

# Whether KDM should listen to incoming XDMCP requests.
# Default is true

and adjust your /etc/kde3/kdm/Xaccess to allow your local machine access. Additionally you should make sure to set up a port blocking policy on all external interfaces for the Xdmcp port if you are doing this on a laptop or a PC in an untrusted environment.

If you are done, simply launch Xephyr:

Xephyr -query localhost :1 -host-cursor -screen 800x600&

where -host-cursor tries to reuse the host’s cursor and -screen sets the screen dimensions.

(click to enlarge)