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.
The manual pages
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 with | Topic | What differs |
|---|---|---|
| all four | command is required | The 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 four | SHELL variable | The 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) |
| Linux | user and group options | The 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 options | Solnix 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 chroot | FreeBSD -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) |
| Linux | working directory after chroot | On 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 |
| Linux | exit status | Solnix 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, NetBSD | exit status documentation | The 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 four | nested chroot and redirection | The 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 four | device file and tty caveat | Solnix 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) |
| OpenBSD | setuid caveat | OpenBSD 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,--userspecand--groupsare 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.