Build Your Own Bootable Emacs Environment

An old joke is that Emacs is a text editor with an operating system included, given that its extensibility and customization often goes far beyond traditional text editors. Part of its well-earned reputation comes from being built in Lisp which allows it to be expanded to do almost anything. Despite this in-joke in the community, though, you will still need an actual operating system to run it, but not much more than that.

This project uses User-Mode Linux (UML) as a foundation to load almost nothing other than an Emacs editor. UML is a virtualization technology that allows running multiple Linux kernel instances as separate virtual machines, so once the Linux environment is started and Emacs is compiled, the virtual machine can essentially boot straight into an Emacs environment. Some tools are needed outside of the Linux kernel like mount which allows the virtual file system to access the files needed to build Emacs, but as far as lightweight or minimalist Linux distributions go this one definitely gets at least an honorable mention.

While UML is virtualization software rather than a full-fledged Linux distribution, we would expect a similarly minimalist build could easily be done with something more hardware-based like Linux From Scratch. Emacs has been around for so long and had such a wide reach that it’s difficult to imagine a world without it. Even in more modern technology like browsers, knowing a little bit about Emacs can be an extremely powerful tool.

18 thoughts on “Build Your Own Bootable Emacs Environment

      1. “Of course, on the system I administrate, vi is symlinked to ed. Emacs has been replaced by a shell script which 1) Generates a syslog message at level LOG_EMERG; 2) reduces the user’s disk quota by 100G; and 3) RUNS ED!!!!!!

        “Ed is the standard text editor.””

        1. I’m a vi bigot. Once when I was using VMS heavily I found a VMS port of emacs. That emacs was able to run a vi emulator called “vile”.

          Eventually I found a windows port of vi called Lemmy. I got the developer to add a mode to open and write files via ftp, so I edited VMS files that way. I guess it was an early implementation of an fs-ftp type feature.

    1. It really depends on what you do. If all you do is edit a text file once a year, then I totally understand why you would want to use nano. But for me, VIM is what I use instead of visual studio, excel, powerpoint, indesign, my diary, my notepad, etc etc etc. VIM isn’t just something you use as a simple text editor, it’s a software suite inside a single executable. You can modify it to do almost anything you want. If you put me in front of nano I get really confused and annoyed. I’ll stick to “VI VI VI, the editor of the beast” – Richard Stallman

  1. User Mode Linux! Awesome! Sadly, the article doesn’t say how they built their UML kernel, but my impression was that UML was abandonware since ca 2007 (see the 2.6 kernel you can download from the UML website).

    Has anyone built a modern (Kernel 5 or 6 series) Linux as UML? I’d guess their SKAS patches won’t apply anymore, so things are probably slow…

    1. I believe the UML patchset would have been abandoned when it was mainlined into upstream. Since 2.6 it’s been a built-in feature of the kernel; still around, but no longer a separate project.

      1. The host side, including the old SKAS patches, is builtin. The guest side is simply a kernel built for UML as a target.

        It’s still very useful. One thing it doesn’t allow you to do though is run a 32-bit guest kernel on a 64-bit host.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.