I would say if you're developing for embedded or web back end, go Linux. For web front end or application development, go hackintosh. I have five PCs with six operating systems. I run OSX for 'work' (writing, email, coding, Reddit, etc), Win 7 for games, FreeBSD for my file server, and Linux. On the Linux (Ubuntu.), open Terminal windows and CD to go to your Mac OS virtual machine directory. If you use the Windows operating system, open the CMD windows with Administrator privilege and CD to go to the Mac OS virtual machine directory. Perform the above commands respectively (after having replaced 'Your-VM-Name'). VirtualBox Images Umair 2020-01-22T01:07:41+02:00. We offer open-source (Linux/Unix) virtual machines (VDIs) for VirtualBox, we install and make them ready-to-use VirtualBox images for you. From here you can download and attach the VDI image to your VirtualBox and use it. We offer images for both architectures 32bit and 64bit, you can download.
Windows, macOS – which one do you want to use today? On a traditional setup, you’re stuck with one or the other. But with virtual box, you actually have macOS on a Windows PC.
It’s the freedom that computer users have enjoyed with Linux and other operating systems.
But Apple has made it difficult to install their operating system on anything other than their own hardware. All of that is changing, and Virtual Box is responsible for it and the rise of the Hackintosh.
New to hackintosh? Learn more about it in our what is hackintosh? overview.
Note: A lot of people will be able to get a mac virtual machine one Windows running smoothly, but sound doesn’t seem to work well. That’s really not an issue because you’ll still be able to access all of your apps and software.
I also recommend that you have access to a real Mac. You might be able to find some distributions of the High Sierra ISO online, but there is always a risk when downloading from an unofficial source. Instead, borrow a Mac from a friend, or use your own and download the High Sierra OS from the App Store.
Check out our high sierra installation guide for hackintosh
Everything You Need to Get Started with Installing macOS on VirtualBox
Before we go through the steps on how to install macOS on Virtual Box, let’s get everything together that you’ll need to get started.
- Open up your Mac
- Go to the App Store
- Type in “High Sierra”
You’ll want to search for your desired operating system (we’ll be using High Sierra), and Download it.
Note: You’ll need a decent computer to be able to run Virtual Box. Your computer will need to meet these minimum requirements:
- Dual core processor
- 4GB Ram or higher
- 64-bit
If your computer doesn’t meet these requirements, you won’t be able to run macOS properly. You’ll be able to download VirtualBox from the official website. I’m not going to go through the installation process, as the website will have all of the information you need to be able to install VirtualBox.
I do recommend that you read all of the documentation and ask any questions that you have in the community section of the website.
VirtualBox 6.0 was just released, so it’s definitely a great time to get started with your own macOS.
Extract macOS Sierra
Make sure you’ve downloaded High Sierra, and then you’ll want to run a few commands from your terminal . You’ll be able to open the terminal at: Applications > Utilities > Terminal. Once inside of the terminal, you’ll want to run the following commands:
Go to your desktop and rename the file, removing the “.cdr” extension. You need this extension to read “.iso” for it to work properly.
You’ve successfully created your own ISO file so that you can bootup your macOS.
The next step is to copy the file over to your Windows machine (using a large USB drive seems to work best). This file will be mounted in your virtual machine later on in the article, so it’s very important that this step is completed successfully.
Creating a mac Virtual Machine on Windows
You’ll want to create a virtual machine, and this is really easy. You’ll open up VirtualBox and click New. You’ll want to have the following parameters selected or entered before clicking Next.
- Name: High Sierra
- Type: Mac OS X
- Version: Mac OS X (64-bit)
Pay attention when selecting the version because you may find that High Sierra is offered as a version when you go to install it. But if it’s not, you can just choose the settings I listed above and they should work fine.
You’ll then be proceeding through all of the settings.
When you come up to the RAM setting, you’ll want to be generous. VirtualBox requires a minimum of 4GB or RAM to run, but the more the better.
Why?
You’ll want to provide at least 4GB to your macOS, or 4096MB to be precise. A general rule of thumb is that if you can spare it, supply more RAM to your virtual machine. RAM will allow the operating system to put more information into memory and retrieve it faster.
For better overall performance, supply as much RAM as you can.
The next steps are also important, and they’ll include:
- Hard Disk: Choose the “Create a virtual hard disk now” setting.
- Choose VDI when choosing the hard disk type.
- Choose Fixed Size instead of Dynamic for added speed.
- Set the size of the drive to at least 25GB.
You’ll now have your virtual machine using the RAM and disk space properly, and you’ll have to work your way through a few screen prompts before having everything setup properly.
Configuring Your VirtualBox to Run macOS High Sierra
We’ve made a lot of progress so far, and now it’s time to configure your virtual machine properly. You’ll see in the main window of VirtualBox that “High Sierra” is listed. Click on this and then click on the “Settings” button.
You’ll want to go to “System” and make sure that the following are unchecked on the Motherboard tab:
- Floppy
- Network
Click on the Processor tab and make sure that you have 2 or more CPUs set for your virtual machine.
The next few settings are rather simple:
- Display: Video Memory with a minimum of 128MB
- Storage: Click “Empty” and then click on the CD at the top right. Choose your High Sierra ISO file
Now you’ll need to click “Ok,” and save all of the changes you’ve made. Close out your VirtualBox now.
Apple is very strict on the system that their operating system runs on, so it’s very important that you do your best to configure your virtual machine in such a way that it tricks the installer to thinking you’re on a retail machine.
We’ll now be going into the Windowscommand prompt.
You’ll do this by:
Hackintosh Vm Linux Server
- Clicking the Start Menu
- Typing “Command Prompt”
- Right-clicking on the Command Prompt desktop app
- Choosing Run as administrator
It’s very important to follow all of the following command prompts exactly. Your goal is to run each command, one by one, hitting the Enter button and waiting for the command to complete successfully.
Remember that VirtualBox needs to be closed before running these commands, or it won’t work properly.
You have to make sure that the virtual machine is properly named “High Sierra” for this method to work. If not, you’ll be able to go back and make changes to the name to get everything to work properly.
Once all of the commands are completed, and there are no errors, you’ll then be able to open up your VirtualBox and get macOS High Sierra installed properly on VirtualBox.
It’s a long process, but we’re almost done with your installation.
Running VirtualBox and the macOS Installer
You’ve almost learned how to install macOS on VirtualBox entirely, and we’re on the home stretch. You’ll want to open up your VirtualBox and then click on your virtual machine that you set up earlier.
Now, click “Start.”
There will be a lot of information displayed on the screen as everything starts running. I recommend stepping away from the machine and letting it run for a few minutes before coming back. Some errors can hang for 5 minutes or longer.
If you’ve done everything properly, you can be confident that the installer will boot properly.
You’ll eventually be presented with the option to pick a Language. If you’ve reached this point, you’re doing very well and are almost ready to run your macOS.
Download si computer driver. The next steps can be followed:
- Choose your desired language, and click
- Click “Disk Utility” and then
- Click “View” and then “Show All Devices.”
- Click on your empty virtual drive that has been setup and click “Erase.”
- Choose the following settings:
- Name: Macintosh HD
- Format: Mac OS Extended (Journaled)
- Scheme: GUID Partition Map
- Click “Erase” and close Disk Utility when the process is complete.
- Click “Reinstall macOS.”
- Click “Continue.”
You’ll come up to one point where you’ll be asked to choose a hard drive, and you’ll want to select the Macintosh HD partition that you just created with the Disk Utility.
We’ve successfully copied all of the files on the virtual machine, but we’re not done just yet.
Exit your virtual machine and then go back to your virtual machine’s settings. You’ll need to change up your Storage settings. Click on your ISO for High Sierra in the “Storage Tree.” You’ll click that CD icon just like we did earlier and then choose “Remove Disk from Virtual Disk.”
You need to do this to unlink the ISO from your virtual machine.
Start up your virtual machine and you should come across a black screen with the EFI Internal Shell. You’ll want to look for FS1. If this is listed in yellow, click on the virtual machine and then type fs1: and hit the Enter button.
You should be in the fs1 directory.
Type in the following commands:
- cd “macOS Install Data”
- cd “Locked Files”
- cd “Boot Files”
Now we’ll run the installer by running: boot.efi and hitting enter.
If everything goes well, you’ll come across a graphical installer and will just have to work through the prompts. The virtual machine will reboot eventually and then you’ll need to go through the settings and the rest of the setup process.
Soon enough, you’ll be right inside of macOS, where you’ll be able to start using your mac virtual machine on Windows.
Having a virtualbox mac OS is the easiest method of using mac as and when you need it. In addition, using virtualbox is far less complicated than the dual boot hackintosh method we have looked at previously.
For a few years now, thanks to the hard work of others in the QEMU/KVM community, the ability to use the macOS operating system on our KVM powered virtual machines is now a reality. We can also enable a much better user experience for OSX virtual machines using GPU Passthrough.
Read Also: Benchmarking Linux OGL performance with Bugle
In this guide we will be showing you how to create a Hackintosh-KVM virtual machine using QEMU’s i440fx chipset, with the added benefit of using host passthrough of the CPU, instead of using the Penryn emulation that tends to be the usual way to get OSX up and running.
This guide will also be setting up these VMs as “Hackintosh” systems. We will not be using Apple’s actual OSK(SMC) key, which is an attempt to make your virtual machine a “Real Macintosh.” This information is provided for entertainment purposes only and The Passthrough POST waives all liability for any and all of what you do with it.
The main reason this guide focuses on the i440fx chipset is that there are still a few wrinkles that need to be ironed out on q35 with 10 series Nvidia GPUs and host CPU pass-through, whereas i440fx works well regardless of the host system’s hardware. If you want to find q35 chipset guides, they are available elsewhere for the time being. We will be adding an additional guide to Hackintosh-KVM series concentrating on the q35 chipset soon, after some testing is done to ensure it works with host CPU pass-through, macOS updates, and stability in general. We encourage others in the VFIO community to join our Discord server and help us out to work out other issues in the future.
Synopsis
- This guide assumes that you already have set up a GPU pass-through virtual machine in the past and have experience with QEMU and libvirt, no support/steps will be given in the Hackintosh-KVM guide for setting up QEMU/libvirt for GPU pass-through, networking, CPU pinning, etc. If you need help with setting that up, refer to the The Passthrough POST Discord server.
- This guide has only been tested with Ryzen CPUs. Your mileage may vary when using a Intel CPU (though we don’t expect any issues.) We encourage our readers to help contribute their experiences with Intel hosts, so this guide can be updated as appropriate.
- The author also recommends that the initial setup to be done via GPU pass-through for ease of installation, as other display methods may or may not work(QXL,vmwvga,etc).
- Clover is only to be used as it’s needed for the various tweaks within this guide. We will not supporting the Enoch or any other bootloader at any time during the Hackintosh-KVM guide.
- We recommend using the OVMF files from the Hackintosh-KVM repo. We also recommend using recent versions of the kernel, libvirt, and QEMU. This is not guaranteed to work on versions older what was tested at the time this article was written.
- For older or patched versions of QEMU and other applications, refer to kholia’s guide on github for additional patching/procedures.
- We recommend using LVM or a standard image file(.img) to achieve the best I/O performance possible, using a .qcow2 image file with QEMU’s emulated SATA controller leads to rather abysmal performance in our testing. ZFS vdevs can also be used, but this has not been tested at the time of this write-up for disk I/O performance, although they should perform fine.
- The author also recommends setting the CPU governor to performance and/or use a QEMU hook to ensure that the virtual machine is at its utmost performance. The xml file from the Hackintosh-KVM repository contains arguments for PulseAudio and evdev pass-through. If you plan to use this, you will want to make sure that evdev and PulseAudio pass-through are set up and working correctly beforehand.
- We will be using the iMac18,3 SMBIOS with Clover as other versions of Macintosh’s include Thunderbolt 3 firmware, which upon update, will corrupt OVMF’s nvram, thus making the virtual machine unbootable.
Author’s Host System
- Gentoo using a AMD Ryzen 5 1600 CPU with a Nvidia GTX1070 FE GPU for graphics pass-through. This was also tested with a AMD Ryzen 7 2700X and EVGA GTX1050 Ti FTW. Mojave breaks support for 9 and 10 series GPUs and 20 series cards will be totally unsupported.
- Tested with QEMU 2.12 using a patched OVMF that the author created, which is located in the Hackintosh-KVM repository, and Linux kernel 4.17 (4.16 was also tested to be working too).
- You will need a CPU with at least SSE4.1 to use macOS High Sierra/Mojave. Intel VT-x / AMD SVM is required.
Installation Prerequisites
- Download the macOS High Sierra installer from the Apple App Store. Use the
create_highsierra_iso.sh
script from the Hackintosh-KVM repository to create a ISO for the virtual machine. - Run the ISO creation script
create_iso_highsierra.sh
on your real Macintosh. The High Sierra ISO file will be located in the Desktop folder when it is finished. - If you do not want to use the script from the Hackintosh-KVM for creating a ISO file, you can also refer to:
https://www.tweaking4all.com/cd-dvd-blu-ray-disc-burning/burning-for-macmacOS/convert-dmg-to-iso/
for information on how make a ISO file for your virtual machine on your real Macintosh. - Lastly, copy the generated ISO image from your Macintosh’s Desktop folder to your host QEMU/KVM machine via Samba/NFS, or use a USB drive.
Hackintosh-KVM Preparation steps
Update: As of 10/20/2018 the repository location changed to the TPP Github repository
- To get started, clone the repository listed below. The files included in this repository are necessary for creation of the virtual machine and will also be needed when you install Clover to the EFI folder of your Hackintosh install.
git clone https://github.com/PassthroughPOST/Hackintosh-KVM
- Before you get started on anything else, you will want to define the xml, as root, using
virsh define osx_i440fx.xml
from the folder you have it located in. Next you will want to use Virtual Machine Manager to add your GPU, disks, and any other devices you plan on passing to the virtual machine. After that, you will want to open the xml file for the virtual machine and edit it for the location of your OVMF files, CPU pinning, and evdev pass-through. This can be achieved viavirsh edit osx_i440fx
. If you do not intend to use PulseAudio or evdev pass-through, delete the corresponding lines to those in the xml file. - The xml will have a
virtio-net
adapter on a bridged network interface, you may want to change from the bridged interface if this doesn’t match your network topology. - To enable pass-through of our hosts CPU feature flags we will be faking the CPU vendor ID via the QEMU argument shown below, do note that this will override what you have set in Virtual Machine Manager’s CPUs menu.
It is not recommended to set the CPU topology for multi-threading while in this menu, due to a bug in Clover, and instead to only set the amount of cores in the current and maximum allocation menus to the amount we want for the virtual machine. The reason for this is multi-threading does not work as intended with the QEMU and macOS. Passing the virtual CPU’s as sockets(which is default), or up 8 cores and 1 thread, has lead to far better CPU performance in the authors testing.
qemu:arg value='-cpu'
qemu:arg value='host,vendor=GenuineIntel,kvm=on,vmware-cpuid-freq=on,+invtsc,+hypervisor'
How To Install Hackintosh
- Create a virtual HDD where macOS will be installed. This can be done via Virtual Machine Manager’s Storage utility which is located in > Edit > Connection Details > Storage > Add-Pool, to create storage pool(s).
- Create a Clover boot disk,
libguestfs
is a required dependency. (The steps below are optional) - To start off, you will want to edit
$HOME/YourFolderHere/config.plist
and set the desired screen resolution(OVMF by default is 1024×768). Do note that you may experience display corruption with higher resolutions, be sure to set this properly.
sudo ./clover-image.sh --iso Clover-v2.4k-4630-X64.iso --cfg $HOME/YourFolderHere/config.plist --img clover.qcow2
- Next you will want to add some kext files to your newly created clover boot disk. The kexts files needed are also located in the Hackintosh-KVM repository. The kext files in this repository are used for GPU sensors, PulseAudio pass-through, and the Virtio-Net network device. The WhateverGreen kext is also needed if you use a AMD GPU, however it has not been tested. This step will also require the NBD kernel module to be loaded.
- Connect and mount the clover.qcow2 image:
sudo modprobe nbd
sudo qemu-nbd --connect=/dev/nbd0 /$HOME/YourFolderHere/clover.qcow2
fdisk /dev/nbd0 -l
sudo mount /dev/nbd0p1 /mnt/somemntpoint/ - Disconnect and unmount from the clover.qcow2 image:
umount /mnt/somemntpoint/
sudo qemu-nbd --disconnect /dev/nbd0
sudo rmmod nbd - Instead of building your own bootable Clover disk, you may want to use the included
clover.qcow2
disk image from the Hackintosh-KVM repository instead for ease of use, as this contains all the kext files needed, and offers a 1920×1080 screen resolution. It should be noted that the clover.qcow2 image can be useful as backup EFI bootloader in case you were to mess up your bootloader during a Clover update. - Before fully starting Clover on your new virtual machine, you will want to make sure that the OVMF resolution is set equal to the resolution set in your clover.qcow2 file. The OVMF default is 1024×768 and the clover.qcow2 image you will be using is set to 1920×1080, not setting this correctly will lead to display corruption and possible boot failures. The resolution can be set via the OVMF boot menu, which is able to be reached by pressing the ESC button on your keyboard during the OVMF boot logo, before the Clover boot screen appears.
Installer Steps
- After booting, the initial language selection should show up. Select your preferred language, then select Disk Utility and erase your target disk. You can use HFS+ or APFS, as the clover.qcow2 image we are using has the proper EFI files for either file system. If you do choose APFS, make sure you place the apfs.efi file into your EFI folder when you install Clover to your boot disk.
- High Sierra’s (< 10.13.3) Disk Utility does not recognize un-formatted disks, unless you click View > Show All Devices, quit Disk Utility, then relaunch it.
- In some rare cases the target disk may not not appear in Disk Utility, for that you will need to use the Terminal app on the installer and prepare the hard drive for installation manually using the commands below.
diskutil list
diskutil eraseDisk JHFS+ macOS disk0
# Adapt this according to your system
- When you are done, quit Terminal.
- Now, you can continue with the installation as you normally would.
- When you are finished, the virtual machine will reboot automatically and the first time setup screen will appear, congratulations, you now have a Hackintosh-KVM virtual machine with close to bare metal performance! Hold on though, you’re not done yet, the last step is to follow the Post-Install Steps below, and put the Clover bootloader on the drive you just installed macOS to, so you can have the benefit of adding additional kext files, etc., in the future to make your virtual machine work better.
Post-Install Steps
First, you will want to install Clover to the main disk where macOS High Sierra was installed in the previous steps. You will also want to use the config.plist
and i440fx-acpi-dsdt.aml
files from the Hackintosh-KVM repository, as this has everything set as it would be in the clover.qcow2
image. The i440fx-acpi-dsdt.aml
file will be placed in the EFI/CLOVER/ACPI/origin
folder. Be sure not to forget the kext files you need and place them into the Kexts
folder.
To use QEMU’s “host” CPU model you will need to make sure that these options are enabled in Clover Configurator’s “Kernel and Kext Patches” section.
You will also want to remove the +hypervisor
bit from the QEMU cpu argument at the bottom of the xml file and set in Clover Configurator’s CPU section your system clocks as close as possible.
qemu:arg value='-cpu'
qemu:arg value='host,vendor=GenuineIntel,kvm=on,vmware-cpuid-freq=on,+invtsc'
To enable PS/2 mouse and keyboard emulation the VoodooPS2.kext
will be needed, for ICH6 or ICH9 PulseAudio pass-through the VoodooHDA.kext
is needed. The author found that using the emulated USB mouse and keyboard drivers, the keys have would have issues with sticking during a long keystroke on the authors hardware. Your mileage may vary here and technically no additional kext file is needed to use QEMU’s emulated USB mouse and keyboard.
For mounting of other filesystems (NTFS,EXT4,etc.) refer to:https://github.com/macOSfuse/macOSfuse
Drivers saxa usb devices.
Osx Vm Linux
For a quick way to install Nvidia drivers refer to:https://github.com/Benjamin-Dobell/nvidia-update/blob/master/README.md
If you like what we do here, consider supporting us on Patreon.
Hackintosh Linux Vm
Images courtesy PixaBay