During a recent pentest, I needed to throw together a macOS virtual machine. Although there was lots of guides around the web, none seemed to work from start to finish. This post contains the steps I extracted from various resources in order to get a fully working High Sierra install within VirtualBox 5.
Mar 31, 2021 Out of all the Apple operating systems, macOS High Sierra is the most manageable and straightforward macOS installation on VirtualBox. Using the VMDK formatted file, we are taking a very intentional path to run the operating system in a virtualization environment. Download MacOS High Sierra VMDK. You have to get macOS High Sierra VMDK in the link supplied.
Tutorial to install Hackintosh High Sierra on Thinkpad x220 After that in the BIOS select the first boot on your UEFI flash disk. Or you can restart, then hold down f11, then select UEFI Flash disk to enter the installation process via usb. A: Check to make sure your Install macOS High Sierra App is the correct one. It should be around 5GB in size. If you used the 'Skip App Verification' option, you have most likely selected an invalid app that doesn't contain the necessary files. Q: I cannot open my copy of Install macOS High Sierra with the patch tool.
Step 1: Download The High Sierra Installer
To do this, you need to be on an existing macOS system. I was unable to find the download within the App Store itself, but following this link opened the App Store at the correct page: https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?mt=12
After opening the aforementioned page in the App Store, start the download, but cancel the installation when it starts.
You can then verify that the installer has been downloaded by checking that
'/Applications/Install macOS High Sierra.app' exists.
Step 2: Create a Bootable ISO
Next, you need to create an ISO from the installer application that was downloaded in step 1.
Running the below commands will create an ISO on your desktop named
Install High Sierra Virtualbox Download
Step 3: Creating the Virtual Machine
I experimented with a few different settings in regards to the CPU and RAM allocation. I didn’t find a combination that didn’t work, but create a VM with the following things in mind:
- Ensure the name of the VM is
MacOS(ensure to keep the same casing)
- Ensure the type is
Mac OS Xand the version is
macOS 10.12 Sierra (64-bit)(there is a High Sierra option too, but I chose Sierra by accident and it worked)
System > Motherboard > Boot Order
- Use >= 4096 MB of memory in
System > Motherboard
- Use >= 2 CPUs in
System > Processor
- Use 128 MB of video memory in
Display > Screen
- Optionally enable 3D acceleration in
Display > Screen
- Remove the IDE device in
Storage > Storage Devicesand replace it with a SATA controller
- Add a new hard disk device under the SATA controller with >= 60 GB of space
- Ensure an optical drive is present under the SATA controller and mount the previously created ISO to it
- Untick the
Enable Audiooption under
After creating the virtual machine with the above configuration, hit OK and exit the settings screen. Now, a number of extra options need to be set.
If you’re on Windows, you’ll need to
cd into the appropriate directory under the VirtualBox installation path to run
VBoxManage. For Linux users, this should be in your
PATH variable already:
After running the above commands, the VM should be ready to boot!
Step 4: Installation
This is where near enough everything I read stopped, despite there being one more problem in the way - UEFI.
Boot into the VM, go into Disk Utility and erase the virtual disk that you added to the machine.
After erasing the disk, start the installation procedure. After a short amount of time, it will reboot the VM.
Once it reboots, it’s going to boot back off the ISO again, once it’s done this, just shutdown the VM and eject the disk [the ISO] and then start the VM again to boot from disk.
Install Mac Os High Sierra Virtualbox
On the next boot, it should boot into the installer that was copied to disk, but instead, you will be presented with a UEFI shell like below:
To continue the macOS installation, follow these steps:
exitand hit return
Boot Maintenance Managerand hit return
Boot From Fileand hit return
- You will see two partitions, select the second partition and hit return
macOS Install Dataand hit return
Locked Filesand hit return
Boot Filesand hit return
boot.efiand hit return
After following these steps, you will boot into the remainder of the macOS installation. From here, just follow the steps as per a regular macOS installation.
The next time you boot your virtual machine, you will not have to go through the UEFI shell; it should work without any further problems.
Step 5: Tweaking The Resolution
As there is no VirtualBox additions for macOS, the screen resolution won’t automatically change. If you know what resolution you wish to use, however, you can set it manually.
Ensure the virtual machine is powered off, and then run the following command; replacing
1920x1080 with whatever resolution you would like to use:
After running the above command, the next time you boot the machine, it will use the resolution specified.
Install High Sierra Dmg
Now, you should have a fully working macOS virtual machine!
The information found in this post was pieced together from the following sources:
There are three major steps to install OS X High Sierra in VirtualBox in a Windows 10 host:
I used a Mac in the first two steps and completed the last two steps on the target Windows machine.
Downloading High Sierra
At the time of this writing, High Sierra was the most recent version of Mac OS X that could be installed in a VirtualBox virtual machine. However, High Sierra is no longer available for download from the Apple App Store.
Upgrade To High Sierra
High Sierra can still be downloaded from third-party websites. I downloaded a copy through this macOS High Sierra Patcher Tool for Unsupported Macs. Once the tool is downloaded, open it and use its built-in downloading feature. In the menu bar, select Tools > Download macOS High Sierra…
After a few minutes, you should have a copy of the High Sierra installer.
Preparing an ISO
Once you have a copy of the High Sierra installer, an iso file must be prepared to install it in the virtual machine. The only way I could get an iso that worked on VirtualBox was by using the script suggested in this superuser.com answer:
Note that this is the original script, and it was written assuming that the High Sierra installer was downloaded from the App Store into the Applications directory. Before running the script, make sure the installer variable points to the right location of your High Sierra installer.
Setting up the Virtual Machine
Switch to the Windows 10 machine in which you want to set up the virtual machine. Copy over the iso created in the previous step and make sure both VirtualBox and its extension pack are installed. If not, both can be downloaded from this page. With both pieces of software installed, create the virtual machine the following steps:
- Open VirtualBox
- Click New to create a new virtual machine.
- Enter the name for the new virtual machine; e.g., High Sierra, and click Next.
- Select the amount of RAM for your virtual machine, making sure you leave enough for Windows, and click Next.
- Choose Create a virtual hard disk now and click Create.
- Leave the default setting VDI (Virtual Disk Image) and click Next.
- Leave the default setting Dynamically allocated and click Next.
- Choose the size of the virtual hard disk and click Create.
At this point, the virtual machine has been created, but it requires extra configuration to install High Sierra from the iso file you created earlier.
- Select the High Sierra virtual machine you just created and click Settings (the button with the cog icon).
- On the side menu, click System.
- On the Motherboard tab of the right panel, uncheck the Floppy option from the Boot Order list.
- Switch to the Processor tab, set the number of Processor(s) to 2 or more and check the Enable PAE/NX option.
- On the side menu, click Storage.
- Under storage devices, click Empty.
- Under Attributes, click the optical disk icon.
- Select the High Sierra iso, and check the Use host I/O cache option.
- On the side menu, click Display.
- Set Video Memory to 128 MB.
- Click OK to save.
For the last configuration steps, close VirtualBox, open the Windows command line prompt, and run the following commands:
Finally, open VirtualBox again, select your High Sierra virtual machine, and click Start. This will boot your virtual machine with the High Sierra iso set up earlier. Simply follow the steps to install the operating system.
I also have a YouTube video going over the whole process.
- Early-2008 or newer Mac Pro, iMac, or MacBook Pro(MacPro 3,1 and 4,1, iMac 8,1 and 9,1, MacBook Pro 4,1, 5,1 5,2, 5,3,5,4, and 5,5)
- Late-2008 or newer MacBook Air or Aluminum Unibody MacBook (MacBookAir 2,1, MacBook 5,1)
- Early-2009 or newer Mac Mini or white MacBook (Macmini 3,1, MacBook 5,2)
- Early-2008 or newer Xserve (Xserve 2,1, Xserve 3,1)
Machines that ARE NOT supported:
- 2006-2007 Mac Pros, iMacs, MacBookPros, and Mac Minis (MacPro 1,1 and 2,1, iMac 4,1, 5,1, 5,2, 6,1 and7,1, MacBook Pro 1,1, 2,1, and 3,1, Macmini 1,1 and 2,1)
-- The 2007 iMac 7,1 is compatible if the CPU is upgraded to a Penryn-based Core 2 Duo, such as a T9300.
- 2006-2008 MacBooks (MacBook 1,1, 2,1 3,1 and 4,1)
- 2008 MacBook Air (MacBookAir 1,1)
-- Note: Make sure SIP is disabled on the system you intend to installHigh Sierra on. If it's not or you're unsure, just boot into your Recoverypartition of your currently installed copy of OS X, open Terminal, andrun 'csrutil disable'.
Things you'll need:
- A copy of the macOS High Sierra InstallerApp. This can be obtained from the Mac App Store using a machinethatsupports High Sierra, or by using the built-in downloading feature of the tool. In the Menu Bar, simply select 'Tools > Download macOS High Sierra...'
- A USB drive that's at least 8 GB in size
- A copy of the tool - Download here (Current version: 2.7.0, SHA1: 73f180d30200ef5f6d900440fe57b9c7d22bd6bf)
-- View changelog and download older versions here
- Trackpad (MacBook5,2 affected only). The trackpad in the MacBook5,2isn't fully supported in High Sierra. While it works and is fully usable,High Sierra detects it as just a standard mouse, preventing you fromchanging some trackpad-oriented settings.
How to use:
1. Insert your desired USB drive, open Disk Utility, and format it as OS X Extended (Journaled).
2. Open the 'macOS High Sierra Patcher' tool, and browse for your copy of the macOS High Sierra Installer App.
*Ensure that the tool successfully verifies the app.
3. Next, select your USB drive in the Target Volume list, and click 'Start Operation.'
4. When the operation completes, boot your target unsupported Mac offthe USB drive you just created by holding down the Option key while turning on the machine, and selecting the drive.
Note: Only perform steps 5 and 6 if you intend to do a clean install.Otherwise, you can simply skip these steps and install to your volumecontaing a previous version of OS X, and it'll do an in-place upgrade.
5. When the installer boots, open Disk Utility from the Utilities menu, or by double-clicking it in the Utilities window on the bottom left corner of the screen.
6. Select the disk or partition you want to install on, and erase it,ensuring to use either Mac OS Extended (Journaled), or APFS as the filesystem type.If formatting an entire drive, ensure GUID is selected.
-- Please note that if you use APFS, you will not have a bootable Recovery partition.
-- It is recommended that you only use APFS if the target drive is an SSD.
-- If you decide to use APFS, a custom booting method will be installed by the post-install tool, as the firmware of these unsupported machines does not natively support booting from APFS volumes. It is not quite as clean as native booting, but will not cause any issues while running High Sierra. A demo of the modified booting process can be viewed here.
7. Install macOS normally onto the desired volume.
8. When the install completes, reboot back onto the installer drive.This time, open the 'macOS Post Install' application.
9. In the application, select the Mac model you are using. The optimalpatches will be selected for you based on the model you select. You canalso select other patches of your choosing.
-- The 'i' button next to each patch will show more details about the respective patch.
10. Select the volume you have just installed macOS High Sierra on, andclick 'Patch.' When it finishes patching, click 'Reboot'. It may sitthere for a few moments rebuilding caches before rebooting.
-- If for somereason the system fails to work correctly after rebooting, boot backinto your installer drive, run the post install patch again, and select'Force Cache Rebuild' before rebooting. This isn't necessary under mostcircumstances.
11. When it reboots, it should now boot into a fully working copy ofmacOS High Sierra.
- If selected in the macOS Post Install tool, your High Sierra install will have a program named 'Patch Updater' located in your /Applications/Utilities folder. This program will alert you when new updates to patches are available for your machine, and will prompt you to install them. If you do not have Patch Updater installed, but would like it, you can download and run the script found here to do so.
System updates, such as 10.13.1, should install normally if 'Software Update Patch' was selected in the macOS Post Install tool, or installed using the Patch Updater program. If for some reason updates aren't showing up, or you did not apply the patch, you can install it manually using the script found here.
-- If the machine does not start up properly after applying a system update, you will need to boot off your patched installer volume, and re-run the post-install patch on your High Sierra volume. Ensure you select 'Force Cache Rebuild' before rebooting.
Q: The tool created the USB drive successfully, but when booting, the progress bar hangs a bit more than half way.
A: Check your copy of the Install macOS High Sierra App. If you're using thelatest version of the tool, you must be using the latest version of theInstall macOS High Sierra App. Version 1.1 ofthe patch tool and older support older versions of the installer app.
Q: The patch tool gives me errors, such as 'Error copying files...'.
A: Check to make sure your USB drive is writeable. Try re-formatting it, or just try a different USB drive.
Q: The patch tool gives me a 'Mounting Failed' error
A: Check to make sure your Install macOS High Sierra App is the correct one.It should be around 5GB in size. If you used the 'Skip App Verification' option, you have most likely selected an invalid app thatdoesn't contain the necessary files.
Q: I cannot open my copy of Install macOS High Sierra with the patch tool.
A: If you downloaded the copy linked above, it is distributed inside aDMG file. You must open this file (mount it) to access the InstallmacOS High Sierra App you need to select.
Q: I don't see my hard drive partition in the installer screen or in the post-install tool.
A: Make sure FileVault is disabled, or use the instructions found here to unlock it manually using Terminal.
Q: I get a 'NO' symbol when starting up after successfully installing High Sierra.
A: Make sure you have run the post-install patch on the correct volume, as detailed above in steps 8-10.
Q: I get a 'NO' symbol when starting up from the patched USB drive
A: Check the supported/not supported list at the top of this page. Ensure your machine is in the supported list.
Q: My iSight camera doesn't work after installing High Sierra
A: Make sure you properly remove (using the program's uninstaller, not by simply dragging the application to the Trash) all virtual machine software installed on your machine, such as VirtualBox, VMWare, etc.
Q: I get 'NSURL' errors when trying to update my machine or use the App Store
A: This is usually the result of having an invalid CatalogURL set. To revert to stock, simply run 'sudo softwareupdate --clear-catalog' in Terminal, and then run the software update patch script located above.
Q: Safari, App Store, and/or Mail stopped working after installing a system update
A: Download and run the Onyx application, select 'Maintenence' at the top, then click the Run button.
Q: I get a 'No packages were eligible for install' error when attepting to install High Sierra
A: This is due to your system's date and time being set incorrectly. To fix it, you can either boot into your current OS X install and set the date, or you can use Terminal after booting from your patched USB installer drive to set the date. Instructions to set the date using Terminal can be found here.