My Linux Distribution

by Mike Levin SEO & Datamaster, 12/16/2011

Want to run Linux Server? Here it is. Download, unzip and double-click it. It’ll pop up on your desktop. Scared of what you see? Then, just “X” out of it. No problem. If you lose your mouse pointer, press Ctrl+Alt to get it back (even on Mac). This is Levinux, my derivative distribution of Linux.

You’ll need about 12MB to download it and another 20MB to unzip it—but those requirements are almost not worth mentioning in today’s world of 100MB Browser plug-ins. You will also need a Windows PC… or a Mac… or even another Linux machine. That’s part of the beauty of Levinux—it runs with a double-click from your desktop with no install, and regardless of platform.

Think about that.

This magic is made possible by QEMU, a PC emulator written by Fabrice Bellard, which is also free and open source software (FOSS) and used as part of the Android development platform, so it’s fairly standard and unlikely to go away. I use QEMU to emulate very standard x86 PC hardware with a network connection. A very tiny, modern, text-only version of Linux runs on top of QEMU. The black window you see pop with a bunch of gobbledygook flowing onto the window up is a “virtual machine” (or VM).

The first time you run it, it may take up to 5 minutes to gather all its requirements to be a development machine. Following that, it will boot very quickly. But now you will have a nice little developer system.

Levinux is a virtual-machine-only version of Linux, designed for learning, and to have a quick, throw-away server when you need it. It is also, and seemingly contradictorily, designed to help preserve your work and your momentum as a developer (more on exactly how later). So while you reset your entire server to its initial pristine state with a double-click, making it entirely safe to experiment, somehow your code survives, ready to flow onto some future equivalent virtual machine or real hardware.

When Levinux first boots, the development platform that it builds is what I refer to as the “one virtuous path”. When Levinux is done booting for the first time, you will have the Python programming language, the vim text editor with color-coded syntax working, and the Mercurial revision control system.

If you’re totally new to Linux Server, just boot it up, ooooh and ahhhh, and feel free to “X-out” to close it. Most VM’s (virtual machines) would not survive that too often, but you can just click the Reset from [Your Platform] to reset Levinux to its original state, getting rid of any corruption you could cause. No worries here. Levinux is designed to be indestructible.

Although I advocate Python, vim and Mercurial as terrific “programming stack”, everyones needs are different. So maybe follow my one virtuous path if you’re new. But others may need their “pristine reset state” to be different than mine, with different pre-installed dependencies like Java or the C-compiler.

Upon its first startup, Levinux will execute a recipe script-file that resides directly on the host, meaning you can edit it with your Mac or Windows PC without even booting Levinux. This makes Levinux is a generic virtual appliance engine where you can morph it into different appliances by dropping in different text-based server recipes and resetting the machine. If you screw up, you edit the recipe and reset it again.

While I’m tickled pink now with this platform, it was a long, hard battle to get there. I was still stinging from Windows ASP collapsing underneath me, and made a study of it before throwing my heart and soul into something new, for fear of the vicious obsolescence cycle hitting again. I started out on Debian-based versions of Linux, which is very much like Linux on training wheels, because Ubuntu and Google Chrome both chose it, and the remote package management system was almost magically easy.

This was the beginning of my own personal re-platforming from Windows Server to Linux Server. Even without a graphical user interface like Gnome or KDE, you can still easily install software on anything Debian-based (such as Ubuntu or Mint) from the text interface, simply by typing apt-get install [program name], and 9 times out of 10 it works exactly as you hope, and you have an installed and working program, spared of most of the pain usually associated with Linux.

However, this Linux-on-training-wheels approach turned out to be too expensive (resource-wise) when it came time for me to try trimming down a 10MB version of Linux, I just couldn’t do it with Debian. Even the tool called debootstrap (with the –variant=minbase option) ends up with a >200MB version. I went on a long hunt with a very particular set of criteria, and came up with a solution with these benefits…

Benefit #1 of Levinux is accessibility. Text-base Unix is intimidating and mysterious enough to the newbie. Even just the question: “Where can I log into a Unix-like machine?” is an insurmountable obstacle to most. You might get tempted down the Live-CD or multi-boot option, where you lose the power of your comfortable current OS, or risk the health of your system respectively. If you go the virtual machine route, you are likely to get something that’s bloated and stuck in location on your current host system—not nearly as portable and flexible as you would hope from a virtual machine.

With Levinux, you get to start out on whatever desktop platform you’re comfortable with (Windows, OS X, Gnome). You can treat Linux like a genie in a bottle. But unlike other virtual machines requiring you to install virtual machine player (VMWare, VirtualBox), you can copy the virtual machine from your home Mac to your work PC, and it will boot up exactly the same without any install, carrying along with it your latest work. QEMU completely lives inside its folder, carrying its own dependencies around (exactly like a Mac OS X bundle).

Benefit #2 is size. At only a 12MB footprint compressed, and 20MB uncompressed (50 with the dev platform installed), the entire Levinux installation can be easily copied, re-downloaded, kept on USB thumb drives, or kept on Cloud drives like Dropbox. You can easily have multiple copies of it for experimenting. And because of the way the (virtual) hard drives are broken up, you can even run it directly from cloud drives like Dropbox without excessive network activity as the virtual hard drive updates. The drive for your /home/[username] files is separate from that for the system and installed apps, so each time you save something, only a tiny file containing your personal files, which gets bigger as you fill it (the qcow2 format) has to be updated on the cloud. This keeps things snappy, efficient, and highly backed up. If you have Levinux stored on Dropbox, and Drobox running on 3 machines, that’s 3 local backups automatically being run.

Benefit #3 is dissect-ability. You can sit back and study what’s going on to build the server… from your comfortable desktop environment by reading the commented file in the Reset/Server folder. In fact, before that script is run, Levinux is a completely blank slate, with just enough Linux to get the system booted and on the Internet. Depending on what file you drop in there, Levinux builds itself into different things.

Dissect-ability of recipe script is nice, but you also get a relatively tiny set of files to poke around in, making it even easier to figure things for lack of all the bloated crap other systems include by default to distract you. You can do this from a login shell, but you can also log into your virtual machine and snoop around with SFTP programs like Filezilla, so after it’s booted, you don’t really even need any Linux know-how at all to begin poking around. In the future, you can even use this connection to use your favorite text editor from the host system.

Benefit #4 is indestructibility. Even virtual machines are so much more fragile than one would expect. Simply by closing out a running window without a proper shutdown, you risk corrupting the (virtual) hard drive, much like yanking the power-cord on a PC. The Levinux virtual machine runs mostly in-memory, not committing much to the hard drive, except on the occasional time you make an edit to your home directory.

And finally, benefit #5 is update-ability. The Linux kernel is always improving, as is BusyBox and the various added-on software, like Python, Mercurial and vim. Whenever you reset Levinux, it pulls down the latest stable versions from the repository that goes with the particular Linux distribution I’ve based mine upon. If the names in the repository change with version numbers, you just have to edit the script. You’re never really updating a server so much as you are rebuilding servers from scratch. This gives you a much clearer understanding and control.

And on those occasions when Linux itself versions, you can either just grab the new virtual machine from here, or drop one or two files into location (one for the kernel and another as the initrd system snapshot). There will be much more explanation on this later.

Levinux is built on Tiny Core Linux—or more specifically, the text-only version called Micro Core Linux, which strips out the graphical window manager that we won’t be needing, making it a few MB smaller, and allows us to focus on what’s important that much more. Tiny Core Linux was itself created by Robert Shingledecker, the creator of the well-known but now dated Damn Small Linux 50MB graphical distribution. Today, he created what he calls a “nomadic” version of Linux, and it gets you 80% of the way I needed to be for a Linux lifeboat.

I considered other names for Levinux, such ad Bubble Linux, because it inflates like a bubble when you need it and pops when you’re done. Then there’s Lifeboat Linux, because it’s where you can load up your knowledge and know-how when the Titanic operating system you’re running hits the iceberg (when hardware becomes effectively free, no one will pay for Windows). I also considered Whack-a-Mole Linux because of my love for that metaphor, and TekSnot Linux to be consistent with this site. Ultimately, I chose Levinux because my wife thinks it’s an awesome idea and will let me spend time on it if I do.