How-to set up a schroot to run KDE4
To run kde4 in a chroot and save your kde3! Run the following as root from konsole!
Create a mount point:
debootstrap sid /home/chroot http://ftp.us.debian.org/debian
Create a testuser:
aptitude install schroot
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. # [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.old
Replace /etc/schroot/mount-defaults with the following: (It is important to make sure that /dev line is listed before /dev/pts)
# 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
WARNING!!! once you have entered into the chroot mind that the real system /home is bind mounted into the chroot, if you remove any file into the chroot it will be removed in the real system and the other way round. One advice, if you want to remove the chroot to free that disk space, make sure the /home dir is not bind mounted before actually remove the chroot.
Add lenny and experimental repositories to /etc/apt/sources.list:
echo "deb http://ftp.us.debian.org/debian experimental main non-free contrib" >> /etc/apt/sources.list echo "deb http://ftp.us.debian.org/debian lenny main" >> /etc/apt/sources.list
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 Package: * Pin: release a=lenny Pin-Priority: 200
Then run update and install kde4:
aptitude update && aptitude install -t experimental kde4 xorg
aptitude install -t experimental kdm
Or use gdm (gdm will ask to use another display if DISPLAY :0 is already in use.
aptitude install gdm
Running a from within the current X session
Outside of the schroot install sux as root:
apt-get install sux
Now we should change to the kde4 user, enter the chroot and run the command, e.g.: konqueror. This all need to be done keeping current Xorg session credentials.
sux - kde4 schroot -p konqueror
Running a full kde4 session
Go to a text virtual terminal(vt), this is outside current X session, for example vt2 (ctrl-alt-F2)
To login to a full kde4 session run the following:
su - 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!
WARNING!!! you can login into the kde4 session as your regular user(s) since the chroot includes a bind mount to your real system /home dir. Don't do this because that regular user's files and configurations could be affected. You're warned.
To switch between kde4 and kde3 you should be able to just alt+ctrl F7 (kde3) and alt+ctrl F8 (kde4)
Running a full kde4 session with NVIDIA 3D Drivers
To be able to test KDE4 to the full extent, you need to test the new Plasma, KDE Window Manager et cetera, which require Composite to be available.
For the chroot, you need to have the nvidia-glx package available so that the X server can use it.
But nvidia-glx also depends on the kernel component which you can't install. That's because as of 2008-07-19, nvidia-glx depends on a virtual package nvidia-kernel-173.14.09, which is provided by one of the nvidia package which hold the kernel module.
You can use equivs to overcome this problem. In your chroot environment, install equivs and then create a dummy nvidia-kernel-173.14.09 package.
Creating the nvidia-kernel dummy package's control file with equivs.
learner:/tmp# equivs-control nvidia-kernel-control
This is how the content looks like. You can modify it more as you like but the 'Package' section is important and that is what matters the most.
learner:~# cat /tmp/nvidia-kernel-control ### Commented entries have reasonable defaults. ### Uncomment to edit them. Section: misc Priority: optional Standards-Version: 3.6.2 Package: nvidia-kernel-173.14.09 # Version: <enter version here; defaults to 1.0> # Maintainer: Your Name <firstname.lastname@example.org> # Pre-Depends: <comma-separated list of packages> # Depends: <comma-separated list of packages> # Recommends: <comma-separated list of packages> # Suggests: <comma-separated list of packages> # Provides: <comma-separated list of packages> # Replaces: <comma-separated list of packages> # Architecture: all # Copyright: <copyright file; defaults to GPL2> # Changelog: <changelog file; defaults to a generic changelog> # Readme: <README.Debian file; defaults to a generic one> # Extra-Files: <comma-separated list of additional files for the doc directory> Description: <short description; defaults to some wise words> long description and info . second paragraph
Now, build the dummy package
learner:/tmp# equivs-build nvidia-kernel-control dh_testdir dh_testroot dh_clean -k dh_testdir dh_testroot dh_install dh_installdocs dh_installchangelogs dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb dpkg-deb: building package `nvidia-kernel-173.14.09' in `../nvidia-kernel-173.14.09_1.0_all.deb'. The package has been created. Attention, the package has been created in the current directory, not in ".." as indicated by the message above!
Great. Now you have the exact nvidia-kernel dummy package that nvidia-glx depends on. Go ahead and install it.
learner:/tmp# dpkg -i nvidia-kernel-173.14.09_1.0_all.deb Selecting previously deselected package nvidia-kernel-173.14.09. (Reading database ... 70779 files and directories currently installed.) Unpacking nvidia-kernel-173.14.09 (from nvidia-kernel-173.14.09_1.0_all.deb) ... Setting up nvidia-kernel-173.14.09 (1.0) ...
Yippy!! Now you should be able to install nvidia-glx package without cracking nuts.
learner:/tmp# apt-get install nvidia-glx Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libpciaccess0 xfonts-base libgl1-mesa-dri Use 'apt-get autoremove' to remove them. Suggested packages: nvidia-settings nvidia-kernel-source The following NEW packages will be installed: nvidia-glx 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 7681kB of archives. After this operation, 22.8MB of additional disk space will be used. Get:1 http://ftp.us.debian.org sid/non-free nvidia-glx 173.14.09-2 [7681kB]
That's it. Now copy the xorg.conf file from your real installation to the chroot installation and you should be able to start-up your chrooted X server with nvidia 3D driver.