To run kde4 in a chroot and save your kde3! Run the follow as root:
Create a mount point:
mkdir /home/chroot
Run debootstrap:
debootstrap sid /home/chroot http://ftp.us.debian.org/debian
Create a testuser:
adduser kde4
Backup /etc/schroot/schroot.conf:
cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.old
Then replace whats in /etc/schroot/schroot.conf with the following:
# schroot chroot definitions.
# See schroot.conf(5) for complete documentation of the file format.
#
# Please take note that you should not add untrusted users to
# root-groups, because they will essentially have full root access
# to your system. They will only have root access inside the chroot,
# but that's enough to cause malicious damage.
#
# The following lines are examples only. Uncomment and alter them to
# customise schroot for your needs, or create a new entry from scratch.
#
#
#[sid]
#description=Debian sid (unstable)
#location=/srv/chroot/sid
#priority=3
#users=rleigh
#groups=sbuild
#root-groups=root
#aliases=unstable,default
#
#[sid-snap]
#type=lvm-snapshot
#description=Debian sid snapshot
##location=/srv/chroot/sid
#priority=3
#groups=sbuild,root
#root-users=rleigh
#root-groups=root,sbuild
#source-root-users=rleigh
#device=/dev/hda_vg/sid_chroot
#mount-options=-o atime,sync,user_xattr
#lvm-snapshot-options=--size 2G
#run-setup-scripts=true
#run-exec-scripts=true
#
#[etch]
#description=Debian etch (testing) 32-bit
#location=/srv/chroot/etch
#priority=3
#groups=sbuild-security
#aliases=testing
#run-setup-scripts=false
#run-exec-scripts=false
#personality=linux32
#
#[sarge]
#description=Debian sarge (stable)
#location=/srv/chroot/sarge
#priority=2
#groups=sbuild
#aliases=stable
#
#[sarge-file]
#description=Debian sarge (stable)
#file=/srv/chroot/sarge.tar.gz
#priority=2
#groups=sbuild
#
#[sarge-secure]
#description=Debian sarge (stable)
#location=/srv/chroot/sarge
#priority=2
#groups=sbuild-security
#aliases=stable-security
#
[experimental]
type=directory
description=Debian experimental (unstable)
priority=4
groups=sbuild,root
users=kde4
#root-groups=root,sbuild
aliases=unstable,default
#device=/dev/hda_vg/experimental_chroot
mount-options=-o atime,sync,user_xattr
location=/home/chroot
run-setup-scripts=true
run-exec-scripts=true
Then backup /etc/shroot/mount-defaults:
cp /etc/schroot/mount-defaults /etc/schroot/mount-defaults
Relace /etc/schroot/mount-defaults with the following:
# mount.defaults: static file system information for chroots.
# Note that the mount point will be prefixed by the chroot path
# (CHROOT_PATH)
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev /dev none rw,bind 0 0
/dev/pts /dev/pts none rw,bind 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/home /home none rw,bind 0 0
/tmp /tmp none rw,bind 0 0
Switch to kde4 user:
su - kde4
Then schroot and type root passwd:
schroot -u root
Edit /etc/apt/sources.list and add:
deb http://ftp.us.debian.org/debian/ experimental main non-free contrib
Set up pinning by editing /etc/apt/preferences and adding:
Package: *
Pin: release a=experimental
Pin-Priority: 800
Package: *
Pin: release a=unstable
Pin-Priority: 400
Then run update and install kde4:
aptitude update && aptitude install kde4 xorg
Then edit /etc/kde4/kdm/kdmrc change StaticServers and ReserveServers:
StaticServers=:1
ReserveServers=:2,:3
Outside of the schroot install sux as root:
apt-get install sux
To login to a full kde4 session run the following:
sux - kde4
schroot
su (use root passwd here)
invoke-rc.d kdm start
And now you should see kdm and should be able to login as kde4 to kde4!