A NetBSD microVM workflow is presented to test a full C build toolchain and run Emacs inside a tiny, fast-booting VM using smolBSD. Requirements are an interactive ksh shell, the compiler/toolchain set (gcc, make, ld, headers), and Emacs for editing and debugging. A SMOLerfile (smolBSD’s Dockerfile-like config) is shown that starts FROM base,etc,comp, sets service and image labels, adds packages (pkgin, pkg_tarup, pkg_install, sqlite3, rsync, curl), and installs emacs-nox11 and gmake via pkgin. The SMOLerfile creates a minimal ~/.emacs and tweaks /etc/shrc (alias ll), and uses login -f -p $USERNAME as CMD. Because QEMU reserves Ctrl-A, a custom M-a binding is added for beginning-of-line (with M-e for consistency) to avoid the QEMU escape key conflict.
Two simple shell scripts automate build and run: smolbsd-build.sh validates NETBSD_ROOT and calls ./smoler.sh build on the chosen SMOLerfile, while smolbsd-run.sh invokes startnb.sh with -f etc/$SERVICE.conf -P -n 2 -w to use a PTY, allow VM stop from ksh, and mount a host workspace. On tested hardware the NetBSD kernel boots in about 26 ms and the VM initially consumes ~180 MB RAM; Emacs runs inside the microVM, enabling interactive development and validating portability of the C toolchain on NetBSD.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.