Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Use VirtualBox to Run Any OS on a Mac

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can run Linux and other operating systems on your Mac using Oracle VirtualBox, a free and open-source hypervisor. VirtualBox creates a virtual machine (VM) on your Mac, letting you install and run a second OS inside a window without rebooting. You'll need an Intel or Apple Silicon Mac (the steps below cover both), a downloaded OS installer file (ISO), and enough free disk space (20–50 GB is typical).

What You'll Need

  • A Mac running macOS 11 Big Sur or later (VirtualBox supports recent macOS versions).
  • Oracle VirtualBox installed (download the macOS version from the official VirtualBox website).
  • An OS installer in ISO format (e.g., Ubuntu, Linux Mint, Debian, or even older Windows versions).
  • At least 20 GB of free storage on your Mac's drive.
  • Administrator access to install VirtualBox and create a VM.

Step-by-Step

  1. Download and install VirtualBox. Go to virtualbox.org, download the macOS installer, and double-click the .dmg file. Run the installer and follow the prompts. If macOS blocks it, go to System Settings > Privacy & Security and click “Open Anyway.”
  2. Download your OS ISO. Get the ISO file from the official website of the OS you want (e.g., ubuntu.com for Ubuntu). Keep it in a folder you can find later.
  3. Open VirtualBox. Launch the app from your Applications folder. The main window shows a list of VMs (empty on first run).
  4. Create a new virtual machine. Click the “New” button (blue gear icon). Give your VM a name, and choose the type and version from the dropdowns (e.g., Type: Linux, Version: Ubuntu 64-bit). If your OS isn’t listed, pick a close match.
  5. Allocate memory (RAM). In the memory size slider, assign at least 2 GB (2048 MB) for most Linux distros, more if you have spare RAM. Don’t exceed half of your Mac’s total RAM.
  6. Create a virtual hard disk. Choose “Create a virtual hard disk now,” then select VDI (VirtualBox Disk Image) and “Dynamically allocated.” Set the size to at least 20 GB (or more if you plan to install many apps).
  7. Configure settings (optional but recommended). Select your VM and click “Settings.” Under System > Processor, give it 2 or more CPU cores if your Mac has them. Under Display, increase video memory to 128 MB. Under Storage, click the empty optical drive and choose the ISO file you downloaded.
  8. Start the VM. Click “Start” (green arrow). The VM will boot from the ISO. You’ll see a window with the OS installer.
  9. Install the OS inside the VM. Follow the on-screen installer. When it asks about disk partitioning, choose “Erase disk and install” (this only affects the virtual disk, not your Mac). Complete the installation, then reboot the VM when prompted.
  10. Install VirtualBox Guest Additions. After the OS boots, go to the VM menu “Devices” > “Insert Guest Additions CD image.” Inside the VM, open the CD and run the installer (on Linux, run the .run file or use the package manager). Guest Additions improves screen resolution, clipboard sharing, and drag-and-drop.
  11. Use your VM. Click inside the VM window to interact with it. To release your mouse and keyboard, press the Host key (right Command key by default).

Common Mistakes

  • Not enabling virtualization in macOS. On Intel Macs, ensure VT-x is enabled in the VM’s System settings. On Apple Silicon, VirtualBox uses a different backend, so just make sure you have the latest version.
  • Allocating too little RAM. If the VM is sluggish or fails to boot, increase RAM to at least 2 GB.
  • Choosing the wrong OS version. If you pick “Ubuntu 32-bit” for a 64-bit ISO, the VM won’t boot. Always match the architecture.
  • Skipping Guest Additions. Without them, the screen stays at a low resolution and clipboard sharing won’t work.
  • Not enough disk space. The virtual disk file grows as you use it. If your Mac runs out of space, the VM may crash.

Tips

  • Use a fixed-size virtual disk if you want slightly better performance, but it takes up the full size immediately.
  • Take snapshots before major changes inside the VM (right-click the VM > Snapshots). This lets you revert to a working state.
  • Enable bidirectional clipboard and drag-and-drop in VM Settings > General > Advanced for easier file transfer.
  • If your Mac is Apple Silicon (M1/M2/M3), use the latest VirtualBox version; older versions won’t work.
  • Keep your ISO files on an external drive if you’re low on internal storage.

Troubleshooting

VM won’t start or shows a black screen

First, restart VirtualBox and your Mac. Check that you have enough free disk space. If the black screen appears after the VirtualBox logo, try increasing video memory in Display settings. If it happens during boot, ensure the ISO is correctly attached and the OS type matches.

Mouse and keyboard are stuck inside the VM

Press the Host key (right Command) to release them. If they remain stuck, restart the VM and reinstall Guest Additions.

VM is extremely slow

Increase RAM and CPU cores in Settings, but don’t exceed half your Mac’s resources. Close other heavy apps. Also make sure you’re using a 64-bit OS and have Guest Additions installed.

“VT-x is not available” error (Intel Macs)

Go to VM Settings > System > Processor and check “Enable VT-x/AMD-V.” If it’s greyed out, you may need to disable Secure Boot in macOS Recovery (rare), or your Mac model may not support it.

Guest Additions won’t install on Linux

You may need to install build tools first. In the VM’s terminal, run sudo apt update && sudo apt install build-essential dkms (for Debian/Ubuntu), then run the Guest Additions installer again.

Network doesn’t work inside the VM

By default, VirtualBox uses NAT, which should work. If not, go to VM Settings > Network and change “Attached to” to “Bridged Adapter.” This gives the VM its own IP on your local network.

Frequently Asked Questions

Can I run Windows on a Mac with VirtualBox?

Yes, VirtualBox supports Windows as a guest OS. You’ll need a Windows ISO and a valid license. Performance is generally good for basic tasks, though not as fast as Boot Camp on Intel Macs.

Is VirtualBox free?

Yes, VirtualBox is free and open-source. There’s no cost for personal or educational use.

Will VirtualBox work on Apple Silicon Macs?

Yes, recent versions of VirtualBox support Apple Silicon (M1/M2/M3). However, some older guest OSes may not run. Check the VirtualBox changelog for compatibility.

Can I run macOS inside VirtualBox on a Mac?

Technically yes, but Apple’s license only permits macOS on Apple hardware. Running macOS in a VM on a Mac is allowed for development purposes, but it’s not officially supported by VirtualBox and may require extra steps.

How much RAM should I give the VM?

At least 2 GB for a lightweight Linux distro, 4 GB or more for heavier distros or Windows. Don’t allocate more than half of your Mac’s total RAM.

Can I access files from my Mac inside the VM?

Yes, once Guest Additions are installed, you can enable shared folders in VM Settings > Shared Folders, or use drag-and-drop if enabled.