Oracle's Virtualbox is one of the more popular tools to set up and interact with virtual machines, not least because it's completely free, and it works cross-platform. Whether you're on Windows 11, Linux or macOS, you can take your Virtualbox virtual machines and workflow whichever you use.
We have a separate guide on how to install Virtualbox and handle updates, but once you're done there, the fun really begins. The whole reason you're using it in the first place.
Here's what you need to know about setting up your first virtual machine in Virtualbox.
All virtual machines need something to boot from
Just as if you were building a PC from scratch, or replacing your existing OS with something else, to build a virtual machine you need something to boot from. The good news is that it's the exact same something you would use on a baremetal installation, but with one step removed.
I'm referring to the image file, commonly referred to as an ISO. Whether it's a Windows VM you're setting up, or one of the many Linux distros out there, you'll need to download the right ISO first.
Where this process is simpler than installing an OS on baremetal is that you don't need to flash the image to a USB drive first. Virtualbox is clever enough to interpret the image file without this. Score one for extra simplicity.
For the purposes of this guide, I'm setting up a Fedora 40 virtual machine, but the basic process is the same for Windows and other Linux distros, too. To get the file I need, I simply hit the Fedora 40 website, find the version I want, and download it.
You do need to remember, also, that you'll need to match your architecture. Virtualbox on Windows 11 will be able to build x86 and x64 virtual machines, but not ARM64. Likewise, if you're on an ARM machine, like the new Copilot+ PCs, you'll need to make sure you download the ARM-specific ISO.
How to set up a virtual machine
Once you have your ISO, you're ready to get started making a new virtual machine.
Open up Virtualbox on your PC and follow these steps.
- Click New.
- Give your new virtual machine a name that will help you identify it in the Name box.
- If you want to change the location it installs to on your PC, select that in the Folder dropdown box. Virtualbox has a default location set up after installation.
- From the ISO Image box, choose the ISO file that you've downloaded.
- Virtualbox should have recognised it and populated the Type and Version boxes for you, but if it hasn't select them manually from the dropdowns.
- Click Next.
The basic set up process now moves on to where you'll decide upon the hardware resources you're going to allocate to your virtual machine.
- Using the Base memory slider, decide how much RAM you want your virtual machine to have access to.
- Using the Processors slider, decide how much CPU you want to allocate. It's important to note that it will be based upon how many threads your CPU has on the host machine. In the image above it shows 32, based on the CPU in my PC having 32 threads on 16 cores.
- Click Next.
- Allocate the storage space you want to be made available to your virtual machine. Think of this as the SSD you would have inside a desktop or laptop, but you can always increase it later on if needed.
- Click Next.
- Check the Summary to make sure you're happy with the configuration.
- Click Finish.
The basic setup process is now complete, but there's one more step which you'll need to do inside your new virtual machine.
From the main Virtualbox window, select it and click the big green Start button. The virtual machine will fire up and you'll now run through the standard installation process for whichever operating system you decided to use. It's exactly the same as running it on a physical machine.
Installing Virtualbox Guest Additions into a new Linux or Windows virtual machine
To make using a virtual machine on Virtualbox better, you'll need to install the Virtualbox Guest Additions package. This is installed inside your virtual machine, rather than during the setup process.
Check out the full documentation to see everything Virtualbox Guest Additions includes, but a couple of the more useful features include mouse pointer integration, shared folders with the host machine, and a shared clipboard also with the host.
The process is a little different depending if your virtual machine is running Linux or Windows, but the initial step is the same. Click Devices from the menu bar in your virtual machine window, and select Insert Guest Additions CD image. This will mount the installer into your virtual machine as if you were putting a CD-ROM into a physical PC. Old school.
If you're using a Windows virtual machine, simply open up the 'CD' and run the installer. It'll go through a similar process to any other Windows software you'd install this way.
If you're using Linux, you'll need to follow these steps.
- Open up the installation media from the desktop or the file manager.
- Right click and choose to Open terminal here.
- Type sudo sh ./VBoxLinuxAdditions.run into the terminal and hit enter.
- As it's a sudo command you'll also need the password you set up for your user
The same benefits will now be available to your Linux virtual machines.
After all of this you will now have a working virtual machine set up to your desired configuration, and with the Guest Additions installed your overall experience will be so much better.
You can tweak settings for any of your virtual machines as you need to, but you'll need to remember that it's best to make sure they're powered off first. Some settings simply can't be changed while a virtual machine is powered up, but it's good practice to shut it all down first before you make any changes.