Archive:Getting Started/Run/Nested Session

From KDE TechBase
Revision as of 14:43, 3 March 2011 by Odysseus (talk | contribs) (Created page with '{{Template:I18n/Language Navigation Bar|Getting_Started/Run/Nested_Session}} == Nested KDE 4 Session == {|align="right" |[[image:Snapshot1.png|right|thumb|200px|Nested]...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Getting_Started/Run/Nested_Session


Nested KDE 4 Session

Nested

Instead of using a full-blown new virtual X for developing software you can use Xephyr to embed your KDE 4 session into your working KDE 3 or other X11 environment.

You can also do this with xnest, but as xnest cannot handle extensions like Render many people prefer Xephyr.

Note
In some cases Xephyr/xnest will make the keyboard not work correctly because of bug:19365. The workaround is to run KDE on a standalone X as described below.


If you want to get a minimal KDE session up and running, just launch Xephyr (available in Kubuntu as xserver-xephyr; Gentoo users compile x11-base/xorg-server with USE="kdrive"):

Xephyr :1 -extension GLX &

You can now launch KDE:

su - $USER 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 KDEDIR=`kde4-config --prefix` export LD_LIBRARY_PATH=$KDEDIR/lib 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 KDM.

On Kubuntu, you can enable it by changing

[Xdmcp]

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

Enable=false

in /etc/kde3/kdm/kdmrc to

[Xdmcp]

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

Enable=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 1024x768&

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

Note
If you get lots of refused connection errors, you might want to use the -ac option of Xephyr. When I tried to launch an application into the Xephyr instance, but I received 3-4 "No protocol specified", after finally saying "could not connect to X Server :1". The below code fixed it for me. It only happens when I am crossing users though, as opposed to doing it all in my main user.


Xephyr -ac :1&

Another option to try if you get lots of refused connection errors is you may need to grant assess to your kde-devel user to your X server. As root or using sudo execute:

xhost +local:kde-devel

If you do not have Xephyr, you can also use Xnest:

Xnest -ac :1& export DISPLAY=:1



Warning
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


Sping 00:25, 9 April 2007 (CEST)
I use this for my start script nested_kde4.sh:

#! /bin/bash
NESTED_KDE_DISPLAY_BACKUP=$DISPLAY
export DISPLAY=:0
Xephyr :1 -screen 1024x768 &
export DISPLAY=:1
$HOME/kde/bin/startkde-modified &
export DISPLAY=${NESTED_KDE_DISPLAY_BACKUP}

If you run into

"Call to lnusertemp failed (temporary directories full?).
 Check your installation."

try this:

mkdir /var/tmp/kde-devel-kde4

The above code assumes you work with user kde-devel.

Note
In most cases you have to replace startkde-modified with startkde