3 Ways to Run Raspberry Pi Desktop on a Virtual Machine

Most of the tutorials on this website are here to help you solve a specific problem on the Raspberry Pi.
But for once, we won’t do anything on the Raspberry Pi directly. Instead, we will learn how to do without: I will show you how to run Raspberry Pi OS in a virtual machine on Windows, macOS or Linux.

VirtualBox, VMWare and QEMU are three solutions to virtualize a Raspberry Pi.
These emulators can run Raspberry Pi OS on a standard PC running Windows, Linux or macOS.

And here we’ll learn how to do it with these three tools, from your favorite operating system.

These software programs can be very useful if you are a developer, you don’t have your Raspberry Pi with you, or you want to test something without breaking your installation on the SD card.
By the way, you can get a complete Raspberry Pi kit for under $30 (this one for example), so make sure the virtual machine solution is really the best one for you.

I answer your questions - Raspberry...
I answer your questions - Raspberry Pi FAQ

Download Raspberry Pi OS for PC

Download the Pi Glossary!
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!

I think this is probably the main problem you’ve encountered: where to find an image compatible with the main hypervisors?

The default image offered on the official website, which is an .img format, which can’t work on VirtualBox for example.
Looking for this image, I came across many forums that said it was not possible to emulate a Raspberry Pi on PC because it turns on ARM architecture, unlike a PC …

And finally, I ended up finding the image, directly on the official website, just above the main download.
So you can download the image of Raspberry Pi OS in ISO format before continuing this guide.
I advise you to use a Torrent client to download it, as it’s much faster.

Use VirtualBox to run Raspberry Pi OS on PC


VirtualBox is an open-source hypervisor, developed by Oracle.
It is available for most operating systems: Windows, Linux, macOS, Solaris, …
It allows you to create virtual machines on your computer and supports many operating systems to virtualize.


You can find download links for Windows, Mac, and Linux on this page: https://www.virtualbox.org/wiki/Downloads.

In any case, the installation is straightforward:

  • Download the installer corresponding to your environment.
  • Launch the installer and keep the default options.

Create the virtual machine

Launch Oracle VirtualBox now on your computer, and we will create the virtual machine:

  • Click on New in the top bar.
  • Choose a Name.
  • Type: Linux.
  • Version: Anyone.
  • Memory size: 1Gb is enough, but you can set more depending on your computer memory available.
  • Hard disk: You can keep the default options (8GB, dynamically allocated).

Our new virtual machine is available, but now you have to tell it to start on the previously downloaded iso file:

  • Click on Settings in the top bar.
  • Select Storage in the left menu.
  • Below the first controller, click on Empty.
  • On the right panel, click on the Disc icon to choose the file.
  • Select Choose a Disk File.
  • Browse to the location of the image and validate.
Raspberry Pi Bootcamp
Sale: 10% off today.
Take it to the next level.
I'm here to help you get started on Raspberry Pi.
Learn all the skills you need in the correct order.

Ok, you should have something like this:

Now we can start the virtual machine and install the Raspberry Pi Desktop:

  • Click on Start in the top bar.
  • A windows shows up to select the start-up disk, click “Start” to confirm.
  • Choose Install in the first menu.
  • Select your Keyboard layout.
  • For partition disks, you can keep the default options (use entire disk > all files in one partition > finish > yes).
  • Installation starts.
  • After a few minutes, the installation wizard will resume.
  • Confirm the bootloader installation to the master boot record.
  • Select /dev/sda.
  • Continue to reboot your new operating system.

Once the reboot is done, you will come to a first start wizard like this one:

Raspberry Pi running in Virtualbox

Choose the settings that best suits you.
Change the default password.
Update your system and reboot one last time.

Your Raspberry Pi Desktop virtual machine running in VirtualBox is finally operational!
You can now check out my 27 tips to take a good start on this operating system if you need help configuring it.

Create a virtual machine running RPI OS in QEMU


QEMU is another great open-source machine emulator and virtualizer, developed by Fabrice Bellard under GPL.
It can run many guest systems and it also can be used with KVM to increase virtual machines speed.
QEMU is available for Linux, macOS, and Windows.


The installation isn’t quite the same depending on your operating system, so I’ll briefly explain how to do this.

Linux installation:

For Debian/Ubuntu, QEMU is available in the repository so that you can install it with:

apt-get install qemu

For other distributions, it is usually available as easily via the basic commands:

RedHat/CentOS: yum install qemu-kvm
SUSE: zypper install qemu
Arch: pacman -S qemu

Mac OS installation:

QEMU is available via Homebrew or MacPorts.

brew install qemu

port install qemu

Windows installation:

You can get the last installer version following this link.
Then start the .exe file and follow instructions.

Create the virtual machine

QEMU is a command line tool.
So whatever your system you’ll have to do this :).
I give instructions for Linux; it may need to be slightly adapted if you are on another system.
In Windows, for example, you need to start the command prompt, and go to the QEMU directory (cd “C:\Program Files\qemu”).

First, create a folder for your VMs and move the image in it:

sudo mkdir ~/qemu/
mv ~/Downloads/IMAGE.iso ~/qemu/
cd ~/qemu

Now let’s launch the image in QEMU with the following command:

qemu-system-x86_64 -hda IMAGE.iso -m 1024 -net nic -net user
  • Choose Install in the first menu.
    You can choose “Graphical install”, but it’s just the same thing slower, so there is no need to do this 🙂
  • Select your Keyboard layout.
  • For partition disks, you can keep the default options (use entire disk > all files in one partition > finish > yes).
  • Installation will begin.
  • After a few minutes, the installation wizard will resume.
  • Confirm the bootloader installation to the master boot record.
  • Select /dev/sda.
  • Continue to reboot your new operating system.

Once the reboot is done, Raspberry Pi Desktop is starting:

Raspberry Pi in QEMU

A wizard will start on first boot.

  • Choose the settings that best suits you.
  • Change the default password.
  • Update your system and reboot one last time.
Master your Raspberry Pi in 30 days
Sale: 10% off today.
Download the eBook.
Uncover the secrets of the Raspberry Pi in a 30 days challenge.
Learn useful Linux skills and practice multiples projects.

Your Raspberry Pi Desktop virtual machine running in QEMU is now operational!
You can now install any apps on it, like on a real Raspberry Pi (check my selection of the 17 best apps to install at the beginning here).

Run Raspberry Pi OS on PC with WMWare Workstation


VMWare Workstation is a proprietary hypervisor distributed by VMWare, a subsidiary of Dell.
There is a free version, VMWare Workstation Player, for non-commercial use.
Workstation can emulate most operating systems.

VMWare also develops many other professional tools, which can allow you to use virtual machines on a large scale, but this is not the subject of the day :).


You can download VMWare Workstation Player on the official website.
There is a Linux and Windows version, but I’m not sure about macOS.

On Windows, just run the .exe file to start the setup.

On Linux, you have to start the wizard like this:
sudo sh VMware-Player-VERSION.x86_64.bundle

You can keep default options, and no key is needed for the moment.
On the first start, choose that you want to use Workstation Player for non-commercial use, and you are ready :).

(I had problems with Linux at first, I had to take a newer version than the one given on the site because the modules did not install. If this happens to you, now you’ll know what to do)

Create the virtual machine

We will now create our virtual machine:

  • Select “Create a New Virtual Machine”.
  • Choose “Use ISO image” and browse to your Raspberry Pi OS ISO file.
  • On the next screen, select Linux and Debian 64 bits, for example.
  • Name your virtual machine and change installation folder if you want.
  • For the disk space, you can let 20 GB or decrease it to 10 GB to save disk space on your computer.
  • Finally, click on Finish and Close.

Virtual Machine will start directly after the wizard ends:

  • Click on Start in the top bar.
  • Choose Install in the first menu.
  • Select your Keyboard layout.
  • For partition disks, you can keep the default options (use entire disk > all files in one partition > finish > yes).
  • Installation starts.
  • After a few minutes, the installation wizard resumes.
  • Confirm the bootloader installation to the master boot record.
  • Select /dev/sda.
  • Continue to reboot your new operating system.

You can choose to download and install VMWare Tools if you want, but it isn’t mandatory.

A wizard will start on first boot.

  • Choose the settings that best suits you.
  • Change the default password.
  • Update your system and reboot one last time.

Your Raspberry Pi Desktop virtual machine running in VMWare Workstation is now operational!

What to do next?

Once your virtual machine is installed, and no matter which hypervisor you choose, I invite you to follow the various tutorials on this website to set up the necessary software (ssh, vnc, …), as if you were on a Raspberry Pi.
Here are a few links to help you with this:

There are probably other things that are more dependent on the fact that your Raspberry Pi OS is on a virtual machine:

  • Network card: by default, I had network and Internet in these 3 installation cases, but depending on your environment, it might not work on first boot. Or maybe you will need the opposite: isolate the virtual machine of the network.
  • File sharing: it can be interesting to have a shared folder between your virtual machine and your computer (especially for developers, to work on your computer, and launch the application on the virtual machine).
  • Adjust the hardware: you may have to adjust the screen resolution, disk size or RAM to suit your needs.

I will not go into more details about all of this because it depends on your goals with this system.
But be aware that once Raspberry Pi is virtualized and functional, you can follow any tutorial on the chosen hypervisor to help you, it does not depend on Raspberry Pi OS most of the time.

Why do I need a virtual machine?

The following will depend on why you created this virtual machine, but I can give you some reasons why you might need a virtual machine.

Not (yet) a Raspberry Pi

Master Python on Raspberry Pi
Sale: 10% off today.
Get the eBook.
Do more with your Raspberry Pi, learn the useful concepts and take the shortcuts.
You miss half of the fun of using a Raspberry Pi if you don’t know anything about Python.

If you do not have a Raspberry Pi, but you plan to buy one, testing its capabilities on a virtual machine might be a good idea.
This allows you to have a good vision of what you will be able to do. Maybe to test, install, or program the software that you would like to use, so you can make the purchase when you’re sure.

If it’s the only reason, I would consider a cheap Raspberry Pi board to get started quickly (a Zero kit or even the Pi 3B+ are really affordable right now on Amazon). This way, you would have a real overview :).


You are addicted to Raspberry Pi, but you can’t take it everywhere?
A virtual machine on your usual computer allows you to continue your projects, even without having the Raspberry Pi with you.

More powerful

Whether you’re a tester, developer, or just curious, running your Raspberry Pi desktop on a virtual machine will help you increase power and efficiency by taking advantage of your computer’s resources.
This can save you a lot of time on some applications, even if it’s less true with the new models like the Raspberry Pi 4 8GB.


Obviously, who says virtual machine says you can create snapshots.
A snapshot and a complete image of the virtual machine at a time T.
So it becomes possible to test something, and go back if it does not happen as expected (instead of having to recreate an SD card, reinstall everything needed, etc … if we work directly on the Raspberry Pi).


If you need more help to understand everything here, or if you prefer the video version, here is a demonstration on how to do this wih VirtualBox and VMWare:

You can also subscribe to see all the news videos in your YouTube Feed:

Recommended stuff for taking it to the next level

  • Raspberry Pi 4: After your first tests in a virtual machine, you are now ready to switch to a real Raspberry Pi device. It’s really not the same, you won’t regret it!
  • Learn everything step by step: If you are afraid to get started for real, I have written a book on the topic, so it’s not that complicated! The promise is to master your first Raspberry Pi in 30 days, and it’s absolutely possible. Try it and let me know.
  • Start with the cheapest model: If your problem is the price, you can totally start with a minimal model just to see if it’s for you. If you are mainly doing this for basic things or programming, this model should be perfect.

Support me: Join the community on Patreon to show your support, get behind-the-scenes content and other awesome perks!


Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

So, we saw how to create a Raspberry Pi OS virtual machine on three different hypervisors:
– VirtualBox
– VMWare Workstation

We also saw what the benefits of virtualization could be when talking about Raspberry Pi.
It’s up to you now to launch your projects on this, good luck!

By the way, you can now use a Raspberry Pi as a cheap hypervisor, with solutions like VMWare ESXI or by installing Proxmox on your Raspberry Pi.

Raspberry Pi Resources

Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now.

Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.
Download the e-book.

VIP Community
If you just want to hang out with me and show your support, you can also join the Patreon community. I share behind-the-scenes content there and give you early access to my content. You’ll also get a shoutout when you join.
More details here.

Need help building something with Python?
Create, understand and improve any Python script for your Raspberry Pi.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now.

You can also find all my recommendations for tools and hardware on this page.

This tutorial doesn't work anymore? Report the issue here, so that I can update it!

0 0 votes
Article Rating

Patrick Fromaget

I'm the lead author and owner of RaspberryTips.com. My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with a web developer experience.

Notify of
Newest Most Voted
Inline Feedbacks
View all comments
Nicholas James
Nicholas James
3 years ago

Hi I have a question about these set ups. Are any of them able to save the exact image to an SD card that can then be put into the RPi and booted headless. Thus allowing me to set the RPi OS how I like using my virtual machine and then later run headless once I have it set up?

Amin Khattak
Amin Khattak
Reply to  Patrick Fromaget
2 years ago

VmWare or VBox uses less resources than original board, many things you dont need to install as it automatically picks from your physical machine hardware drivers etc, So accordingly, its not possible that you just do copy and paste the stuff and it starts works.

Hardware should now be upgraded to Plug and Play for ease, or preinstalled and allow to change it later.


Edwin Wierszelis
Edwin Wierszelis
Reply to  Nicholas James
2 years ago

The method presented by Raspberry Tips uses a version of Raspberry Pi desktop compiled for x86 PC. It allows you to experience GUI and maybe do some development for this environment but you cannot produce binary images for running on real Raspberry Pi hardware, which vastly differs from x86 PC. However, you can create scripts and other platform-independent code, which can be later ported to real Raspberry Pi image.

To create a bootable SD card for Raspberry Pi you need an emulator capable of running ARM code, with GPU, network and all other hardware Raspberry Pi has. Currently limited options seem to exist for QEMU KVM (Linux) using qemu-system-arm package. The package delivers code to emulate about 30 different hardware boards. Unfortunately, I do not see “raspi2” on the list and haven’t checked similarities for “versatilepb” board which can be used instead, according to some manuals.

I think you should consider use of real Raspberry Pi for preparing the SD image you need. SD card can be easily swapped, removed, copied, backed up on typical SD card reader. You can use x86 Linux machine (physical or virtual) to “open” Raspberry Pi SD card image, make changes you need (without running it) and close for use on real Raspberry Pi. If your target system needs to be headless, you can configure system initially with monitor (basic options, IP and user account config), then use SSH to perform further actions. Also:

– you can use built-in serial port for configuration/management. Requires some setup and knowledge in electronics, because voltage levels are not typical for RS-232 use case and it is posible to fry your Raspberry Pi in this way,
– older models (1, 2) have Composite Video output which can be programmed to use instead of HDMI. This allows use of analog (TV) monitors as console or for some other output.

Initial Raspbian configuration can be done with text editor directly on partition containing /boot filesystem. This is VFAT partition, easily recognized by Windows on SD card connected via reader.


Reply to  Edwin Wierszelis
2 years ago


Python is an interpreted language, so, it is not dependent of the operation system, only the right packages versions and own python version.
Even java is possible to run, i think, since it depends on the JVM and not the processor architecture.

Different from compiled file in C or C++ binary, which is really compiled for a certain architecture.

3 years ago

I have Raspbian desktop running on a vbox, I don’t have winzip or an actual Pi to test so I can’t say this could work. But if you already have a boot and partition on your SD for your Pi you could try to copy and paste from the vmdk directly into your SD. It will be interesting to check once I get my Pi, or even from vm to vm. I’m Sorry if this doesn’t answer the question.

Nicolas Ballet
Nicolas Ballet
3 years ago

Hi, what about 3D graphics hardware acceleration: any chance to get GPU passthrough working with AMD e.g. Vega64 or RX?

2 years ago

My codesys is not able to communicate to raspberry pi on a vmware virtual machine . In codesys .. tools .. updatr pi , it not able to detect the vm pi . What to do. But putty can loginto the vm through ssh.

2 years ago

I have just tried to boot a VirtualBox virtual Rasberry Pi Desktop machine on Raspberry Pi micro SD through USB and it does not work (whereas it works on the real Raspberry Pi) so I can confirm the negative answer of Edwin to Nicholas and thank both for the explanation. Raspberry Pi Desktop is not Raspbian!

2 years ago

Thanks for this. It worked pretty well, minus one issue (that I’ve run into), since this doesn’t appear to actually be Raspbian, I can’t update some software.
Specifically, Sonic Pi is stuck at version 2.10, which is the highest “reasonable to install” version regular linux seems to have, which ended up defeating my purpose, since I’m running Ubuntu and already hit a wall with upgrading that software. Is there some other trick for getting it to think it’s the right environment to update Sonic Pi?

1 year ago

Thanks for the article. I was able to install raspbian buster on vmware workstation up to 2019-09-25-rpd-x86-buster.iso. When I tried to setup a vm using the new 2020-02-12-rpd-x86-buster.iso, the vm always gives me blank screen after installation has completed. Going through the vmware.log didn’t help much. I’ve got similar result when I tried to set up thenew ubuntu 20.04 LTS on vmware. It won’t start up after installation. However 16.04 LTS was installed fine. Could it be only 32bit linux system can be run on vmware?

Enrico Macchiavelli
Enrico Macchiavelli
1 year ago

Ok, the installation work, i have installed the os on virtual box oracle, but the shared notes (ctrl-c, ctrl-v) copy and paste doesn’t work, i chose bidirectional shared.
It’s annoyng typing from host and guest. Thanks you. Bye

Recent Posts

Master your Raspberry Pi - 10% off