QEMU lets you run an virtual machine emulated on a variety of hardware.
It doesn't have a graphical console, or any way to save a VM's state.
However, changes made to the image during operation are permenant.
You can make a layered file so that your changes are separated out from the base image.
Run the binary specific to the architecture you want to emulate, such as
-M some-machineto emulate a specific machine.
-m 2048megabytes of memory
-drive format/raw,file=my-os-disk.imgput in a disk
-append some stuffput in a kernel command line, e.g. to specify the boot partition with
Raspberry Pi Specifics
curl https://raw.githubusercontent.com/dhruvvyas90/qemu-rpi-kernel/master/kernel-qemu-4.4.34-jessie > kernel-qemu qemu-system-arm \ -m versatilepb \ -cpu arm1176 \ -m 256 \ -kernel kernel-qemu ## Whatever else you want
/etc/fstab likely entries about the memory card reader by default. This means that qemu will boot it in emergency mode, in which case lots of things won't work (like the network).
The default network (equivalent to
-net nic -net user) works, but is slow. Ping doesn't work by default.
- network device on the emulated guest machine.
- makes a network device on the host machine available. You may have to sudo.
- Virtual Distributed Ethernet (VDE)
- useful for when you have multiple VMs.
- Usermode network
- should give magical transparent network access.