Running Raspberry Pi OS in a VM: VirtualBox, QEMU and VMware Compared
- Published
- Author
- Patrick Fromaget
- Reads
- 434
VirtualBox, QEMU and VMware Workstation can each run Raspberry Pi OS on a Windows, Linux or macOS PC. Each has different setup steps and display quirks.

A virtual machine is the cheapest way to get a Raspberry Pi desktop running when you don't have the board in front of you. Three hypervisors cover most cases: VirtualBox, QEMU and VMware Workstation. They run on Windows, Linux or macOS, and each one needs a slightly different path to a working install. Here's how they compare and where each one trips people up.

Why bother with a VM at all?
The obvious case is that you don't own a Pi yet. Booting Raspberry Pi OS in a VM lets you test the software, check whether a package or workflow suits your project, and decide whether the hardware is worth buying. If that's the only goal, though, a cheap board may get you further. The source suggests a Pi Zero kit or a Pi 3B+ is enough for most projects, and it's hard to argue with that for a learning setup. A real board also gives you GPIO, real peripherals and real performance numbers, none of which a VM can reproduce.

The second case is mobility. If you're hooked on Pi work but can't carry the board everywhere, a VM on your laptop keeps the environment intact. You can script against it, build packages and keep notes without touching a physical device.

The third case is the one I'd lean on hardest: snapshots. A VM can capture the full state of the system and roll back to it. On a Pi, a broken configuration usually means reflashing the SD card, reinstalling packages and rebuilding your environment from memory. In a VM, you snapshot before a risky change and revert if it goes sideways. For anyone testing kernel options, package upgrades or init changes, that alone justifies the setup.

There's also a performance argument, and it needs qualifying. Running the desktop in a VM lets you draw on your PC's CPU, memory and storage, which can save time on heavier tasks. That advantage shrinks with newer hardware. The source makes this point directly, noting the gain is "even less true" with the Raspberry Pi 5 8GB and the Pi 4 8GB. If you're comparing against a current Pi, measure before assuming the VM is faster.

The image problem: use the ISO, not the .img
Most people hit the same wall first. The default Raspberry Pi OS image on the official download page is a .img file, and that format won't boot in many virtualization tools. Forum threads often claim you can't emulate a Pi on a PC at all, because the Pi uses an ARM processor and a PC doesn't. That's a misreading of the situation. The workaround is a different file.

Go to the Raspberry Pi OS downloads page and scroll to the bottom. There's an ISO image there that works with these hypervisors. The source recommends downloading it with a torrent client, which it describes as much faster than a direct download. Whichever route you take, plan for a large file and check what you've downloaded before you point a hypervisor at it.

Whichever hypervisor you pick, you'll be using the ISO for the install and then pointing the VM at a virtual disk. The ISO itself is a boot medium, not a finished system, and that distinction drives most of the steps below.

Option 1: VirtualBox
VirtualBox is an open-source hypervisor developed by Oracle. It runs on Windows, Linux, macOS and Solaris, and it can virtualize a wide range of guest operating systems. For most people starting out, it's the easiest of the three to get working.

Installing VirtualBox
Download the installer for your host system from the VirtualBox downloads page. The install is simple: launch the installer and keep the default options. On Windows you may see an error asking for the Microsoft Visual C++ Redistributable. Microsoft publishes that package, and installing it clears the error.

Creating the virtual machine
Click New in the top bar and fill out the form. Give the VM a name, choose a storage location and select the ISO you downloaded. Set the OS type to Linux and the version to Debian 13 Trixie (64-bit).

On resources, the source says 1GB of memory is enough to boot, but it recommends at least 2GB. For storage, 16GB is a reasonable minimum. Adjust CPU and memory in the same form if your host has headroom. Click Finish on the summary to create the machine.

The display workaround
This is the step most likely to bite you. The source notes that, as of its update, starting the VM with the default video settings causes it to crash. The fix is to open Settings, go to the Display tab, raise Video Memory to 128MB and tick Enable 3D Acceleration. Click OK to save before you start the machine.

Live environment first, then install
Start the VM. When the boot menu appears, select Run with persistence and press Enter. That loads Raspberry Pi OS as a live Linux session without installing anything to disk. If you only wanted a look around, you can stop here.

For a traditional VM you can keep, double-click the Install Raspberry Pi OS icon on the desktop. The wizard walks through the following steps:

- A Welcome page opens the installer.
- Choose Locale and Keyboard settings. Change the defaults if you aren't in the UK, since the image defaults to UK settings.
- On the Partitions tab, choose Erase Disk for automatic partitioning. This wipes only the virtual disk you created for the VM.
- Set a username and password.
- Review the summary and click Install.
- Wait while files copy, then click Done to restart.
Booting the installed system
The restart will drop you back into the live environment, because the ISO is still attached. Shut the VM down and detach the image. Open Settings, go to the Storage tab, select the ISO, then use the DVD icon dropdown to choose Remove Disk from Virtual Drive. That ejects the image so the VM won't boot from it again.

Start the VM. This time you should see the traditional Linux bootloader, and the machine should come up in the installed Raspberry Pi OS Desktop. At that point the VirtualBox setup is done. The source points to its 27 beginner tips for configuring the system.

Option 2: QEMU
QEMU is an open-source machine emulator and virtualizer, written by Fabrice Bellard and released under the GPL. It can run many guest systems. Paired with KVM on Linux, it can run VMs at much closer to native speed. QEMU runs on Linux, macOS and Windows, though the experience differs a lot between them.

Installing on Linux
On Debian and Ubuntu, QEMU is in the standard repository:

sudo apt install qemu-system-x86 qemu-utils
Other distributions have their own package names:

RedHat/CentOS: yum install qemu-kvm SUSE: zypper install qemu Arch: pacman -S qemu-desktop
QEMU is a command-line tool at heart. If you run a desktop environment, install Virtual Machine Manager as a GUI front end. On Debian or Ubuntu, that's:

sudo apt install virt-manager libvirt-daemon-system
Reboot after installing so your user permissions take effect. If you hit trouble on Ubuntu, the source points to a separate guide covering that distribution. It also notes the steps are similar on most others.

Installing on macOS and Windows
On macOS, install QEMU with Homebrew (brew install qemu) or MacPorts (port install qemu). On Windows, download the latest installer from the QEMU downloads page, run the .exe and follow the prompts. Windows lacks virt-manager, so the source suggests QtEmu as a graphical alternative. It also says VirtualBox or VMware are better suited to Windows, and I'd agree unless you specifically need QEMU's behavior.

Creating the virtual machine
Launch Virtual Machine Manager and click the icon to create a new VM. In the first step, choose local install media, because you already have the ISO. Browse to the Raspberry Pi OS image you downloaded.

Auto-detection of the operating system doesn't work with Raspberry Pi OS, so pick the OS manually. Choose Debian 13 for the Trixie image. Then finish the wizard. The source recommends 2GB of RAM, 2 CPUs and 16GB of disk where possible, though it says the VM would probably still run with less.

From the interface, start the VM. You'll see the same boot menu as in VirtualBox. Select Run with persistence and press Enter to reach the live environment. To install, double-click the Install Raspberry Pi OS shortcut.

Installing inside the VM
The installer steps mirror VirtualBox: pick a language at the Welcome page, set Locale and Keyboard, choose Erase Disk on the Partitions tab, set a username and password, confirm the summary and click Install. When copying finishes, click Done to restart.

The source says this route has fewer hoops than the VirtualBox method, and that matches my experience of the workflow. After the reboot, Raspberry Pi Desktop starts directly, with no need to detach an ISO by hand. Check whether the disk is still attached to the virtual drive if the machine comes back into the installer, though. The source's VirtualBox steps assume that's the usual cause.

Command-line boot
You can also launch an image directly from the shell. The source gives this example:

qemu-system-x86_64 -hda IMAGE.iso -m 1024 -net nic -net user
That passes the ISO as a hard disk, allocates 1024MB of memory and sets up user-mode networking. It's useful for scripting or quick tests, but the GUI is easier for a first install.

Option 3: VMware Workstation
VMware Workstation is a proprietary hypervisor. The source describes a free version for non-commercial use, which the installer and first-run prompts refer to as Workstation Player. Workstation can emulate most operating systems. VMware also sells larger-scale tools for running virtual machines in production, but those are outside this comparison.

On ownership: the source notes VMware is now part of Broadcom, and downloading requires a Broadcom account. Plan for that sign-in before you start.
Installing VMware
Download VMware Workstation from VMware's website. The source says there are Linux and Windows versions and that it wasn't sure about macOS, so check the platform list before you commit to this route on a Mac.
On Windows, run the .exe to start setup. On Linux, start the bundle from a terminal:
sudo sh VMware-Workstation-Full-VERSION.x86_64.bundle
Keep the default options. No license key is needed at this stage. On first launch, choose the option indicating non-commercial use, and the software is ready.
The source ran into a problem on Linux: the kernel modules didn't install from the version listed on the site. It used a newer release to get past that. If you see the same failure, a newer build is the fix the source found.
Creating the virtual machine
Select Create a New Virtual Machine and choose the Typical setup. Pick the option for an installer disc image file (ISO) and browse to your download. For the guest OS, choose Linux and Debian 13. Name the VM and change the install folder if you want.
For disk space, the source says you can leave the default of 20GB or drop to 16GB to save room. Click Finish and Close.
Before the first start, open Settings, go to the Display tab and tick Accelerate 3D Graphics. As with VirtualBox, the source says the default video settings crash the VM as of its update, so this tick matters. Click OK.
Boot and install
Click Start in the top bar. At the boot menu, choose Run with persistence. That brings you to the live Linux environment. If you only need the live session, you're finished. For a full install, double-click the Install Raspberry Pi OS shortcut.
The source notes a known issue here. With the trixie image in VMware Workstation, the live environment works but the Install Raspberry Pi OS wizard doesn't start properly. If you hit that, the VirtualBox or QEMU route is the workaround. Otherwise, the wizard steps are the same as before: Welcome, Locale and Keyboard, Erase Disk, username and password, Install, then Done to restart. The source says the install finishes with a working Raspberry Pi Desktop VM. VMware Tools is optional. The source says you can install it, but it isn't required.
What to check after the install
Once the VM works, you're at the point where the environment matters more than the hypervisor. The source flags three areas.
- Networking. In all three setups, the source had working network and Internet on first boot. Your own environment may differ and the network card might not come up on the first boot. You may also want the reverse, isolating the VM from the network entirely.
- File sharing. A shared folder between host and guest is useful when you develop on the host and run the code in the VM.
- Hardware. Screen resolution, disk size and RAM are all adjustable. Set them to match the work you plan to do.
Beyond that, the source's point holds: once Raspberry Pi OS is running, most tutorials for the chosen hypervisor apply, because they depend on the hypervisor more than on the guest. For Pi-specific setup, the source suggests the usual remote access tools, SSH and VNC, plus printer setup and a curated app list. Those work the same way they would on a physical Pi. Two more points from the source. First, you can flip the arrangement and use a Pi as a cheap hypervisor, with VMware ESXi or Proxmox, or run a Windows VM on a Pi. Second, the source encourages moving to a real board after your first tests. For GPIO, real-time behavior and accurate performance numbers, the VM only gets you so far. The practical takeaway is simple. Use the ISO, not the .img, and set the video memory and 3D acceleration before the first boot in any of the three hypervisors. If you do that, the install is mostly the same wizard you'd see on a Pi, and you can snapshot before anything risky.