Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old April 7th, 2005   #1
Crad
5 Cups of Ubuntu
 
Crad's Avatar
 
Join Date: Mar 2005
Location: Los Angeles, CA
Beans: 28
Send a message via ICQ to Crad Send a message via AIM to Crad Send a message via MSN to Crad
Lightbulb HOWTO: 32-Bit Chroot on 64-Bit Installs

Most of this comes from http://digital-conquest.ath.cx/wiki/...h_debbootstrap but I wanted to put together a cleaned up version that worked for me here (There are typos and inaccuracies on the wiki page).

Quote:
Step 1:
  • sudo apt-get install dchroot debootstrap
  • sudo mkdir /chroot/
  • sudo gedit /etc/dchroot.conf
    • Add this line: hoary /chroot
  • sudo debootstrap --arch i386 hoary /chroot/ http://archive.ubuntu.com/ubuntu
  • sudo chroot /chroot/
  • dpkg-reconfigure locales
Step 2:
In another terminal window (or by existing chroot):(We do this step because gedit has yet to be installed in the chroot environment)

Step 3:
In your chrooted environment (chroot /chroot):
  • apt-get update ; apt-get upgrade
Step 4:
In another terminal window (or by existing chroot):
  • sudo cp /etc/passwd /chroot/etc/
  • sudo cp /etc/shadow /chroot/etc/
  • sudo cp /etc/group /chroot/etc/
  • sudo cp /etc/sudoers /chroot/etc/
  • sudo cp /etc/hosts /chroot/etc/
  • sudo gedit /etc/fstab
  • Add the following lines:
    • /home /chroot/home none bind 0 0
    • /tmp /chroot/tmp none bind 0 0
    • /dev /chroot/dev none bind 0 0
    • /proc /chroot/proc proc defaults 0 0
    • /media/cdrom0 /chroot/media/cdrom0 none bind 0 0
    • /usr/share/fonts /chroot/usr/share/fonts none bind 0 0
  • sudo mkdir /chroot/media/cdrom0
  • sudo mount -a
  • sudo gedit /usr/local/bin/do_dchroot
  • Add the following:
    • #!/bin/sh
    • /usr/bin/dchroot -d "`echo $0 | sed 's|^.*/||'` $*"
  • sudo chmod 755 /usr/local/bin/do_dchroot
Step 5:
In a new terminal:
  • dchroot -d
  • sudo apt-get install synaptic
  • sudo ln -s /usr/sbin/synaptic /usr/sbin/synaptic32
  • exit
  • sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/synaptic32
  • sudo synaptic32
At this point you should have a 32 bit environment setup with synaptic setup. When you run synaptic32 from your main environment it will chroot execute it and all installations will be made to your 32 bit environment. If you want to be able to easily launch 32 bit chroot apps from your 64 bit environment symlink the app name to /usr/local/bin/do_dchroot. If you're using this as desktop system you'll probably want to use synaptic to install x, gnome, ubuntu specific themes, etc.

Please let me know of any errors, enhancements, or corrections

Last edited by Crad; May 13th, 2005 at 05:12 PM.. Reason: Updated to include making a directory for cdrom0
Crad is offline   Reply With Quote
Old April 7th, 2005   #2
Crad
5 Cups of Ubuntu
 
Crad's Avatar
 
Join Date: Mar 2005
Location: Los Angeles, CA
Beans: 28
Send a message via ICQ to Crad Send a message via AIM to Crad Send a message via MSN to Crad
Re: 32-Bit Chroot How-To

To get Firefox setup with Flash I did the following:
  • Ran sudo synaptic32 (as noted in the above thread
  • Installed mozilla-firefox
  • dchroot -d
  • sudo ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1
  • sudo ln -s /usr/bin/firefox /usr/bin/firefox32
  • exit
  • sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/firefox32
  • Made sure all instances of firefox are closed (you can not run both 32 and 64 bit firefoxes at the same time afaik... it just spawns a new 64 bit thread when you launch the old.
  • firefox32
  • Visited a site with flash on it and ran the automated firefox flash install.

As of right now sound is not working. If I figure out how to get the sound stuff working across the chroot, I'll post it here.

Last edited by Crad; April 13th, 2005 at 03:49 PM.. Reason: Updated with symlink per minuo's suggestion
Crad is offline   Reply With Quote
Old April 7th, 2005   #3
wmcbrine
Has an Ubuntu Drip
 
wmcbrine's Avatar
 
Join Date: Mar 2005
Beans: 743
Ubuntu 9.10 Karmic Koala
Re: 32-Bit Chroot How-To

To get sound working, you need to mount --bind /dev /chroot/dev (or the equivalent fstab line).

In my case, I also had to add my username to the right group to have permission to write to /dev/dsp; but that was because I was using my old Mandrake system as the chroot, and it used a different number for the audio group. For an Ubuntu chroot, you should be set already.

In another thread, someone said it was also necessary to modprobe ioctl32 before starting the chroot. I've not found that to be the case here, but perhaps that's because my chroot is using OSS. (?)
wmcbrine is offline   Reply With Quote
Old April 12th, 2005   #4
mthaddon
A Carafe of Ubuntu
 
mthaddon's Avatar
 
Join Date: Mar 2005
Location: San Francisco, US
Beans: 141
Hardy Heron (Ubuntu Development)
Re: 32-Bit Chroot How-To

Quote:
Originally Posted by Crad
To get Firefox setup with Flash I did the following:
  • Ran synaptic32 (as noted in the above thread
  • Installed mozilla-firefox
  • dchroot -d
  • ln -s /usr/bin/firefox /usr/bin/firefox32
  • exit
  • ln -s /usr/local/bin/do_dchroot /usr/local/bin/firefox32
  • Made sure all instances of firefox are closed (you can not run both 32 and 64 bit firefoxes at the same time afaik... it just spawns a new 64 bit thread when you launch the old.
  • firefox32
  • Visited a site with flash on it and ran the automated firefox flash install.

As of right now sound is not working. If I figure out how to get the sound stuff working across the chroot, I'll post it here.

I tried this, and I have verified that I have the 32bit version of firefox running, but I get the following message:

LoadPlugin: failed to initialize shared library /home/mthaddon/.mozilla/plugins/libflashplayer.so [libXmu.so.6: cannot open shared object file: No such file or directory]

I've checked that the file exists:

ls -l /home/mthaddon/.mozilla/plugins/libflashplayer.so
-rwxr-xr-x 1 mthaddon mthaddon 2096844 2004-05-20 07:34 /home/mthaddon/.mozilla/plugins/libflashplayer.so

Any idea what's happening here?


---------------------------------

Resolution:

Found out I needed to install libxmu6 - fixed the problem. Now have 32bit firefox version running nicely.

Thanks, Tom
__________________
Dell Inspiron 1420n running Hardy i386.

Last edited by mthaddon; April 12th, 2005 at 08:58 PM..
mthaddon is offline   Reply With Quote
Old August 4th, 2005   #5
gordyt
5 Cups of Ubuntu
 
Join Date: Apr 2005
Location: Humble, TX
Beans: 23
Ubuntu 6.10 Edgy
Send a message via AIM to gordyt
Re: 32-Bit Chroot How-To

Quote:
Originally Posted by mthaddon
...
LoadPlugin: failed to initialize shared library /home/mthaddon/.mozilla/plugins/libflashplayer.so [libXmu.so.6: cannot open shared object file: No such file or directory]
...
Resolution:

Found out I needed to install libxmu6 - fixed the problem. Now have 32bit firefox version running nicely.
Tom thank you for posting this! I had just setup the chroot environment on my machine yesterday afternoon and was having the exact same problem.

Regards,
--gordon
gordyt is offline   Reply With Quote
Old August 20th, 2005   #6
pobstil
First Cup of Ubuntu
 
Join Date: Apr 2005
Beans: 1
Re: 32-Bit Chroot How-To

Hey I found this thread hoping to answer my questions, but havn't quite got it. Now I'm wondering if you can answer them for me.

I'm trying to set up a webserver, in which my mates can host their own websites. So I want to setup a user for them, so they can logon remotely via ssh, and have their website hosted in their home directory. But want I don't want them to be able to access the rest of the system. Even though I know they can't do anything because they wont have root permissions, I just want them to be able to access their home folder, and just their home folder. I thought I could do this my chrooting their user, can anyone expand on this, help me out, or point me in the right direction? Thanks in advance for any hints and tips.
pobstil is offline   Reply With Quote
Old October 10th, 2005   #7
vox
First Cup of Ubuntu
 
vox's Avatar
 
Join Date: Oct 2005
Beans: 1
Re: 32-Bit Chroot How-To

Thanks for the howto Have one problem tho. When trying to run a 32bit app from within the 64bit environment, i get this error:

vox@Hagalaz:~$ vlc32
(breezy) cho /usr/local/bin/vlc32 | sed 's|^.*/||'
bash: cho: command not found

but if i run it from within the 32bit enviro, it works fine. What've i done wrong?

***Edit***

Gah ok. this was an issue with the joe editor. I'll go crawl back under my rock now..

Last edited by vox; October 10th, 2005 at 01:25 PM..
vox is offline   Reply With Quote
Old April 20th, 2005   #8
tlepes
5 Cups of Ubuntu
 
tlepes's Avatar
 
Join Date: Feb 2005
Location: 3rd planet out from Sol.
Beans: 23
Hardy Heron (Ubuntu Development)
Send a message via Yahoo to tlepes
Re: 32-Bit Chroot How-To

Quote:
Originally Posted by Crad
To get Firefox setup with Flash I did the following:
  • ...some other stuff about chroots...
  • sudo ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1
  • ...more clipped stuff regarding chroots...
Thanks! You are awesome. I have been looking for that nugget of knowledge. I have not had sound working in my Hoary Firefox and Flashplayer at all until now. I had given up on it for a while, even. I am just running Hoary 32bit for now but have an AMD64 and was poking in here for tips on 32bit app support before I dive in.

I get sound in Firefox now! What a nice surprise!

Peace,
Tim
__________________
Be the change you want to see in the world. Code the change you want to see in the program. Spare some change, we are all sisters and brothers. And be accepting of change, for it is the nature of the world we know.
tlepes is offline   Reply With Quote
Old April 22nd, 2005   #9
Ephack
First Cup of Ubuntu
 
Ephack's Avatar
 
Join Date: Apr 2005
Location: Ciudad Juárez
Beans: 12
Ubuntu 6.10 Edgy
Re: 32-Bit Chroot How-To

First of all: THANK YOU! It's really very helpfull and thanks to you I can now view flash animations on my Ubuntu64.

My only remark is that I can have both version of Firefox working at the same time: it won't work if I make a Gnome launcher, but if I launch firefox32 from the shell, a new window of firefox32 appears, even if firefox64 is already runing

My next problem is for the sound... But I have already problems on my 64bits system, so I'm not sure I have any chance to have it to work in the chroot... Nobody spoke of OSS... Did somebody already try with it?

Last edited by Ephack; April 23rd, 2005 at 05:54 PM..
Ephack is offline   Reply With Quote
Old April 24th, 2005   #10
amarra
Spilled the Beans
 
Join Date: Apr 2005
Location: Galatina, LE - Italy
Beans: 14
Kubuntu 7.04 Feisty Fawn
Re: 32-Bit Chroot How-To

Hi to all,

this is my first message in the Ubuntu Forums after my registration.
I've a suggestion for this excellent HOWTO.
I think that it may be useful to add the following line in the /etc/fstab

/usr/share/fonts /chroot/usr/share/fonts none bind 0 0

so that fonts from the 64 bit environment become available to the 32 bit chrooted environment. My 32 bit Firefox won't list all the fonts on my system before.
I hope this can be useful to someone.
Bye
amarra is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:11 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry