paint-brush
Virtualization and Emulation on MacOSby@ChrisChinchilla
7,026 reads
7,026 reads

Virtualization and Emulation on MacOS

by Chris ChinchillaNovember 22nd, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

I have been using Parallels for a couple of years now, primarily for running Windows virtual machines (VMs), but occasionally Linux VMs too. I mostly use it for playing games, testing, and the occasional Windows-only application. There are some other long-standing options such as VirtualBox, QEMU, and VMWare. I am intentionally ignoring anything that also runs containers, such as Docker, as that’s a different use case, and a whole other gamut of options.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Virtualization and Emulation on MacOS
Chris Chinchilla HackerNoon profile picture


I have been using Parallels for a couple of years now, primarily for running Windows virtual machines (VMs), but occasionally Linux VMs too. I mostly use it for playing games, testing, and the occasional Windows-only application. There are some other long-standing options such as VirtualBox, QEMU, and VMWare. I am intentionally ignoring anything that also runs containers, such as Docker, as that’s a different use case, and a whole other gamut of options.


Recent changes in macOS suddenly bought a plethora new options and after trying VirtualBuddy already and reading a post from the ever insightful Eclectic Light Company, I decided to try them all out!


Want to watch this as a video?

Criteria

There are numerous options (now) available, so in profiling each of them I was generally thinking about the following criteria:


  • Apple Silicon native or Intel only
  • VMs supported
  • Integration options between host OS
  • Performance
  • Ease of use and stability

A quick aside on Virtualization vs Emulation

Some tools in this article virtualize, others emulate, and some do both. But what does that mean?

Emulation

Emulation creates a version of an entirely different processor architecture in software that your in-built processor then runs. This is less efficient, but is the only way to run ancient software that uses CPUs that no longer exist. You may struggle running newer operating systems or applications.

Virtualization

More efficient that emulation, Virtualization uses a hypervisor, which is now a part of all major operating systems, to host the VM on an area of the in-built processor. This means that the operating system has to run on the same CPU architecture as your in-built CPU.

VirtualBox

Fedora on macOS (not mine obviously)

As one of the classic Virtualization options, VirtualBox supports a lot of host and guest operating systems. It’s open source, but owned by Oracle, a combination that might put off many folks.


There are binary releases you can install and a Homebrew formula is available. However, VirtualBox requires a kernel extension, so you need to restart after installation.


The big caveat is that VirtualBox only runs on x86 CPUs, and it describes itself as “not a CPU emulator”. This means it will never run on Apple Silicon, not even using Rosetta 2. I did use it extensively in the past, especially with Vagrant, but can no longer test it on my M1 MacBook Pro, so have little to say on it in this post. However, you can find plenty of other opinions and practical guides on using it.

Viable and Liviable

Viable screenshots

Howard Oakly of the Eclectic Light Company tends to release applications as “technical examples”, at least that’s how I interpret them. They are more designed to demonstrate particular macOS features more than provide a complex user interface and several other features.


Viable has a simple interface for configuring the machine, downloads an IPSW image (much like VirtualBuddy) and off you go. Liviable is a companion application that supports Linux VMs, but only works in Ventura and above, and I am not quite sure why, but I imagine there’s a new feature available.


To create a VM in Viable, you click the Download button to download a default (generally the latest) disk image from Apple, or Install to use an image you have already. After that, change settings, and click Start VM.


Liviable works the same way, but there’s no Download button, as there is no “official” image source, it’s up to you to find one.

VirtualOS

Somewhat lacking in documentation and possible proving that new macOS features make it “easy” to create virtualization applications, virtualOS is another simple option for creating macOS virtual machines.


To create a machine, open settings and select if you want to download the “latest” image from Apple, or use a custom one. The click start, that’s about it!

VirtualBuddy

I covered VirtualBuddy before, and it’s another of the new breed of macOS virtualization options that only supports emulating macOS, so primarily for testing purposes.


It’s relatively easy to use, emulates macOS at near native performance, and is fully open source with a rapid release cycle.


Watch my other video for full details. I have recently discovered that VirtualBuddy only works with macOS Monterey.

QEMU

I couldn’t compile a list of Virtualization tools without mentioning QEMU, as it’s one of the earliest and longest running emulation options. It’s a command line tool with countless arguments to understand, and In fact, UTM is a front end for QEMU, with some other features added.


If you can navigate those options, it’s powerful, and it’s currently the only option (and UTM) for emulating other architectures on Apple Silicon. So if you’re desperate to run some obscure x86 or PowerPC OS, or indeed “classic” Windows, then it’s your best option.

UTM

One of the more popular and better known new wave of virtualization options and is a wrapper around QEMU, offering the flexibility it offers but without needing to memorise command line arguments.


UTM can run ARM64 versions of Windows, Linux, and macOS. UTM can run on Intel machines and emulate OSs that run on different architectures. This includes more obscure processors like PPC and RISC-V. I was able to get Intel versions of Windows and Linux running. However, they run slow enough to be almost unusable, so use them sparingly, use older versions, or without a graphical user interface. However, UTM is open source, has an active community, and for people who like messing around with OSs, especially more obscure ones, it’s a viable option.

UTM doesn’t support GPU emulation for Windows, so you likely can’t play any games that require 3D acceleration.

UTM and Windows

Windows often doesn’t ship as an ISO file, but as a “VHDX” file, UTM can convert this on the fly for you, or you can download ISOs from 3rd party sites. Your mileage may vary there. To get hold of an ARM version of Windows you need to sign up for the Windows insider program. Intel versions you can get in numerous ways.


Once you have an installation image, you can create the VM. First, select if you want to emulate or virtualize, and then you can create your own machines or pick from one of the templates UTM supports “officially” or from the community.


Windows won’t recognise the network settings until you install the guest additions package to enable shared networking with the Mac. You can do this during the installation process and full steps are in this guide.


Once you’ve completed that step, you can continue installing Windows and run it when you finally reach the end of the installation process.


It’s a similar process for running x86 versions of Windows, except if you are not using an Intel Mac, the process will be unbearably slow. Maybe try Windows 95?

UTM and Linux

Again, first you need to download an ISO image and select “emulate” if you want to run an Intel (or something else) version of Linux, or “virtualize” for an ARM version. Emulating isn’t quite as painful as Windows, but it’s basically unusable, it could be performant enough for running command line Linux.

Parallels

At a press event ages ago I received a free year license for Parallels and continued to pay to keep it upgraded for the past 3 years. There is a Homebrew formula available, but I found it unreliable, and the installer would frequently crash, especially when upgrading, so it’s best to use the official packages.


Parallels runs on ChromeOS and macOS, and largely promotes itself as an option to run Windows, but you can also run some pre-packaged Linux distributions and with some configuration, many other OSs. In the past, I have personally got Manjero, FreeBSD, and other OSs working with Parallels reasonably well. I have not tried any of these on my Apple Silicon machine, though. I mostly use it for running Windows 11 which it does extremely well, and I have played fairly recent games (Civilization 6, Age of Empires 3, Divinity Original Sin 2) with little overhead. In recent versions Parallels also offered DirectX to Metal mapping, increasing performance, and it supports a lot of other macOS features inside most VMs, such as Sidecar. I have also used for quickly firing up some Ubuntu desktop machines for testing, again, with no issue. You can also install current versions on macOS as a VM, again primarily for testing purposes.


To create a VM, click the + button in the Control Center window or use the File > New menu item. From here you can select a pre-built image from Parallels, or select an ISO or VHDX you have downloaded from elsewhere and create a custom machine.

Windows running in Parallels

Ubuntu running in Parallels


If you can afford Parallels, then it has fast become my favourite choice for VMs, but it also isn’t open source and has some Russian connections, but seemingly distant ones.

VMWare Fusion

VMWare’s main business is virtual machines, so I have no idea why I never thought to even look and see if they had a desktop option for emulation. In essence Fusion is quite similar to Parallels, primarily aimed at letting you run Windows, but also supporting Linux, macOS, and “lesser know options”. Similarly to Parallels, it offers DirectX to Metal mapping and supports other macOS features. Interestingly, you can also use Fusion to run containers, which as Docker Desktop becomes increasingly bloated, is an interesting all-in-one alternative.


In the process of writing this article, VMWare Fusion for Apple Silicon went from preview to release in version 13. If you can navigate VMWare’s labyrinthian signup processes, there’s even a free “player” version.


I tried the preview and while it’s not as performant or as slick as Parallels, it works. It doesn’t package ARM versions of Linux or Windows, so you have to find those yourselves. The list of ARM Linux distributions that work with Fusion is slowly growing and VMWare also has its own “Proton” distribution.


To get the ARM version of Windows to work you first need to sign up with the Windows insiders program, download the VHDX and convert it to a “VMDK” file using QEMU with the following command.


qemu-img convert -p -Ovmdk /path/to/.VHDX/destination/path/to.vmdk


Much like UTM, Windows won’t recognise the network settings until you install the tools package to enable shared networking with the Mac. Follow these steps:


  • On the Mac / Fusion Menu Bar click Virtual Machine > Install VMware Tools

  • Press ‘SHIFT-Fn-F10’ to bring up the command prompt

  • Type powershell, hit return

  • Type cd D:\` to change directory to the tools drive - Type: Set-ExecutionPolicy RemoteSigned

  • Type .\setup.ps1


Once you’ve completed those steps, you can continue installing Windows and run it when you finally reach the end of the installation process. Some of these steps have possibly changed (and become easier) now Fusion is out of preview.

The best option

So, you’ve read and/or watched this far and instead of an “it depends” answer want someone to tell you what you should use.


Personally for regular usage, I will stick with Parallels, it’s the easiest and most performant option for virtualizing OSs. If I need to emulate something, typically to mess around with obscure or niche operating systems, then nothing beats UTM as it gives all the power of QEMU with a reasonable UI.


Enjoy! What will you emulate or virtualize?