chroot(8) on Solnix vs Linux and the BSDs

On Solnix, chroot is the illumos /usr/sbin/chroot and takes only two operands, newroot and command, with no options at all. The command is mandatory, and there is no way to drop to another user or group, which Linux, FreeBSD, OpenBSD and NetBSD all offer.

What Solnix runs

A default Solnix system runs the illumos chroot at /usr/sbin/chroot. No other variants are shipped. The Solnix page documents no options and no ENVIRONMENT section.

Differences

Compared withTopicWhat differs
all fourcommand is requiredThe Solnix synopsis is chroot newroot command, so the command is mandatory. Linux, FreeBSD, OpenBSD and NetBSD make command optional and start an interactive shell when it is omitted.
Source: Solnix chroot(8) SYNOPSIS; Linux chroot(1) SYNOPSIS; FreeBSD chroot(8) SYNOPSIS; OpenBSD chroot(8) SYNOPSIS; NetBSD chroot(8) SYNOPSIS
all fourSHELL variableThe Solnix page does not mention SHELL. Linux, FreeBSD, OpenBSD and NetBSD use SHELL, or /bin/sh when it is unset, for the default interactive shell. Linux runs it as 'sh -i'.
Source: Linux chroot(1) DESCRIPTION; FreeBSD chroot(8) ENVIRONMENT; OpenBSD chroot(8) ENVIRONMENT; NetBSD chroot(8) ENVIRONMENT; Solnix chroot(8) (no ENVIRONMENT section)
Linuxuser and group optionsThe Solnix page lists no options. Linux chroot has --userspec=USER:GROUP and --groups=G_LIST to set user, group and supplementary groups. A Linux script using them will fail on Solnix.
Source: Solnix chroot(8) SYNOPSIS; Linux chroot(1) --userspec, --groups
FreeBSD, OpenBSD, NetBSD-u and -g optionsSolnix chroot has no -u or -g. FreeBSD, OpenBSD and NetBSD take -u user and -g group. FreeBSD and NetBSD also take -G for supplementary groups. On Solnix the command runs as whoever invoked chroot, i.e. the super-user.
Source: Solnix chroot(8) SYNOPSIS; FreeBSD chroot(8) -u, -g, -G; OpenBSD chroot(8) -u, -g; NetBSD chroot(8) -u, -g, -G
FreeBSD-n and unprivileged chrootFreeBSD -n disables SUID/SGID bits for the process and its descendants. With the security.bsd.unprivileged_chroot sysctl set to 1, it allows chroot without superuser privileges. The Solnix page says only the super-user can run chroot and has no equivalent option.
Source: FreeBSD chroot(8) -n; Solnix chroot(8) DESCRIPTION (last paragraph)
Linuxworking directory after chrootOn Solnix the initial working directory is newroot. Linux changes to '/' by default and has --skip-chdir to avoid that. The Solnix page has no option to skip the change.
Source: Solnix chroot(8) DESCRIPTION; Linux chroot(1) --skip-chdir
Linuxexit statusSolnix chroot exits with the exit status of command. Linux does the same but reserves 125 (chroot itself failed), 126 (command found but not invokable) and 127 (command not found). The Solnix page defines no such codes.
Source: Solnix chroot(8) EXIT STATUS; Linux chroot(1) Exit status
FreeBSD, OpenBSD, NetBSDexit status documentationThe Solnix page documents that the exit status is that of command. The FreeBSD, OpenBSD and NetBSD pages in the bundle have no exit status section.
Source: Solnix chroot(8) EXIT STATUS; FreeBSD chroot(8); OpenBSD chroot(8); NetBSD chroot(8)
all fournested chroot and redirectionThe Solnix page states that newroot is always relative to the current root, even inside an existing chroot, and that output redirection creates the file relative to the original root. The other four pages in the bundle do not say this.
Source: Solnix chroot(8) DESCRIPTION; Linux, FreeBSD, OpenBSD and NetBSD chroot pages (not stated)
all fourdevice file and tty caveatSolnix NOTES warns that ttyname(3C) cannot identify the device behind stdin, stdout and stderr after chroot, and to take care with device files in the new root. The counterpart pages do not mention this.
Source: Solnix chroot(8) NOTES; counterpart chroot pages (not stated)
OpenBSDsetuid caveatOpenBSD warns that chroot must never be installed setuid root. The Solnix page says only that the super-user can run it and has no such warning.
Source: OpenBSD chroot(8) CAVEATS; Solnix chroot(8) DESCRIPTION

Standards

  • POSIX: chroot is not a POSIX.1-2024 utility.

Writing portable scripts

  • Always give an explicit command and run chroot as root. Solnix requires both, and the options -u, -g, -G, --userspec and --groups are not common to all systems.
  • To run as an unprivileged user inside the new root, chroot first as root and then drop privileges in a helper command inside newroot, since Solnix chroot has no user or group options.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.