Busybox
Busybox is a miniature complete UNIX-like environment. Its original purpose was to provide full UNIX functionality in embedded Linux systems.For a while, I have been using an ancient version of msys from 2002 to provide a small UNIX environment for Windows, and wanted to have a Windows port of Busybox. Ron Yorston stepped up to plate and there is a now a Windows port of Busybox, complete with Unicode support.
Download
Downloads are here:- Windows binary. I have tested this in Windows 11; it should work in older Windows versions, but no guarantees. This file is compressed with 7zip, which Windows 11 (but not Windows 10) can open without installing external software.
- Source code. I have checked, and this is the exact source code used to build the above binary.
Using the download
- Open up cmd in Windows 11
- Place busybox.exe in one’s path
- Type in busybox sh -l to start up a Busybox shell
Note that while this version of Busybox has some level of Unicode (UTF-8) support, its Unicode support is buggy. Notably, the built in Vi editor is really buggy with UTF-8 characters; they render on the screen as multiple “.” characters.
Compiling Busybox
- Install mingw
- Extract the source tallball
- export CC="i686-w64-mingw32-gcc" or what not to make the compiler one that makes a native Windows app
- make menuconfig (optional) to fine-tune how Busybox is built
- make to build Busybox
Other useful tools
In order to make the tiny *NIX environment for Windows more complete, I also have available here TCC, a tiny C compiler (source code), and Lunacy, a tiny scripting language almost identical to Lua 5.1 (source code).Further thoughts
The busybox binary is 328,819 bytes in size. TCC is 208,243 bytes in size, and Lunacy (Lua 5.1) is 136,339 bytes in size. All together, that’s only 673,401 bytes in size, well under the size of even a single 1990s 1.44 megabyte floppy (1,474,560 bytes). This is a core *NIX development environment, complete with multiple languages (C, Lua, Shell+AWK).Since we’re well under the size of even a single floppy, one question is how much more *NIX functionaltiy can we get if we add more programs while keeping all compressed archives on a single 1.44mb floppy disk.
One useful program would be git, but Git for Windows is somewhere between 35 and 50 megabytes in size. I’m sure it would be possible to make a minimal Git that is under 500k in size, but doing so is left as an exercise to the reader.
I would fix the Vi bugs with UTF-8 text first—and until when and if said UTF-8 bugs are fixed in Busybox’s Vi, I will use Microsoft’s “edit” program, which, yes, is open source these days (and, indeed, available for Linux) to edit UTF-8 files.
External links
- Busybox. The original Linux source code.
- Busybox for Windows.
- GitHub mirror of Busybox for Windows source code
- Toybox, like Busybox but BSD-licensed.
- Bvi, a port of just Busybox’s vi editor to BSD.