How to install macOS on Linux PC and use it as a mac

Do you wonder how is macOS? or how you can use it without actually purchasing a mac? Then read this article till last to install macOS on your PC without uninstalling your current operating system. This article lets you install macOS on your Linux PC as a VM and also allows you to get the best performance.

For this Virtual machine, you will require a Linux Operating system installed on your system. If you are wondering why Linux and why not to use Windows, it’s because you get much better performance and control over VM in Linux. If you don’t have a Linux distro installed on your system then here is how to install Zorin OS alongside Windows in dual boot in your PC(I am also using Zorin OS for this article). Or if you want here is how to Install Ubuntu 20.04 LTS alongside windows on your PC to install macOS on your Linux PC.

Once you have a working Linux distro installed be it any Linux distro then proceed further with this article. So now let’s begin with the procedure to install macOS on your Linux PC.

Step 1: Clone this Github repository.

Install macOS on Linux PC in VM

Click here to open the GitHub repository. In this repository, you get all the resources you need to install and get your macOS up and running on your Linux PC. You can do a git clone or you can just click on Download ZIP. Then after the download completes open the downloads folder and extract the ZIP file anywhere you want. (Extracting it on an SSD is recommended).

Now navigate to the folder in which you have extracted this file. Then in that folder right-click in empty space and click on Open in terminal. If that doesn’t work for you then open a terminal by using the shortcut Alt + Ctrl + T or by searching Terminal. Then in the terminal enter the command below.

cd /Downloads/macOS-Simple-KVM-master

If you have extracted the Zip file in any other folder then replace the location in the above command with the location of that folder.

Now once you have opened the location of the folder in a terminal execute the command below. This begins the download of installation media for MacOS on your Linux PC. (For this step you will need an Internet Connection.)

./jumpstart.sh --mojave

Here you can replace Mojave with –high-sierra or –catalina if you want to install macOS Catalina or macOS High Sierra. Although I would recommend installing Mojave as it’s the one with almost no problems. While when I tried installing others, there were certain issues.

Step 2: Install the Unmet Requirements.

Now once you have downloaded the macOS-based system you will need to install qemu to proceed with further steps. If you have previously installed Qemu you can just skip this step.

To install qemu execute the command below in a terminal.

sudo apt-get install qemu-kvm qemu virt-manager virt-viewer libvirt-bin

As Qemu is available in default repositories of Ubuntu you don’t need to add any repositories. Just execute the command above, and it will install Qemu along with all other dependencies.

Some users also might face issues of facing missing pip. If your system does not have pip preinstalled, just execute the command below to install pip in your system.

sudo apt install python3-pip

Both the above commands will almost fix any error you might encounter further in the installation process. Although if you face some other dependence error just feel free to ask in the comments.

Step 3: Create a Virtual Hard Disk

Create an empty hard disk using qemu-img command. And while you execute the command below change the name and size of the disk according to your choice. (Before Executing the command below open the terminal as in step 1.)

qemu-img create -f qcow2 .MyDisk.qcow2 64G

Here 64G is the size of the virtual hard disk. If you want you can allocate more or less space although I will recommend a minimum of 30GB. Once this disk is created add the below lines in the basic.sh file which is available in the macOS folder.

    -drive id=SystemDisk,if=none,file=MyDisk.qcow2 \
    -device ide-hd,bus=sata.4,drive=SystemDisk \

Now if you give any other name to your virtual disk, then also replace MyDisk with that name in the above lines in basic.sh file.

Step 4: Install MacOS on Linux PC in a Virtual Machine

Now if you have closed the terminal again open the terminal like in step 1. Then just drag and drop basic.sh file in the terminal and then press enter in terminal. This will start MacOS virtual machine for the first time on your system.

When the machine starts you will see the Clover boot manager just press enter to Boot MacOS install from macOS base system. Once the loading completes you will be presented with the macOS utility screen. In that click on Disk Utility and then click on Continue. (If you want to exit mouse grab from the virtual machine just press Alt + Ctrl together.)

Erase disk while installing macos in VM

In Disk Utility click on the upper left corner menu and select Show All Devices. Now when you are able to see all the virtual drives, click on each drive and see which one is the actual drive that you created earlier. This can be determined by the size of the drive which will be near about the same size you created earlier. Although the drive you see in macOS will be a little more in space than the actual drive you created. As in the above image, my drive is 34.36 GB even though I created a drive of only 32GB.

Once you have found your actual virtual drive click on erase, give it a name that you like. In format select APFS and keep the scheme as GUID Partition Map then click on Erase. Once it’s completed close the disk Utility and you will again see the macOS utility screen.

macOS Installation

Now click on Reinstall macOS and click on Continue. On the next screen again click on Continue, agree to terms and conditions. Select the disk which you formatted earlier and click on Install. Now just wait for the Installation to complete.

Once Installation is completed VM will restart, after boot select boot macOS install from the disk name you earlier gave to the disk. Wait for it to complete as it might take some time to get finished. It will again restart again select boot macOS from the disk name you gave. Now just follow on-screen Instruction, select your Country, Keyboard layout, fill in other details like name and password and your macOS installation will complete.

Step 5: First boot of macOS on Linux PC

After completing the above steps you should have your macOS working. Now you can use and enjoy the feel of a mac. But wait that’s not it, you might not feel the performance sufficient to use macOS comfortably, don’t worry you can improve the performance of your macOS.

Install macOS on your PC

How to improve performance of macOS VM on Linux PC

As you have installed it in a virtual machine, it’s tough to get similar performance as if it’s actually installed on your machine. But don’t worry you can get some good performance which should at least allow you to get a feel of the macOS.

If you have kept the extracted folder of macOS on the hard drive move it to the SSD(if you have one on your system). Just cut and paste the entire folder and run it from there, it should improve the performance of your machine quite a lot.

Increase RAM of your macOS VM

Increase your Linux PC macOS performance

Increase RAM and cores of your macOS virtual machine. It’s quite easy to do just open basic.sh file in any text editor. This basic.sh file is located in the folder in which all your macOS virtual machine data is present. In that file you can see -m 2G here 2G represents 2GB of memory, just replace that 2 with whatever amount of RAM you would like to allocate to your virtual machine. I recommend leaving at least 2GB of RAM for your Linux system and the rest of your RAM you can allocate to the macOS virtual machine.

Increase CPU core and threads allocated

Then in the same file, you can see -smp 4, cores=2, here smp is a number of threads while cores are the number of cores allocated to that machine. Now change these parameters according to your need. The higher the number of Cores and threads you allocate to the machine the better will be its performance. Although I will recommend leaving at least two cores for your Linux machine while others can be allocated to the virtual machine.

Once you are done making changes according to your need just save changes to the file and start the virtual machine. Now if you have allocated sufficient hardware resources to the virtual machine you should see some nice performance to give you the proper feel of macOS.

Additional Changes in the macOS VM in Linux

Now once you have made all the above changes then your macOS virtual machine is ready to use on your Linux PC. And it should give you an overall nice experience of using a mac without actually buying a mac. But that’s not it since you can even make changes like passthrough a GPU to the macOS or increase the resolution of your macOS installation.

Instructions to achieve all these changes are available inside the Docs folder in your macOS installation folder. You can follow all the instructions mentioned in that folder and achieve whatever you would like to with your macOS.

Conclusion

In this article, we saw how to Install macOS in a VM on Linux PC. This macOS can give you the experience of using a mac without actually buying one. And once you increase resolution and passthrough GPU(if your system supports it). Then you can get a nice experience which can be almost similar to using a mac.

I hope you like this article and you are able to install the macOS on your system.

Leave a Reply

Share via
Copy link
Powered by Social Snap