Using chroot to run 32-bit Firefox multimedia in 64-bit Etch

Share your own howto's etc. Not for support questions!

Using chroot to run 32-bit Firefox multimedia in 64-bit Etch

Postby michael7 » 2007-02-06 23:45

This HOWTO will show you how to set up and use chroot to run 32-bit Firefox with full multimedia support on a 64-bit Debian Etch installation

I have an AMD64 box running the 64-bit version of Etch. It's stable, solid and very fast. In other words, it's a great distro! The only drawback is the lack of some 64-bit multimedia players, plugins and codecs. I tried several solutions with mixed results. Then I came across some instructions on the forum, followed them and solved my problem. I have changed those instructions to fit my hardware and added some embellishments, but the essentials came from this thread by shame:

As a prerequisite, you must have an existing 32-bit installation, with the desired players, plugins and codecs enabled, on another partition. There are several ways to do this. You can create it with a 32-bit version of Etch, like I did at: viewtopic.php?t=11280 You can also download and install a distro like Linux Mint which comes stock with all the multimedia stuff. I recently installed Mint on an empty partition and used it for these instructions because it was convenient.

When you complete this HOWTO, you will have an icon on the Desktop of your 64-bit installation for a 32-bit Firefox and with a mouse click, can watch all the video content on websites like CNN and such. No rebooting necessary.

Here is my setup:
Etch 64-bit on hda1
Mint 32-bit on hda5
Broadband Internet connection

1. Login as su and create a directory on root.

Code: Select all
michael7@etch64:~$ su
etch64:/home/michael7# cd /
etch64:/# mkdir /mint32

2. Edit the x86_64-linux-gnu.conf file by adding the last five lines shown below. I used nano but any text editor will do.

Code: Select all
etch64:/# nano /etc/

Code: Select all
# Multiarch support

# chroot x86_64 system libs

After you have added the lines, select Ctrl+o (to save or "Writeout"), Enter (to confirm) and Ctrl+x (to exit).

3. Change to the /lib directory and created a symlink.

Code: Select all
etch64:/# cd /lib
etch64:/lib# ln -s /mint32/lib/

4. Run the ldconfig command (small L, not the digit 1 or a capital I).

Code: Select all
etch64:/lib# ldconfig

5. Edit the /etc/fstab file by adding the six lines shown below.

Code: Select all
etch64:/lib# nano /etc/fstab

Code: Select all
# /etc/fstab: static file system information.
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hda1       /               ext3    defaults,errors=remount-ro 0  1
/dev/hda3       /home           ext3    defaults        0       2
/dev/hda2       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0

### 32-bit chroot ###
/dev/hda5       /mint32         ext3    defaults        0
/home           /mint32/home    none    bind            0
/tmp            /mint32/tmp     none    bind            0
/dev            /mint32/dev     none    bind            0
/proc           /mint32/proc    proc    defaults        0

When finished select Ctrl+o, Enter and Ctrl+x.

6. To run Firefox, enter these commands:
Code: Select all
etch64:/lib# mount -a
etch64:/lib# chroot /mint32
root@etch64:/# su michael7
michael7@etch64:/$ /usr/bin/firefox

7. To move from user in the chroot to user in the 64-bit environment, run the exit command three times:

Code: Select all
michael7@etch64:/$ exit
root@etch64:/# exit
etch64:/lib# exit

Now, if you want to run 32-bit Firefox, you can login as su and run the 4 commands shown in item 6 above. With a few more steps, however, we can make the process very simple.

8. Log back in as su to install dchroot:

Code: Select all
michael7@etch64:~$ su
etch64:/home/michael7# apt-get install dchroot

9. Create the file /etc/dchroot.conf and add the following content:

Code: Select all
etch64:/home/michael7# nano /etc/dchroot.conf

Code: Select all
# x86_64 chroot
x86_64  /mint32

Select Ctrl+o, Enter and Ctrl+x.

10. Exit as su and run the dchroot command as shown, to make sure it works:

Code: Select all
etch64:/home/michael7# exit
michael7@etch64:~$ exec dchroot -c x86_64 -d /usr/bin/firefox

11. Create a shell script to run Firefox 32-bit from within 64-bit environment. I used the “cat” command, but nano or any other text editor will work.

Code: Select all
michael7@etch64:~$ su
etch64:/home/michael7# cat > /usr/local/bin/mint32
#! /bin/sh
exec dchroot -c x86_64 -d /usr/bin/firefox
Ctrl+d   [end of file]

12. Change the file permissions so that user can run the shell script:

Code: Select all
etch64:/home/michael7# chmod 755 /usr/local/bin/mint32

13. Exit as su and run the shell script as user:

Code: Select all
etch64:/home/michael7# exit
michael7@etch64:~$ mint32

14. And now the final touch-- create an icon for the Desktop:

K -> Debian -> Apps -> System -> KMenuEdit
Click the Internet icon to highlight it.
Select File, New Item and Item Name: Firefox 32
In the Command box, type: /usr/local/bin/mint32
(Or use "Open file dialog" icon to the right to navigate to the mint 32 shell script.)

Click the icon box in the upper right corner (to the right of Name and Description boxes).
Choose an icon from the "Select Icon" window.
Click File, Save and then close the KDE Menu Editor window.

Now, you can launch the 32-bit version of Firefox with: K -> Internet -> Firefox 32
You also can place a copy of the icon on the Desktop by right-clicking the Firefox 32 icon and selecting "Add Item to Desktop".

And that's it! Now, just click your Desktop icon for 32-bit Firefox and you can watch the video content from webpages while working in your 64-bit Etch installation.

If anyone has corrections or comments for improvement, please post and I'll incorporate them. While I've used this method 3 times successfully, I'm sure there are ways to make it better.

Live simply so that others may simply live.
Debian Social Contract
User avatar
Posts: 125
Joined: 2005-05-14 22:33

Postby tug » 2007-02-17 08:40

Many thanks for the excellent HOWTO michael7.
I was having trouble with chroot and also tried shane's idea but had problems. From your version I have seen where I was going wrong.

I changed mint32 for etch32 and changed the shell script from mint32 to iceweasel32 other than that I followed your instructions and now have a perfect chroot into my Etch32 install.

Keep up the good work I beleive we can do with more of these easy to follow howtos as some of us do need time to get up to speed.
Posts: 2
Joined: 2006-09-19 19:05

Postby Red Knuckles » 2007-06-08 20:23

I did this but when Iget to step 6 it opens Iceweasel 64 bit. Wonder what I'm doing wrong???
Red Knuckles
Sabayon 3.4 AMD64, Debian SID AMD64, Ubuntu 7.04 AMD64,
ASUS M2NPV-VM, AMD Athlon64 X2 4800+, 2GB DDR2 800
Red Knuckles
Posts: 96
Joined: 2006-10-18 00:26
Location: Colorado, USA

Postby Red Knuckles » 2007-06-08 20:30

Red Knuckles wrote:I did this but when Iget to step 6 it opens Iceweasel 64 bit. Wonder what I'm doing wrong???

Red Knuckles you blithering idiot. You first have to CLOSE Iceweasel 64 bit THEN run '/usr/bin/firefox' and THEN your bleeping Mint [in my case also] will open with your @#$%^ Flash, Adobe Acrobat, and Sun-Java-1.6.0 plugins. Idiot!

At any rate WOW! This works. Thanks. Now to go create Menu Panel button.
Red Knuckles
Sabayon 3.4 AMD64, Debian SID AMD64, Ubuntu 7.04 AMD64,
ASUS M2NPV-VM, AMD Athlon64 X2 4800+, 2GB DDR2 800
Red Knuckles
Posts: 96
Joined: 2006-10-18 00:26
Location: Colorado, USA

Postby dmn_clown » 2007-06-18 17:05

That is one way of doing it, except that dchroot has a (bad) habit of changing switches between version numbers without documenting that fact, schroot doesn't have that problem, is better documented, and with some configurations doesn't need /home, /tmp, or /proc bind mounted in fstab.

One way schroot can be used is documented in The Debian GNU/Linux AMD64 How To.
Posts: 525
Joined: 2006-12-03 23:40

Postby hkoster1 » 2007-08-12 07:39

Nice idea to use an existing 32-bit OS on the same computer as a chroot on the 64-bit OS. :D

The only question I have is why you need to link the 32-bit system libraries to the 64-bit ones (items 2 - 5 in the OP) if you're planning on running 32-bit programmes in a 32-bit chroot. Linking would only be required when running such programmes in the 64-bit host OS, as an addition to the ia32-libs package, no?
Posts: 1265
Joined: 2006-12-18 10:10

Postby RobtA » 2008-03-02 00:58

I am about to try using the above method (sound like just what I need). I'll be using LinuxMint as the 32 provider, Debian Lenny as the amd64 main.

I already have an unused 4Gb ext3 partition that was held in reserve for something like this. But before I install LinuxMint, may I ask, what do I do about linux-swap? Does the added distro require its own linux-swap partition distinct from the one used by Debian Lenny amd64 (seems unlikely)? Does it automatically share the same linux-swap partition (seems likely)? Or do I need to install the extra distro without reference to linux-swap?
Posts: 22
Joined: 2008-02-15 19:14

Postby Jackiebrown » 2008-03-02 05:39

You are thinking too deep here.

The important part is to bind your home, tmp, proc, and dev.

The ia32 libs makes needing a chroot not really important unless you are just trying to keep the 64bit side "pure."
User avatar
Posts: 1276
Joined: 2007-01-02 04:46
Location: San Antonio, TX

Postby smihael » 2008-03-08 17:02

Thanks a lot!
Debian Testing/Unstable with KDE4

Grettings, Miha
Posts: 27
Joined: 2007-06-27 19:33
Location: Somewhere in Slovenia

Worked Great

Postby GreatGariny » 2008-06-19 05:45

Thanks. I was able to get Firefox running from my Mint install. I also used it to get Lightscribe working just by changing the command in the launcher.
Posts: 2
Joined: 2008-06-19 05:35

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest