Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
michael7
Posts: 120
Joined: 2005-05-14 22:33

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

#1 Post by michael7 »

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 sidux.com 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: http://sidux.com/PNphpBB2-viewtopic-t-1251.html

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: http://forums.debian.net/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
Password:
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/ld.so.conf.d/x86_64-linux-gnu.conf

Code: Select all

# Multiarch support
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu

# chroot x86_64 system libs
/mint32/lib
/mint32/usr/lib
/mint32/usr/X11R6/lib
/mint32/usr/local/lib
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/ld-2.3.2.so ld-linux-x86-64.so.2
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
exit
root@etch64:/# exit
exit
etch64:/lib# exit
exit
michael7@etch64:~$
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
Password:
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
Password:
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.

2/6/07
Live simply so that others may simply live.
Debian Social Contract

tug

#2 Post by tug »

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.

Red Knuckles
Posts: 96
Joined: 2006-10-18 00:26
Location: Colorado, USA

#3 Post by Red Knuckles »

I did this but when Iget to step 6 it opens Iceweasel 64 bit. Wonder what I'm doing wrong???
Thanks,
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

#4 Post by Red Knuckles »

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.
Thanks,
Red Knuckles
Sabayon 3.4 AMD64, Debian SID AMD64, Ubuntu 7.04 AMD64,
ASUS M2NPV-VM, AMD Athlon64 X2 4800+, 2GB DDR2 800

dmn_clown
Posts: 522
Joined: 2006-12-03 23:40

#5 Post by dmn_clown »

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.

hkoster1
Posts: 1264
Joined: 2006-12-18 10:10

#6 Post by hkoster1 »

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?

RobtA
Posts: 22
Joined: 2008-02-15 19:14

#7 Post by RobtA »

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?

User avatar
Jackiebrown
Posts: 1246
Joined: 2007-01-02 04:46
Location: San Antonio, TX

#8 Post by Jackiebrown »

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."

smihael
Posts: 27
Joined: 2007-06-27 19:33
Location: Somewhere in Slovenia

#9 Post by smihael »

Thanks a lot!
Debian Testing/Unstable with KDE4

Grettings, Miha

GreatGariny
Posts: 2
Joined: 2008-06-19 05:35

Worked Great

#10 Post by GreatGariny »

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.

Post Reply