Evaggelos Balaskas - System Engineer

The sky above the port was the color of television, tuned to a dead channel

Blog
Posts
Wiki
About
Contact
rss.png twitter linkedin github gitlab profile for ebal on Stack Exchange

ebalaskas: Create a #chroot 32bit... »
  -  
« ebalaskas: In 1993 by Richard...
Apr
05
2012
Create a 32bit chroot enviroment inside your 64bit archlinux
Posted by ebal at 17:17:15 in blog, planet_ellak, planet_Sysadmin

As you may already know, you can install a 32bit linux distribution into a 64bit machine.

Many people are keep telling me, that they are still using a 32bit installation cause of some (not always opensource) applications which havent yet built up for 64bit kernel.

Lately i came into a same experience, when trying to access my android mobile through a usb, using google’s android platform tool: adb.

Android SDK has only a 32bit flavor.

Many distros support multi-lib (libraries) repositories that you can add to your linux box and use 32bit libs & applications inside your 64bit installation.

Of course this method isnt only for 32bit but also if you want to have different versions of the same shared object and dont want to rebuild your packages.

I find this method a lot messy and i dis-approve setups like that.

The alternative method is to use GNU’s core utility: chroot.

Change root directory (run command or interactive shell with special root directory) is extremely easy to setup. Till now perhaps you have listened that chroot is to jail exposed services, but in fact you can build your own environments for clean development or testing applications or whatever you have thought.

You dont even need to have an extra partition or even reboot your linux box!

The archlinux package manager aka pacman has a “root device” parameter so in fact you can create a new chroot archlinux enviroment like adding a new package in your existing linux box!

With the below script you will setup a new 32bit enviroment into your archlinux machine:


export ROOT=/arch32

mkdir -pv $ROOT/var/cache/pacman/pkg/ $ROOT/var/lib/pacman/

pacman -v --arch i686 -r $ROOT --noconfirm -Sy base

mount --bind /dev $ROOT/dev
mount --bind /proc $ROOT/proc
mount --bind /sys $ROOT/sys

chroot $ROOT

If you need to open gui apps from your chroot env, you must type:


xhost +

from your primarly OS.

Tag(s): archlinux, chroot
    Tag: archlinux, chroot
ebalaskas: Create a #chroot 32bit... »
  -  
« ebalaskas: In 1993 by Richard...

Search

Admin area

  • Login

Categories

  • blog
  • wiki
  • pirsynd
  • midori
  • books
  • archlinux
  • movies
  • xfce
  • code
  • beer
  • planet_ellak
  • planet_Sysadmin
  • microblogging
  • UH572
  • KoboGlo
  • planet_fsfe

Archives

  • 2025
    • April
    • March
    • February
  • 2024
    • November
    • October
    • August
    • April
    • March
  • 2023
    • May
    • April
  • 2022
    • November
    • October
    • August
    • February
  • 2021
    • November
    • July
    • June
    • May
    • April
    • March
    • February
  • 2020
    • December
    • November
    • September
    • August
    • June
    • May
    • April
    • March
    • January
  • 2019
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2018
    • December
    • November
    • October
    • September
    • August
    • June
    • May
    • April
    • March
    • February
    • January
  • 2017
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2016
    • December
    • November
    • October
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2015
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • January
  • 2014
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2013
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2012
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2011
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2010
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2009
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
Ευάγγελος.Μπαλάσκας.gr

License GNU FDL 1.3 - CC BY-SA 3.0