Page 1 of 25 12311 ... LastLast
Results 1 to 10 of 250

Thread: 32-Bit Chroot How-To

  1. #1
    Join Date
    Mar 2005
    Location
    Los Angeles, CA
    Beans
    28

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

    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 10:12 PM. Reason: Updated to include making a directory for cdrom0

  2. #2
    Join Date
    Mar 2005
    Location
    Los Angeles, CA
    Beans
    28

    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 08:49 PM. Reason: Updated with symlink per minuo's suggestion

  3. #3
    Join Date
    Mar 2005
    Beans
    947
    Distro
    Ubuntu 12.04 Precise Pangolin

    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. (?)

  4. #4
    Join Date
    Mar 2005
    Beans
    947
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 32-Bit Chroot How-To

    P.S.:

    sudo chmod 777 /usr/local/bin/do_dchroot
    Should be 755 -- there's no reason for this script to be world-writable.

  5. #5
    Join Date
    Mar 2005
    Location
    Los Angeles, CA
    Beans
    28

    Re: 32-Bit Chroot How-To

    Quote Originally Posted by wmcbrine
    P.S.:


    Should be 755 -- there's no reason for this script to be world-writable.
    Fixed

  6. #6
    Join Date
    Mar 2005
    Beans
    947
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 32-Bit Chroot How-To

    You have "/chroot" in most places, but "/var/chroot" for the fstab lines. They should be "/chroot" too.

    I've followed this guide (more or less), and I can confirm that sound works just by mounting /dev. For the record, that's:

    /dev /chroot/dev none bind 0 0

    in /etc/fstab. (However, I also killed esd long ago, just to get sound working on the 64-bit side, and set everything to alsa then; I don't know if that makes a difference.)

    I now have two chroots on my system -- /old32 and /new32. (/old32 is where my old distro is, but I also need /new32 for more current software, like Acroread 7.) I added "-c new32" to my do_dchroot script, since I have old32 as the default.

    Another thing I added is the "linux32" command (in the package of the same name). Put this before dchroot, and the 32-bit apps will think they're running under an i686 kernel -- which is necessary in some cases (mainly install scripts).

    Re Flash, you can install it from Synaptic. In fact there are, confusingly, two conflicting packages. I chose the big one -- the small one is apparently just a wrapper for Macromedia's installer.

    Themes are a little off for the 32-bit apps. But that could be an advantage, since it reminds me which version I'm using.

    Now we need a list of what hasn't been ported to 64-bit. (Another thread, perhaps.)
    Last edited by wmcbrine; April 8th, 2005 at 05:13 AM.

  7. #7
    Join Date
    Mar 2005
    Location
    Los Angeles, CA
    Beans
    28

    Re: 32-Bit Chroot How-To

    Quote Originally Posted by wmcbrine
    You have "/chroot" in most places, but "/var/chroot" for the fstab lines. They should be "/chroot" too.

    I've followed this guide (more or less), and I can confirm that sound works just by mounting /dev. For the record, that's:

    /dev /chroot/dev none bind 0 0

    in /etc/fstab. (However, I also killed esd long ago, just to get sound working on the 64-bit side, and set everything to alsa then; I don't know if that makes a difference.)

    I now have two chroots on my system -- /old32 and /new32. (/old32 is where my old distro is, but I also need /new32 for more current software, like Acroread 7.) I added "-c new32" to my do_dchroot script, since I have old32 as the default.

    Another thing I added is the "linux32" command (in the package of the same name). Put this before dchroot, and the 32-bit apps will think they're running under an i686 kernel -- which is necessary in some cases (mainly install scripts).

    Re Flash, you can install it from Synaptic. In fact there are, confusingly, two conflicting packages. I chose the big one -- the small one is apparently just a wrapper for Macromedia's installer.

    Themes are a little off for the 32-bit apps. But that could be an advantage, since it reminds me which version I'm using.

    Now we need a list of what hasn't been ported to 64-bit. (Another thread, perhaps.)
    Thanks, I updated and fixed the /var bit. Sound isn't working for me, perhaps I need to set everything to alsa. You can fix themes if you're so inclined by installing the ubuntu artwork and ubuntu base (I think).

  8. #8
    Join Date
    Apr 2005
    Beans
    5

    Arrow Re: 32-Bit Chroot How-To

    The do_dchroot script was giving me problems, as parameters like:

    This\ is\ a\ filename\ with\ spaces.txt
    were translated into:

    This is a filename with spaces.txt
    causing the 32-bit program (totem) to not being able to open the file.

    I solved it in the following way:

    Code:
    #!/bin/sh
    
    for arg; do
            arg=`echo $arg | sed -e 's/ /\\\ /g'`
            args=`echo $args $arg`
    done
    
    /usr/bin/dchroot -d "`echo $0 | sed 's|^.*/||'` $args"
    There should be a shorter way, however I am no expert in shell scripting.
    Last edited by remkio; April 10th, 2005 at 04:04 PM.

  9. #9
    Join Date
    Nov 2004
    Location
    Kent, England
    Beans
    27
    Distro
    Ubuntu

    Re: 32-Bit Chroot How-To

    Many thanks Crad, having followed your instructions I am now able to chroot into 32 bit hoary. I nearly gave up and returned to 32 system but am now a confirmed 64-bitter.

  10. #10
    Join Date
    Jan 2005
    Beans
    122

    Re: 32-Bit Chroot How-To

    I've followed the instructions at the head of this thread, but when I reach step 5, I get some problems.... then it all falls apart...

    Any help? Thanks!

    Code:
     ~$ dchroot -d
    Executing shell in 'hoary' chroot.
    dchroot: chdir: No such file or directory
    dchroot: Child exited non-zero.
    dchroot: Operation failed.
    ~$
    But the following happens without the -d option
    Code:
    ~$ dchroot
    Executing shell in 'hoary' chroot.
    No directory, logging in with HOME=/
    /$exit
    logout
    ~$ synaptic32
    (hoary) synaptic32
    dchroot: chdir: No such file or directory
    dchroot: Child exited non-zero.
    dchroot: Operation failed.
    :~$

Page 1 of 25 12311 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •