Sure, you can run Docker containers on Raspberry Pi, but what about some good traditional full system virtualization? I mean, come on, what better way is there to add a layer of secure isolation against software security vulnerabilities than to run risky software in a virtual machine like is done with web browsers? Really, I heard that Android uses virtual machines already. Okay, okay, let’s take a look.
Firs of all, this is a tough subject to search for because much of the old information is coming in at the angle of virtualizing a Raspberry Pi on an old skool x86 PC or laptop.
20191227/DuckDuckGo raspberry pi 4 virtual machines
20191227/DuckDuckGo raspberry pi 4 arm qemu
20191227/https://lb.raspberrypi.org/forums/viewtopic.php?t=249524
20191227/https://github.com/wimvanderbauwhede/limited-systems/wiki/Raspbian-%22stretch%22-for-Raspberry-Pi-3-on-QEMU
20191227/https://raspberrypi.stackexchange.com/questions/53874/how-can-i-emulate-an-x86-cpu-on-a-raspberry-pi-with-qemu
Here is some info on going the other way, running x86 programs on the Raspberry Pi. Alas, it recommends proprietary software. But we’re interested in native ARM virtualization.
20191227/https://thepi.io/how-to-run-x86-programs-on-the-raspberry-pi/
20191227/https://gist.github.com/stefanozanella/4608873
But, we’re not interested in that, we’re interested in defining the Raspberry Pi to be the desktop PC itself. So, that takes a bit more effort to search for that subject, but with some finessing, I’ve found out that there is a way. The trick is to use OpenSUSE for Raspberry Pi, here you will find just what you need with KVM and virt-manager.
20191227/DuckDuckGo raspberry pi kvm
20191227/https://medium.com/@valdiz777/setting-up-kvm-on-raspberry-pi-3-using-a-64bit-opensuse-pi3-leap-42-2-xfce-image-22faddf02f48
20191227/DuckDuckGo raspberry pi kvm arm
Ah, yes, here’s a more detailed walkthrough on building your own kernel with the hypervisor enabled, and getting KVM setup.
20191227/https://blog.night-shade.org.uk/2015/05/kvm-on-the-raspberry-pi2/
Here is more information about setting up virtualization on Raspberry Pi 4. Indeed, it is possible, and in fact it can be done better and faster than on the earlier Raspberry Pis thanks to the migration to the more standard GICv2 interrupt controller. However, there is still more software configuration and setup that must be done regardless.
This VGIC emulation patch is needed only on the older Raspberry Pis.
20200103/https://github.com/raspberrypi/linux/pull/902
And indeed, some of this software is still hot off the presses! Not too much further from the software developers from which it originated. There is still performance improvement to be made to the virtual workloads versus the physical workloads.
20200103/DuckDuckGo raspberry pi 4 VGIC virtualization
20200103/https://blog.cloudkernels.net/posts/firecracker-rpi4/
20200103/https://blog.cloudkernels.net/posts/rpi4-64bit-virt/
Hooray, this is an example of an issue that has actually been fixed with a merged pull request! Better keep an eye on firecracker by Amazon, looks like they’re onto something with their virtualization solution.
20200103/https://github.com/firecracker-microvm/firecracker/issues/1196
20200103/https://github.com/firecracker-microvm/firecracker/pull/1235
Now, if you really want to stretch things, then yeah you can conceivably run Windows 98 on Raspberry Pi through CPU emulation. For sure it’s probably fast enough for early MS-DOS, but Windows 98? Well I guess it’s worth a try to see how much is usable. Uses QEMU.
20200103/https://raspberrypi.stackexchange.com/questions/45930/is-it-possible-to-use-any-virtualization-technique-with-the-raspberry-pi-3