DEV Community

Cover image for Install MacOS in a VM on Linux
Syed Umair Ali
Syed Umair Ali

Posted on

Install MacOS in a VM on Linux

Why would you do this?

The answer is simple if you're a cross-platform developer wanting to test your software on a mac without buying one or just want a hackintosh without all the hassle then this might be for you.

What are we going to do?

We are going to install a snap package on a computer running a linux distrbution and then with the help of that snap package install macOS on the computer in a virtual machine.

What are we installing:

We are going to install a snap package called sosumi which is based on macos-simple-kvm project that creates a macOS virtual machine easily for us to use.

Requirements:
  • A computer running a modern linux distrbution of linux that supports snap packages.

Installation:

  • Open your terminal and type Snap to check if snap is installed.

  • If not then type sudo apt/dnf/pacman install snapd.

  • Now snap should be installed on your system.

  • Now install sosumi by typing sudo snap install sosumi.

  • A new application will be installed on your computer called sosumi.

Configurations:

Now the last thing to do is to run the sosumi app and install macOS from the macOS recovery screen. But before you do that you need to know that it will use minimum system resources at first you can configure it to your liking for that just go into your home directory and then you need to go to /snap/sosumi/common and then edit the launch file present in the folder. The file is set to use 2gb of ram and 2 cores of your processor, you can easily set that your preference.

There is also a file called macos.qcow2 which is the virtual harddisk of the virtual machine you can resize it to your liking by typing
qemu-img resize macos.qcow2+"your required size" and then launch the sosumi app and it will show you the macOS recovery screen from there you can install macOS.

If you just want to run only macOS I recommend you use a arch host for better performance.

Discussion (2)

Collapse
thefluxapex profile image
Ian Pride

Thanks for this, but I hate Snaps with a passion and I know others do as well, so if anyone wants to install this manually via the main repo you can find the main project here:

macOS-Simple-KVM@github

but the method you posted here certainly seems a good viable, easier option for people new to this type of thing.

Collapse
chema profile image
José María CL

Wow. I will try it out as soon as a buy a new laptop. Mine died and the company send me a macbook...