Ask HN: tiny VMs
I've searched in vain, so I ask you folks:
Is there a tiny Linux distro aimed at running in a VM (i.e. not buckets of drivers in there for all the things the VM doesn't have; rather a very thin light kernel because its all backed by the VM)? Perhaps even set up for an external x running on the host? Ideally with a packaging system built around single-shot apps? So I can have a VM for a browser, and another for a mail app and so on, each with a tiny footprint?
Host would be Windows or Linux.
35 comments
[ 4.6 ms ] story [ 83.9 ms ] threadas for apps and packages, i don't care for most distros' dependency systems, but the only downside is more files on disk -- and who really cares if there's an extra 25MB of stuff you never use on there, assuming you have the space.
There are a bunch more differences like this. If it's like userspace, in many cases the dynamically loaded symbols also involve a level of indirection in order to access them since they have no fixed address at link time, which results in a small performance hit.
Modules also include metadata which remains for as long as it is loaded, but I think this is negligible.
Yes, one could add the gui afterwards, but something minimally configured already would be a timesaver...
If the original poster is looking for a VM to distribute an application, JeOS is a reasonable place to start.
On the other hand if the original poster wants to run a VM for every application he will (likely) want to look for a VM platform that dedups memory, a la ESX (though that's a bare metal server hypervisor)
If the original poster just wants a secure enivornment to run apps, something like VMware ACE may work better which allows you to lock down/filter access to USB storage, network, etc.
Disclaimer: Former VMware employee.
Gentoo Linux (if it's still around?) might be a good start since you can compile the entire world yourself and decide which features you do and do not want.
Gentoo is still alive and kicking. It's not that difficult to use and the documentation might be the best docs I've seen in any distribution. It's also worth mentioning that with a modern CPU, the time it takes to build software is not that long.
In fact, installing a "medium sized" application (e.g. not libreoffice) is faster with Gentoo's emerge than installing a standard Windows app. It takes about as long to download the source, compile and install with automation it as it does to navigate a web browser to a software's home page, locate download link and click "Next ->" 15 times in the installer manually.
http://www.damnsmalllinux.org/
I use it for all kinds of 'special purpose' boxes. It's an older kernel, 2.4.20 or so.
Also, with the cost per MB for memory, memory shouldn't really be an issue.
I currently have 4 running virtual machines on my Macbook Pro. Three running a pretty basic Debian install for testing (yay, Chef) and one running Ubuntu with a graphical user interface. And yet, only half of my memory is wired/active, and with expanding disk volumes, the footprint on my disk is even smaller on my memory.
[1] http://www.turnkeylinux.org/bootstrap
From the "Architecture" page:
<blockquote>Qubes lets the user define many security domains implemented as lightweight Virtual Machines (VMs), or “AppVMs”. E.g. user can have “personal”, “work”, “shopping”, “bank”, and “random” AppVMs and can use the applications from within those VMs just like if they were executing on the local machine, but at the same time they are well isolated from each other. Qubes supports secure copy-and-paste and file sharing between the AppVMs, of course.</blockquote>
(I've never used it myself though, so I can't help any further).
rPath's build system and rbuilder were made for this purpose.
http://susestudio.com/
You can spin iso's and vm images all in a web interface. (rbuilder has a flash interface. It's more powerful from teh command line but susestudio is really fast).
Red Hat/Fedora is suppose to have something (probably more than one) that's new and slick.
I run multiple TinyCore VMs in VirtualBox for safe browsing in the darker corners of the Net.
* If chrome/chromium are doing it right now, most parts of the browser should not be able to access X11 directly.
* X.org provides for two compartiments, trusted X (the default) and untrusted X (now used by ssh -X, also sux --untrusted). There are still a number of applications having issues with untrusted X (e.g. Skype doesn't work), also copy & paste don't normally work (for that you can use "xsel -o | ssh otheruser@localhost 'DISPLAY=:1 xsel -i'" or converse, bound to a key combination or panel widget), but it works well enough that I'm running Twinkle and xchat that way.
* let the apps go through VNC (Skype has issues with this, too, though, but then Skype doesn't run smoothly in a VM either (realtime audio issues))
Of course the kernel (and suid apps and apps with tempfile races etc.) are still offering a broader attack surface than a VM, so the above should be complemented with some good intrusion detection mechanism (to catch intrusions before they exploit root), for which I don't have a good suggestion.
http://www.turnkeylinux.org/
The advantage of virtualization is that it provides a very strong statement of security (if a lesser statement of performance). On the other hand Jails/Containers (see LXC) have a strong statement of performance and a lesser statment of security.
For you, I'd recommend checking out Linux Containers, because it does provide more protection than just a process, but is faster and uses less resources than a whole VM.
This is definitely a case to look at OS level virtualization[1], running a dedicated VM just for jailing a process seems a bit overengineered. SmartOS[2] might be interesting for this[2].
[1](http://en.wikipedia.org/wiki/Operating_system-level_virtuali...)
[2](http://smartos.org/)
or UML on Linux
You can then use the new "KVM tool" (http://lwn.net/Articles/447556/) to run your VMs. It's far, far lighter than QEMU and only provides a small set of virtio devices. If you're going to have all the applications run on the X server of the host, you'll basically just need virtio net. However, if you're doing this for security reasons, take note of what another poster mentions: any X client can sniff the keystrokes of any other X client. It's possible that Xnest (or the new hotness, Xephyr) could solve this problem for you, but I don't know for sure.
I have no connection to the company and have not used it, just saw them at the RSA conference this year. I think there are a number of companies providing similar solutions.