How to 32 bit chroot Mint x64

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
piratesmack

How to 32 bit chroot Mint x64

Post by piratesmack »

I've been playing around with Mint x64 in virtualbox, and decided to try to set up a 32 bit chroot. By using a 32 bit chroot, you can run and compile most (all?) 32 bit software on a 64 bit OS

Things you'll need:
-An installation of Mint x64
-A Linux Mint 6 (32 bit) ISO:
http://ftp.heanet.ie/pub/linuxmint.com/ ... Mint-6.iso

Got everything? Good, let's get started

First, let's create some directories:

Code: Select all

sudo mkdir -p /chroot/mint32   # A place for Mint 32 bit to live in
sudo mkdir -p /mnt/cdrom       # A place to mount the Mint 32 bit ISO
sudo mkdir -p /mnt/squashfs   # A place to mount filesystem.squashfs
Next, let's mount the LinuxMint-6.iso:

Code: Select all

sudo mount -o loop LinuxMint-6.iso /mnt/cdrom
Now mount filesystem.squashfs:

Code: Select all

sudo mount -t squashfs /mnt/cdrom/casper/filesystem.squashfs /mnt/squashfs -o loop
Copy the files from filesystem.squashfs to /chroot/mint32:

Code: Select all

sudo rsync -avHx /mnt/squashfs/ /chroot/mint32/
Make some changes to /etc/fstab to make things easier:

Code: Select all

gksu gedit /etc/fstab
-Add these lines:

Code: Select all

# Mint32 chroot
proc /chroot/mint32/proc proc noauto,defaults 0 0
/home /chroot/mint32/home none noauto,bind 0 0
/tmp /chroot/mint32/tmp none noauto,bind  0 0
-Save and exit

Now mount them with:

Code: Select all

sudo mount /chroot/mint32/proc
sudo mount /chroot/mint32/home
sudo mount /chroot/mint32/tmp
Copy some files from your Mint x64 installation:

Code: Select all

sudo cp -a /etc/{group,sudoers,shadow,resolv.conf,passwd} /chroot/mint32/etc/
sudo cp -a /etc/apt/sources.list /chroot/mint32/etc/apt/sources.list
Finally, it's time to chroot:

Code: Select all

sudo chroot /chroot/mint32
ldconfig             # update shared library links
apt-get update    # update apt sources
su USERNAME # Switch from Root to user. (It can be dangerous to run certain software as root.)
- Congratulations, now you're done

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

A few other things:

How to install 32 bit software inside the chroot:
-Just run:

Code: Select all

gksu synaptic
-And install whatever you want
- Usually, you just type the name of the program to start it.

How to install .deb packages inside the chroot:
-Run

Code: Select all

sudo dpkg -i NAME-VERSION-i386.deb
Screenshot of i686 Firefox running in Linux Mint 6 x64:
Image
Last edited by piratesmack on Fri Jul 16, 2010 1:32 pm, edited 20 times in total.
Husse

Re: How to 32 bit chroot Mint x64

Post by Husse »

Nice - we are getting questions about 32 bit apps in Mint 64 bit now
piratesmack

Re: How to 32 bit chroot Mint x64

Post by piratesmack »

Something I forgot to mention:
You may have to install the (32 bit) restricted driver for your video card inside the chroot in order to get 3d acceleration
Post Reply

Return to “Tutorials”