I am using Debian Sid to write this how-to but it will normally work on all Linux distribs.

What do you need?

* Around 4Gb of free space
* Qemu
* Xephyr
* losetup
* dmsetup
* root access

Setting up the chroot :


First you have to download the qemu image at [|http://etotheipiplusone.com/kde4daily/docs/kde4daily.html|en] then bunzip and convert it in a raw format :

$ bunzip2 -c kde4daily-0_0_1_r734472-qcow.img.bz2 >> kde4daily-0_0_1_r734472-qcow.img
$ qemu-img convert kde4daily-0_0_1_r734472-qcow.img kde4daily-0_0_1_r734472-qcow.raw

Note : you need qemu to do the conversion.

(At this point you will need to be root or use sudo)
Ok, now the raw file is like a hard drive, it contains 4 partitions (3 ext3 and 1 swap).

# sfdisk -d kde4daily-0_0_1_r734472-qcow.raw
partition table of kde4daily-0_0_1_r734472-qcow.raw
unit: sectors

kde4daily-0_0_1_r734472-qcow.raw1 : start= 63, size= 1959867, Id=83, bootable
kde4daily-0_0_1_r734472-qcow.raw2 : start= 1959930, size= 996030, Id=82
kde4daily-0_0_1_r734472-qcow.raw3 : start= 2955960, size= 1959930, Id=83
kde4daily-0_0_1_r734472-qcow.raw4 : start= 4915890, size= 2409750, Id=83

With sfdisk you can see the differents paritions, we will mount them in /mnt/kde4daily, to do this you have to mount the image in loopback then create a device for the 3 partitions :
# losetup -f kde4daily-0_0_1_r734472-qcow.raw
# echo "0 1959867 linear /dev/loop0 63" > kde_part1
# echo "0 1959930 linear /dev/loop0 2955960" > kde_part2
# echo "0 2409750 linear /dev/loop0 4915890" > kde_part3
# dmsetup create loop0p1 kde_part1
# dmsetup create loop0p2 kde_part2
# dmsetup create loop0p3 kde_part3

At this point you will have three new devices :
# ls /dev/mapper/
control loop0p1 loop0p2 loop0p3

Now we mount them :
# mkdir /mnt/kde4daily
# mount /dev/mapper/loop0p1 /mnt/kde4daily/
# mount /dev/mapper/loop0p2 /mnt/kde4daily/home/
# mount /dev/mapper/loop0p3 /mnt/kde4daily/storage/tmp/kde4dev/

now mount some other thing :
# mount -o bind /dev /mnt/kde4daily/dev
# mount -o bind /proc /mnt/kde4daily/proc
# mount -o bind /sys /mnt/kde4daily/sys
# mount -o bind /tmp /mnt/kde4daily/tmp

Good, the kde4daily filesystem is now mounted on yours, now we set up and entering in the chroot.

# cp -L /etc/resolv.conf /mnt/kde4daily/etc/resolv.conf
# chroot /mnt/kde4daily /bin/bash
su - kde4daily
[kde4daily@obelix][21:37:02]
[~/kde4dailyupdater]> ./kde4daily-update
The last line is for updating the system, if you don't wan't to do this now, just skip this step.

At this point you are in kde4daily envirronment, you will need this terminal later, so hide it. You have to alternative now :
- Use a 2nd X server
or
- Use Xephyr

Xephyr is an X server inside your X server, it is just a window with an emulated X server inside. A 2nd X server will let you try the composite effects and all your screen resolution.

The Xephyr solution :


In your host system start Xephyr as normal user :
$ Xephyr :1 -screen 1024x768 -ac
if you have more than one X server use :2 (or :3 etc ...) instead of :1. You can use a bigger or smaller resolution than 1024x768 if you want.

The 2nd X server solution :


Your user have to be allowed to start a 2nd X server, for Debian you have to replace the line :

allowed_users=console
by
allowed_users=anybody

in the file /etc/X11/Xwrapper.config
Now start the server :
$ startx -- :1
Then you can switch between the first and the second server with Ctrl+Alt+F7 and Ctrl+Alt+F8.
Go back in the first server and in another terminal (the 3rd :) execute :
DISPLAY=":1" xterm
In the 2nd X serveur you will see a terminal disable host control and close the terminal :
$ xhost +
$ exit
And finally return in the 1st X server with Ctrl+Alt+F7

Launch KDE4


OK your now ready to launch kde4

DISPLAY=":1" /storage/tmp/kde4dev/kde/bin/startkde


The End


TODO :
- Howto quit and unmount all mounted stuff.
- Script to automate all these steps.