View Full Version : deboostrapping edgy
mlind
June 28th, 2006, 09:46 AM
Most of you probably know this, but I was quite amazed to see that you can
chroot to edgy while running dapper too.
To get this working, you must install debootstrap which is at least 0.3.3.0ubuntu3
You can get it using aptitude from edgy's repo or download directly from
http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/
#taken from debootstrap's manual
sudo mkdir /edgy-root
sudo debootstrap edgy /edgy-root http://archive.ubuntu.com/ubuntu
#put proc on /etc/fstab for edgy
sudo sh -c 'echo "proc /edgy-root/proc proc none 0 0" >> /etc/fstab'
sudo mount proc /edgy-root/proc -t proc
sudo cp /etc/hosts /edgy-root/etc/hosts
sudo chroot /edgy-root /bin/bash
You should be on (sandboxed) edgy environmend now. Just install ubuntu-standard
(and ubuntu-desktop if you want desktop) packages.
You should edit your normal environment's /etc/inittab (not the chrooted edgy's)
and add line
8:23:respawn:/usr/sbin/chroot /edgy-root /sbin/getty 38400 tty8
then run
sudo init q
and Ctrl+Alt+F8 should greet you with edgy screen :)
Now I'm able to run Dapper and Edgy simultaneously, so that neither interfieres with another
and I don't have to reboot to change the environment.
mlind
June 28th, 2006, 10:00 AM
I forgot,,
After installing ubuntu-standard package to chrooted environment, you should probably do
dpkg-reconfigure -a
russelld
July 10th, 2006, 04:51 AM
can you clarify this please?
You should edit your normal environment's /etc/fstab (not the chrooted edgy's)
and add line
8:23:respawn:/usr/sbin/chroot /edgy-root /sbin/getty 38400 tty8
adding this to /etc/fstab and then rerunning mount produces an error :(
sudo mount -a
[mntent]: line 12 in /etc/fstab is bad
by running this at cli
/usr/sbin/chroot /edgy-root /sbin/getty 38400 tty8
then:
then run
sudo init q
and Ctrl+Alt+F8 should greet you with edgy screen :)
which it does!:D
maskd
July 10th, 2006, 07:05 AM
You should edit your normal environment's /etc/fstab (not the chrooted edgy's)
and add line
8:23:respawn:/usr/sbin/chroot /edgy-root /sbin/getty 38400 tty8
Shouldnt /etc/fstab be /etc/inittab :)
Just followed this and I found it to be very cool!
If you install a GUI with it, will it intefere with the existing GUI?
mlind
July 10th, 2006, 07:16 AM
Shouldnt /etc/fstab be /etc/inittab :)
Just followed this and I found it to be very cool!
If you install a GUI with it, will it intefere with the existing GUI?
Oops, yes It has to be /etc/inittab. I had trouble running two Xservers simltaneously, but I did it succesfully few times. I currently run edgy
without X, because there were some dependency errors last week.
Here are my other fstab entries
proc /edgy-root/proc proc defaults 0 0
/dev/pts /edgy-root/dev/pts devpts defaults 0 0
/proc/bus/usb /edgy-root/proc/bus/usb none bind 0 0
/dev /edgy-root/dev none bind 0 0
/dev/shm /edgy-root/dev/shm none bind 0 0
/sys /edgy-root/sys none bind 0 0
You probably have to bind /var/run/dbus too, and /tmp if you want. Binding breaks chroot jail idea, so only bind the mount points you really have to.
And remember, when a directory is binded and you do something for it, it affects both chroot and your normal environment.
russelld
July 10th, 2006, 08:36 AM
Shouldnt /etc/fstab be /etc/inittab :)
thanks!
Just followed this and I found it to be very cool!
If you install a GUI with it, will it intefere with the existing GUI?
I started wdm login manager as it's light on ram
Crtl-Alt-F8
sudo wdm
chose black box as window manager as it's super lean on ram (apt-get install blackbox)
started OpenOffice and started editing!
I bound chrooted /home to it's own partition
/etc/fstab
/dev/hda6 /chroot/breezy/home ext3 defaults 0 2
(I used this to boot into Breezy as some stuff only works there)
yo! this is way cool!\\:D/
mlind
July 10th, 2006, 08:43 AM
thanks!
I started wdm login manager as it's light on ram
Crtl-Alt-F8
sudo wdm
chose black box as window manager as it's super lean on ram (apt-get install blackbox)
started OpenOffice and started editing!
I bound chrooted /home to it's own partition
/etc/fstab
/dev/hda6 /chroot/breezy/home ext3 defaults 0 2
(I used this to boot into Breezy as some stuff only works there)
yo! this is way cool!\\:D/
That looks like a cool setup!
I've always wanted to try Xfce out, so I guess I'll go with Xfwm instead.
I'm not sure how should I deal with hal/dbus, should they see their running process (which means bindmounting /var/run/dbus and /var/run/hal)..
russelld
July 10th, 2006, 09:52 AM
That looks like a cool setup!
ahh its only short lived as the chrooted display took display :0 from the original one. The effect in the original display is that starting applications from the menu will not work, but already open applications still do their stuff as expected.
so running xpdf from cli from orignal display:
~$ xpdf
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Error: Can't open display: :0.0
will have to look into this over next weekend...
mlind
July 10th, 2006, 10:13 AM
ahh its only short lived as the chrooted display took display :0 from the original one. The effect in the original display is that starting applications from the menu will not work, but already open applications still do their stuff as expected.
so running xpdf from cli from orignal display:
~$ xpdf
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Error: Can't open display: :0.0
will have to look into this over next weekend...
I'll check this later too, but you should be exporting DISPLAY=:0.1
somewhere. Maybe there's a configuration file for this to force wdm or whatever it is to run on second display. GDM did it automatically.
mlind
August 15th, 2006, 06:46 PM
ahh its only short lived as the chrooted display took display :0 from the original one. The effect in the original display is that starting applications from the menu will not work, but already open applications still do their stuff as expected.
so running xpdf from cli from orignal display:
~$ xpdf
Xlib: connection to ":0.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Error: Can't open display: :0.0
will have to look into this over next weekend...
btw, you can allow chrooted distribution to use X like this
#extract display cookie
xauth extract /tmp/display $DISPLAY
#bind mount /tmp, so that it's visible on chroot
sudo mount --bind /tmp /path/to/chroot/tmp
#on chroot environment
xauth merge /tmp/display
export DISPLAY=:0
Alternative way is to use xhost, which is more insecure
xhost +local:user
#chroot environment
export DISPLAY=:0
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.