Raspberry Pi Virtual Machine using QEMU inside Docker Container
3.9K
Raspberry Pi virtual machine in Qemu
This is a container for emulating the raspbian lite distribution inside a qemu emulated raspberry pi.
You can get the QEMU Window via ssh -X/VNC/noVNC (http). You can also directly connect to the qemu raspberry on port 2222.
You can only connect once to one container. if you want multiple raspberrys, run the docker container multiple times.
You can preserve the image by mounting the volume /images to an persistent volume. Also if you supply it with a qemu patched raspberry pi image with the name raspberry.img qemu will start this image right away.
Attention: If you use ssh -X to get the qemu window - running instances of the qemu raspberry will be killed and boot again (which takes some time), better use novnc or vnc if you want raspberry with gui
The Docker Healthcheck checks if ssh of raspberry is reachable
It's based on DesktopContainers/base-mate
You can either connect via ssh to the qemu raspberry rasbian system or get the qemu X11 GUI, here is how you use it:
Run a background container as server or start existing one.
docker start raspberrypi || docker run -d --name raspberrypi -p 2222:2222 -p 80:80 -p 443:443 --privileged desktopcontainers/raspberrypi
2.1 Connect directly to the qemu raspberry via ssh. (Keep an eye on docker healthcheck status - ssh is available when it's healthy)
ssh -p 2222 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no pi@localhost
2.2 See the qemu environment (window) on http://localhost
Content type
Image
Digest
Size
941.8 MB
Last updated
about 9 years ago
docker pull desktopcontainers/raspberrypi