2

Is there any software around that allows me to run multiple virtual hosts in one raspberry pi?

Edit: The sentence above is what I want to get answered. Please do not make assumptions of what I want to do or make interpretations of what I am proposing if those assumptions/interpretations are used as a rationale for posting an answer that don't answer that very question in the topmost sentence.

Edit continued: the rest of this question is a clarification intended to avoid that answers are posted that a.) don't answer if there are virtualization software and b.) discuss whether or not I need to use virtualization, which really is not the topic of the question.

(end of edit)

No, my question is not intended to put multiple x86 servers into the Raspberry Pi, nor do I have x86-based virtualization software like VirtualBox in mind, but rather.

What I have in mind is something that allows me to create tiny machines which are capable of talking TCP/IP and then perhaps do some small task, more for demonstration and/or testing purposes.

Once upon a time, Linux servers could boot up and run using 4MB of RAM, so creating something runnable that can be crowded into a Raspberry Pi should be possible, even if it would require some minimalism.

1

Once upon a time, Linux servers could boot up and run using 4MB of RAM

Still not impossible, I think, with an appropriate kernel, etc. Certainly there are embedded systems out there in this boat. Exactly what you mean by "server" will determine the resource requirements, but raspbian sans GUI, with sshd (== a server) running, seems to be <20 MB.

Anyway, the requirements of the system inside the virtual machine are not the only requirements -- the machine itself needs resources in order to exist.

What I have in mind is something that allows me to create tiny machines which are capable of talking TCP/IP and then perhaps do some small task

That describes an application, not an entire system. If all you need to do is networking and "some small task", you don't need a VM to do it. You just need a program.

Virtual machines, aka. emulators, have three primary purposes:

  1. To emulate foreign hardware so you can test/develop/run software built for that hardware.

  2. To emulate native hardware in a bare metal state so you can run software which requires bare metal to operate (such as an operating system).

  3. As a sandbox for security purposes.

If what you want to do does not fall into one of these categories, there's no point to a VM unless your goal is to play with VMs. In which case, what you have in mind is "virtualization software like VirtualBox" -- just not VirtualBox itself, since it is unavailable, I think. I don't see OpenVZ, either.

What I do see is libvirt, which serves as the foundation to a number of such things. Searching for "raspberry pi hypervisor" turned up a couple of possibilities:

The problem with these is they look like x86 emulators, and methinks this will cripple the pi if you all you really want is a container. The most promising hit is this one:

Since LXC turns up via apt-cache search on Raspbian. That's what I'd look into first.

  • This is a good answer and you almost took the leap and answered whether or not there is any virtualization software around on the Raspberry Pi. If you just answer that question (you can do an edit of your answer) and be your answer a "yes there is a package called BLEH-EMU" or "No there is not anything", I will accept your answer straight off! And yes, your are right, I want a program, but in order to save some time, I would like that program to be a virtualization server, hosting a bunch of small VMs ;-). – IllvilJa Nov 26 '13 at 12:20
  • I've added what I found. You might want to ask a question on U&L unix.stackexchange.com/questions about specifically what you want to do, explaining you think the simplest root is a VM (maybe it is, maybe it isn't), etc. – goldilocks Nov 26 '13 at 14:27
  • Thanks! Answer accepted! Just as a sidenote: I took the opportunity to ask a workmate about this, and he doubted the Raspberry Pi had a processor which supported virtualization. Next step really is to buy a Raspberry and start trying out virtualization on it and see how that works. – IllvilJa Nov 26 '13 at 14:56
0

What you are proposing to do is not virtualization but simply the running of multiple processes each effectively acting as a container for your demonstration tasks.

This is achievable by writing a thread-safe process scheduler. Each invocation of which can control a task. Interprocess communication could be achieved by IP if you wish or many other means. The whole scheduler should fit well within 1Mb.

This is not particlarly difficult for an experience programmer.

  • Compared to using small virtualized servers (which is a tried and true solution for getting what I want, more or less for free, and as a bonus the ability to create an independent DHCP server or DNS server) your proposal requires far from trivial development work (coding, testing, debugging, maintaining) that at the end of the day only provides part of what I want (especially if I implement it in a way that is "not particularly difficult for an experienced programmer"). The solution is tempting, I admit, but there are issues simulting a host without a "real" virtual host. – IllvilJa Nov 26 '13 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.