Difference between revisions of "Install bundled 32-bit system in 64-bit system"

From ArchWiki
Jump to: navigation, search
(updated man page links (interactive))
(Tag: wiki-scripts)
(archive page)
 
Line 1: Line 1:
[[Category:Getting and installing Arch]]
+
#redirect [[ArchWiki:Archive]]
[[cs:Install bundled 32-bit system in 64-bit system]]
+
[[Category:Archive]]
[[fr:Install environnement 32 sur un systeme 64]]
 
[[ja:64ビット環境に32ビット環境をインストール]]
 
[[zh-hans:Install bundled 32-bit system in 64-bit system]]
 
{{Archive|1=https://www.archlinux.org/news/phasing-out-i686-support/|2=ArchWiki:Requests#Drop of i686 support}}
 
 
 
This article presents one way of running 32-bit applications, which may be of use to those who do not wish to install the lib32-* libraries from the multilib repository and instead prefer to isolate 32bit applications. The approach involves creating a "chroot jail" to handle 32-bit apps.
 
 
 
== Installation ==
 
 
 
[[Install]] the {{pkg|arch-install-scripts}} package and create the chroot. Make sure to use a [[pacman]] configuration that does not use the {{ic|[multilib]}} repository.
 
 
 
# mkdir /opt/arch32
 
# linux32 pacstrap -C ''path/to/pacman.conf'' -di /opt/arch32 base base-devel
 
 
 
=== Settings ===
 
 
 
{{Style|"Key" configuration files is subjective}}
 
 
 
Key configuration files should be copied over:
 
 
 
# cd /etc
 
# for i in passwd* shadow* group* sudoers resolv.conf localtime locale.gen vimrc inputrc profile.d/locale.sh; do cp -p /etc/"$i" /opt/arch32/etc/; done
 
 
 
Remember to define the correct the number of MAKEFLAGS and other vars in {{ic|/opt/arch32/etc/makepkg.conf}} before attempting to build.
 
 
 
== Configuration ==
 
 
 
# linux32 arch-chroot /opt/arch32
 
 
 
{{Note|If access to the [[Xorg]] server of the host is required, allow it for a given user with {{ic|xhost +si:localuser:''chroot_user''}}. See {{man|7|Xsecurity}} for details.}}
 
 
 
It is recommended to use a custom bash prompt inside the 32-bit chroot installation in order to differentiate from the regular system. You can, for example, add a {{ic|ARCH32}} string to the {{ic|PS1}} variable defined in {{ic|~/.bashrc}}.
 
 
 
== Schroot ==
 
 
 
[[Install]] {{Pkg|schroot}} to the native '''64-bit''' installation:
 
 
 
Edit {{ic|/etc/schroot/schroot.conf}}, and create an ''[Arch32]'' section.
 
 
 
[Arch32]
 
type=directory
 
profile=arch32
 
description=Arch32
 
directory=/opt/arch32
 
users=user1,user2,user3
 
groups=users
 
root-groups=root
 
personality=linux32
 
aliases=32,default
 
 
 
=== Using Schroot to run a 32-bit application ===
 
 
 
The general syntax for calling an application ''inside'' the chroot is:
 
 
 
# schroot -p -- htop
 
 
 
In this example, htop is called from within the 32-bit environment.
 
 
 
== Troubleshooting ==
 
 
 
===Video problems===
 
 
 
If you get:
 
 
 
X Error of failed request: BadLength (poly request too large or internal Xlib length error)
 
 
 
while trying to run an application that requires video acceleration, make sure you have installed appropriate [[video drivers]] in your chroot.
 
 
 
=== Sound in Flash ===
 
 
 
[[Install]] the {{Pkg|alsa-oss}} package inside the chroot, and export the {{ic|FIREFOX_DSP}} [[environment variable]] before launching [[Firefox]]:
 
 
 
$ export FIREFOX_DSP="aoss"
 
 
 
Every chroot into the 32-bit system requires this environment variable.
 
 
 
For [[Wine]] this works the same way. The alsa-oss package will also install the alsa libraries required by [[Wine]] to output sound.
 
 
 
== Tips and tricks ==
 
 
 
=== Java in a chroot ===
 
 
 
See [[Java]]. After installation, adjust the path:
 
 
 
$ export PATH="/opt/java/bin/:$PATH"
 
 
 
=== Allow 32-bit applications access to 64-bit PulseAudio ===
 
 
 
Additional paths have to be bind-mounted to the chroot environment:
 
 
 
# mount --bind /var/run /opt/arch32/var/run
 
# mount --bind /var/lib/dbus /opt/arch32/var/lib/dbus
 
 
 
Unmount them when leaving the environment:
 
 
 
# umount /opt/arch32/var/run
 
# umount /opt/arch32/var/lib/dbus
 
 
 
Optionally add the commands to the {{ic|/usr/local/bin/arch32}} script after the other bind-mount/umount commands. See [[PulseAudio/Examples#PulseAudio_from_within_a_chroot_.28e.g._32-bit_chroot_in_64-bit_install.29|PulseAudio from within a chroot]] for details
 
 
 
=== Sound in Firefox ===
 
 
 
Create {{ic|/usr/bin/firefox32}} as root:
 
 
 
#!/bin/sh
 
schroot -p firefox $1;export FIREFOX_DSP="aoss"
 
 
 
Make it executable:
 
 
 
# chmod +x /usr/bin/firefox32
 
 
 
=== Printing ===
 
 
 
To access installed CUPS printers from the chroot environment, one needs to bind the {{ic|/var/run/cups}} directory to the same (relative) location in the chroot environment.
 
 
 
Simply make sure the {{ic|/var/run/cups}} directory exists in the chroot environment and bind-mount the host {{ic|/var/run/cups}} to the chroot environment:
 
 
 
# mkdir /opt/arch32/var/run/cups
 
# mount --bind /var/run/cups /opt/arch32/var/run/cups
 
 
 
and printers should be available from 32-bit chroot applications immediately.
 

Latest revision as of 08:48, 26 November 2017

Redirect to: