You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
busybox-w32 — BusyBox for Windows, trimmed for AI agents
This project is based on busybox-w32 (the Windows port of
BusyBox 1.38). It is positioned as a command-line tool environment for AI agents, and has been
trimmed of Linux-exclusive capabilities (kernel modules, init/boot, SELinux, mount/partitioning,
network configuration, /proc-based process tools, login/user management, daemon frameworks, etc.),
keeping the cross-platform toolset plus the Windows platform layer (win32/ + include/mingw.h).
One source tree, two target platforms:
Windows (primary target, the agent runtime): make CROSS_COMPILE=x86_64-w64-mingw32- mingw64_defconfig cross-compiles busybox.exe
Linux/POSIX (development and verification environment): make defconfig builds the cross-platform subset
Building (cross-compile on Linux)
./build.sh # build both Linux and Windows x86_64 versions
./build.sh linux # Linux only
./build.sh win64 # Windows only
Outputs: build-linux/busybox (ELF, ~590 KB, 194 applets), build-win64/busybox.exe
(PE32+, ~712 KB, 179 applets). Smoke-test the Windows build with wine:
WINEDEBUG=-all wine build-win64/busybox.exe --list.
Manual steps:
make mrproper # O= out-of-tree builds require a clean source tree
mkdir -p build-linux && make O=build-linux defconfig && make O=build-linux -j$(nproc)
mkdir -p build-win64 && make O=build-win64 mingw64_defconfig && make O=build-win64 CROSS_COMPILE=x86_64-w64-mingw32- -j$(nproc)
Other configurations in configs/: mingw32_defconfig (32-bit), mingw32w_defconfig (32-bit UTF-8),
mingw64u_defconfig (64-bit UTF-8), mingw64a_defconfig.
The default x86_64 Windows profile is deliberately headless: it omits PE
icons/version resources and the optional per-file metadata lookups. This
keeps the agent binary smaller and avoids extra Windows metadata calls on
common file operations without changing its applet set.
Usage
One binary, many commands:
busybox.exe ls -la # invoke an applet directly
busybox.exe --list # list all built-in applets
cp a b # or name a link/copy after the applet and call it directly
The built-in ash-compatible shell (aliased as sh/bash) supports pipes, redirection, wildcards and
job control; built-in applets are called directly from the shell (standalone mode), no PATH install needed.
Windows path notes: always use forward slashes (c:/path, //host/share/path); users, groups and
permissions are emulated; device-file emulation provides /dev/null, /dev/tty, /dev/zero,
/dev/urandom.
Applet reference (grouped by function)
Names in parentheses are aliases. ★ marks Windows-specific applets or features enabled only in the
Windows build.
Shell & command environment
Applet
Purpose
ash (sh/bash/lash)
Bourne-compatible shell: pipes, redirection, job control, history, line editing
hush (sh)
Smaller shell implementation with lower resource use; drop-in alternative to ash
busybox
Multi-call dispatcher: busybox <applet> <args> or busybox --list
Files & directories
Applet
Purpose
ls (dir)
List directory contents (color, sorting, timestamps, recursion)
Run a shell or command with administrator privileges (ShellExecute elevation; -c command, -t test mode)
drop / cdrop / pdrop ★
Lower the process token and run a child with normal privileges
chattr / lsattr
Windows file flags (read-only/system/hidden)
Testing & internal
Applet
Purpose
unit
Unit-test framework entry (disabled by default)
parse
Config-parsing debug tool (disabled by default)
Design notes & hints
Standalone shell: built-in applets are called directly from the shell, no PATH needed;
set BB_OVERRIDE_APPLETS (space-separated applet names) to force the use of external programs
Terminal modes: the best terminal handling is auto-detected; BB_TERMINAL_MODE=1 forces literal
ANSI escapes, BB_TERMINAL_MODE=0 forces Windows console API emulation
UTF-8 child processes (UTF-8 builds, FEATURE_UTF8_CONSOLE): at startup the console codepages
are switched to UTF-8 (65001, restored at exit) and PYTHONIOENCODING=utf-8 / PYTHONUTF8=1 are
set if unset, so output of Python / PowerShell / cmd children stays UTF-8 and matches BusyBox's
internal encoding (no more mojibake with mixed encodings). Set BB_SKIP_UTF8_CONSOLE to keep the
console codepage unchanged; programs which still emit legacy encodings (e.g. GBK) can be piped
through busybox iconv -f CP936 -t UTF-8
Device-file emulation: /dev/null, /dev/tty, /dev/zero, /dev/urandom work in redirections
and as arguments
Paths: always use forward slashes; UNC paths //host/share/path; the -X shell option prevents
conversion of backslashes to forward slashes
Performance: adding the busybox process to Windows Security exclusions improves performance
significantly
System requirements: Windows 7+ / Server 2008 R2+ (UTF-8 variants require Windows 10+)
More information
Full applet list and options: busybox.exe --list, busybox.exe <applet> --help
Development and maintenance notes: AGENTS.md (platform-layer architecture, conventions
for adding/removing applets and the ripple-effect checklist)