LinuxCommandLibrary

linux32

Run 32-bit programs on a 64-bit system

TLDR

View documentation for the original command

$ tldr setarch
copy

SYNOPSIS

linux32 [options] [--] [program [arguments...]]

PARAMETERS

-h, --help
    Print short usage message to stderr and exit.

-V, --version
    Display program version and exit.

--
    Explicit end of options; treat all following as program args.

DESCRIPTION

The linux32 command executes a program with its process personality set to the 32-bit x86 Linux ABI, enabling 32-bit executables to run natively on 64-bit kernels that support IA-32 emulation. It invokes the kernel's personality(2) system call to adjust process traits like address limits, signal handling, and ABI expectations, ensuring compatibility without full emulation layers.

This is essential for legacy software, testing multiarch environments, or running i386 binaries on x86_64 systems. For example, prefixing a 32-bit app with linux32 tricks the kernel into treating it as 32-bit, resolving issues like incorrect syscalls or memory mappings.

If no program is specified, linux32 launches /bin/sh under the 32-bit personality, useful for interactive 32-bit shells. It works recursively for child processes. Primarily for x86/x86_64, it requires kernel support (e.g., CONFIG_IA32_EMULATION=y).

Note: Simple wrapper; does not handle library paths—use ld.so.conf or LD_LIBRARY_PATH for 32-bit libs. Deprecated in modern util-linux; prefer setarch i386 for broader arch control.

CAVEATS

Deprecated; use setarch i386 instead.
Requires kernel IA-32 emulation (CONFIG_IA32_EMULATION).
Does not manage 32-bit libraries or chroot; may fail without multilib setup.
Not for non-x86 arches.

EXAMPLES

linux32 ls
Execute 32-bit version of ls(1).

linux32 ./myapp arg1
Run 32-bit myapp with argument.

linux32
Start interactive 32-bit shell.

BEHAVIOR WITHOUT PROGRAM

Defaults to /bin/sh under 32-bit personality; useful for scripting or debugging.

HISTORY

Part of util-linux since early 2000s for multiarch support on x86_64. Symlinks to setarch logic. Marked deprecated post-util-linux 2.30 as setarch subsumes functionality.

SEE ALSO

setarch(1), linux64(1), personality(2)

Copied to clipboard