## busybox-w32

BusyBox is a single binary that contains many common Unix tools. It's often found in embedded Linux systems like routers, in Android smartphones, in Linux containers and anywhere else it would be handy to have a compact set of Unix command line tools.

busybox-w32 is a port of BusyBox to the Microsoft Windows WIN32 API. It brings a subset of the functionality of BusyBox to Windows in a single self-contained native executable.

This version of BusyBox implements well over a hundred Unix-style commands. Some of the more significant are:

ash
The BusyBox shell is based on ash. It strives to be POSIX-compatible, though it does support some features of bash. A UNIX-style shell is something like the Windows command prompt, though much more powerful. It can be used as an interactive command line or to run shell scripts (like Windows batch files, though again, much more powerful).
awk
awk is a scripting language with a particular emphasis on pattern matching. It's commonly used to process text files containing rows and columns of data.
sed
sed is a stream editor. It can be used to make automatic, non-interactive changes to text files.
vi
vi is a powerful visual editor. If you're already familiar with vi you'll know what to expect. If not you should be aware that it's not particularly intuitive: you need to learn how to use vi. Try this BusyBox vi tutorial.

Other staples of Unix shell programming, such as find and grep are also available. Most of the commands have a --help option that displays a brief description and documents the available options.

If you need the full power of bash or the other GNU utilities busybox-w32 may not be what you want: Cygwin , Gow or UnxUtils may be more suitable. However, if you need to ship some shell scripts with your software or if you need to run a Unix build script busybox-w32 may be a compact alternative. The full executable is less than half the size of the Cygwin setup program!

You can run individual BusyBox commands from a Command Prompt window:

   C:\Users\rmy>busybox uname -a
Window_NT win81 6.2 9200 i686 MS/Windows

However, for the best experience I recommend using the BusyBox shell. This is configured to run BusyBox commands without having to link each of them into your path. Set up a shortcut on your desktop to run the shell using a command like this:

   C:\path\to\busybox.exe sh -l


The last character there is a lowercase 'L' (for login).

Though I don't recommend it, it's possible to create links to each of the BusyBox applets using the command:

   busybox --install C:\path\to\directory


Omitting the directory will result in the links being made in the same directory as the busybox.exe executable you're running. The --install option creates 'hard' links which are available on NTFS filesystems but not FAT.

It's possible to remove the hard links to busybox.exe (including busybox.exe itself) by running:

   busybox --uninstall C:\path\to\busybox


Since Microsoft Windows can't delete a running executable this only works if the 'busybox' in the command above is different from the binary you're trying to delete. The command:

   busybox --uninstall -n C:\path\to\busybox


displays the links to the binary without deleting them.

If you plan on using BusyBox from the Windows command prompt you should note that the binaries provided here are configured with wildcard expansion disabled. This is the preferred option when the BusyBox shell is being used. There is a build-time setting to enable wildcard expansion but it isn't the default. More...

If you want to install a 32-bit build of BusyBox in a system directory on a 64-bit Windows system you should put it in C:\Windows\SysWOW64, which is the correct location for 32-bit binaries on 64-bit Windows. Putting it in C:\Windows\System32 will result in mysterious failures.

From time to time binary builds and source tarballs will be made available. The latest version is always busybox.exe (currently this is an alias for busybox-w32-FRP-2962-g9aae70405.exe).

The latest executable is 506,368 bytes in size. Its sha256sum is:

    af193b369c0360d7b70f975665a453018e3d9c0458af0d252d271c8b8a30e6b5

This key has been used to generate the PGP signature file busybox.exe.sig.

A 64-bit binary, busybox64.exe, is also available. It's 579,584 bytes and its sha256sum is:

    adb2360905f737cb7e58c915056f18f7b1e0843e99474ed5ce6f4bde042943ef


busybox-w32 includes the man applet. A ready-formatted man page for the current version can be downloaded here. It's only provided as an example: it just contains the help text for all the applets in an inconvenient format. It'll be picked up automatically if you position it relative to the executable like so:

   C:/path/to/busybox.exe
C:/path/to/man/cat1/busybox.1.gz


Note:

• Older binaries and the source corresponding to each binary are kept here.
• Old versions will be deleted about three years after release.
• frippery.org isn't part of your build infrastructure and comes with no Service Level Agreement.

Recent and notable changes include:

• a WIN32 implementation of iconv (which is not present in upstream BusyBox) has been added.
• the output of the ps applet has been improved. It now displays the full command line of other running instances of BusyBox.
• files with the extension .sh are treated as executable scripts. If they don't start with a #! line to specify an interpreter they're assumed to be shell scripts. As before, text files starting with a #! line are considered to be executable scripts, even if they don't have an extension.
• the realpath applet is enabled by default.
• the ttysize applet is enabled by default. It reports the size of the console window.
• the BusyBox executable includes two different sets of icons that can be used in the user interface
• the man applet searches for man pages relative to the location of the BusyBox executable as well as on MANPATH
• the timeout applet supports the same exit status as the coreutils version
• wget supports the use of https URLs
• batch files with extensions .bat and .cmd are treated the same as other executables: they're highlighted in file listings, they're searched for on the path, and tab-completion in the shell works
• when searching the path for executables the shell checks file extensions in the order .sh/.com/.exe/.bat/.cmd/no extension. To force the execution of a particular file append the required extension or a single dot if no extension is required
• the dd applet supports /dev/urandom and /dev/zero as input files
• the ln applet is enabled by default, though it only supports hard links
• invalid characters in environment variable names are replaced by underscores
• tab completion of commands in the shell includes built-in applets and excludes non-executables on PATH
• the -X shell option (which must be the first on the command line) enables Windows XP mode, where environment variables don't have backslashes replaced by slashes

The binaries are built using the MinGW-w64 toolchain on Fedora and are tested on Microsoft Windows 8.1 and 10. busybox-w32 also works on Windows XP and (to some extent) on ReactOS.

Source is available in a Git repository which is mirrored on GitHub and Gitlab. It can also be obtained using (IPv6 only):

   git clone git://git.frippery.org/busybox-w32


Bug reports can be submitted via GitHub, GitLab or by email to the address below.

Ron Yorston
15th February 2013 (updated 12th February 2019)