Install bundled 32-bit system in 64-bit system

From ArchWiki
Revision as of 06:25, 20 October 2006 by Jf (talk | contribs) (Install the base 32 bit system)
Jump to: navigation, search

Arch64 Install bundled 32bit system:

Note that this script don't try to change anything out of the 32bit directory. I'm no expert so there is maybe errors or some "bad things".

This howto is just for those who really need to run 32 bit apps and to install it easyly. As Arch64 try to be a pure 64 bit distro, it seems the devs won't provide any compatibility libs, this system seems to me the cleaner.

Install the base 32 bit system

We create the repository.

mkdir /opt/arch32
vim /etc/pacman.d/current

Here you'll have to replace in the first address x86_64 by i686. Don't forget to revert it at the end of the howto or your system can be screwed when you install something.

You might also want to create a separate pacman.log LogFile for your 32-bit chroot environment (in order to be able to track the "32root" pacman/package changes properly/not mess up your current 64-bit pacman.log). Again, don't forget to change this back too at the end of this howto unless you want to mess up your pacman logging.

vim /etc/pacman.conf

Change the 'LogFile' directive accordingly.

Now proceed to sync up pacman:

pacman --root /opt/arch32 -Sy

Now we can install the base packages:

pacman --root /opt/arch32 -S autoconf automake bash bin86  binutils bison bzip2 coreutils cpio cracklib db dcron dhcpcd dialog diffutils e2fsprogs ed file filesystem findutils flex gawk gcc gdbm gen-init-cpio gettext glibc grep groff grub gzip initscripts iputils jfsutils kbd kernel-headers klibc klibc-extras klibc-udev less libpcap libtool libusb licenses lilo logrotate lshwd m4 mailx make man man-pages mkinitcpio mkinitrd mktemp module-init-tools nano ncurses net-tools openssl pacman pam patch pciutils pcmciautils pcre perl popt procinfo procps psmisc raidtools readline reiserfsprogs rp-pppoe sed shadow slocate sysfsutils syslog-ng sysvinit tar tcp_wrappers udev usbutils util-linux vim wget which wireless_tools xfsprogs zlib

You can now revert your pacman.d/current file to x86_64. Also change back your 'LogFile' in /etc/pacman.conf.

/etc/rc.d/arch32 rc script

To initiate the 32bit environment at startup, create a script in /etc/rc.d/ called "arch32":


. /etc/rc.conf
. /etc/rc.d/functions

case $1 in
        stat_busy "Starting Arch32 chroot"
        mount --bind /proc /opt/arch32/proc
        mount --bind /proc/bus/usb /opt/arch32/proc/bus/usb
        mount --bind /dev /opt/arch32/dev
        mount --bind /dev/pts /opt/arch32/dev/pts
        mount --bind /dev/shm /opt/arch32/dev/shm
        mount --bind /sys /opt/arch32/sys
        mount --bind /tmp /opt/arch32/tmp
        mount --bind /home /opt/arch32/home
        add_daemon arch32
        stat_busy "Stopping Arch32 chroot"
        umount /opt/arch32/proc/bus/usb
        umount /opt/arch32/proc
        umount /opt/arch32/dev/pts
        umount /opt/arch32/dev/shm
        umount /opt/arch32/dev
        umount /opt/arch32/sys
        umount /opt/arch32/tmp
        umount /opt/arch32/home
        rm_daemon arch32
        $0 stop
        sleep 1
        $0 start
        echo "usage: $0 {start|stop|restart}"
exit 0

Then allow execution of this script:

chmod +x /etc/rc.d/arch32

And add it to "/etc/rc.conf":

DAEMONS=(syslog-ng network netfs crond arch32 gdm)

Configure the new installed system

First copy some meanfull config files

rmdir /opt/arch32/home/ftp
/etc/rc.d/arch32 start
cp /etc/passwd* /opt/arch32/etc
cp /etc/shadow* /opt/arch32/etc
cp /etc/group* /opt/arch32/etc
cp /etc/locale.gen /opt/arch32/etc/
cp /etc/rc.conf /opt/arch32/etc/
cp /etc/resolv.conf /opt/arch32/etc
cp /etc/profile.d/ /opt/arch32/etc/profile.d

Now chroot in your new system

xhost +
chroot /opt/arch32

Fix some future locales issues

pacman -Sy ttf-bitstream-vera ttf-ms-fonts

Note that you can install any other font. You just need one or yours apps won't display any text.

Also, keep in mind that the "/etc/pacman.conf" file from the 32bit environment is the default one. So if you want to use "community" repositories, don't forget to edit it !

Now you can install any apps you need (*note for firefox with the nonfree flash plugin, you will need to install libxmu as well! Apparently this dependency has not been taken care of yet), and then clean the pkgs to win some place.

pacman -S acroread opera
pacman -Scc

Execute a 32bit apps from a 64bit env

Download and install dchroot

Download "dchroot" from the AUR ( and install it on your 64bit system (outside the chroot):

tar xvf dchroot_0.12.1.tar.gz
cd dchroot-0.12.1
./configure --prefix=/opt/dchroot
make install

In my case, there has been an error at the end of the "make install". But everything works anyway ... so I haven't care about it.


Now, we must edit the configuration file (/etc/dchroot.conf) and add this line:

arch32 /opt/arch32

Execute 32bit apps

Finally, to use your 32bit apps:

/opt/dchroot/bin/dchroot -d "opera -notrayicon"
/opt/dchroot/bin/dchroot -d acroread

It will launch Opera, without the systray icon, from your 32bit environment. The second example is for Acrobat Reader, where there is no "" since we don't need to add switches.