Table of contents:

How to install macOS through a virtual machine
How to install macOS through a virtual machine
Anonim

Detailed instructions for those who need Xcode or just want to try Apple's proprietary OS.

How to install macOS through a virtual machine
How to install macOS through a virtual machine

1. Check PC compatibility

You need a relatively modern computer to run macOS. For more or less comfortable work, you need a quad-core processor, 8 GB of RAM and discrete graphics.

In addition, the processor must support virtualization technologies at the hardware level. For Intel chips, this is VT-x or VT-d, for AMD - AMD-V. Almost all modern processors have it, but it will not be superfluous to check.

How to install macOS through a virtual machine: Check PC compatibility
How to install macOS through a virtual machine: Check PC compatibility

This can be clarified in the description of a specific chip model on the manufacturer's website or using the free CPU-Z utility.

  1. application from the official website and install.
  2. Start CPU-Z and take a look at the Instructions line.
  3. If there are the above markings, then everything is in order.
  4. If not, you can use software virtualization, but in this case the performance will be noticeably lower.

2. Prepare the macOS image

MacOS installation images are not freely available, and Apple prohibits the use of its OS on computers from other manufacturers. To get an image of a bootable disk, you can try to find it on the Internet or borrow a Mac from a friend.

We will use the second option.

  1. On a Mac, go to and click Open App Store.
  2. Click "Download", wait for the installer to download and close it.
  3. Open the Applications folder → Utilities and launch Terminal.
  4. Create a disk image container by copying the command

    hdiutil convert ~ / Desktop / InstallSystem.dmg -format UDTO -o ~ / Desktop / HighSierra.iso

  5. Mount it with the command

    hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -mountpoint / Volumes / install_build

  6. Expand the system installer to the created image with the command

    sudo / Applications / Install / macOS / High / Sierra.app/Contents/Resources/createinstallmedia --volume / Volumes / install_build

  7. Enter the administrator password and confirm by pressing Y and Enter.
  8. Move the image to the desktop with the command

    mv /tmp/HighSierra.cdr.dmg ~ / Desktop / InstallSystem.dmg

  9. Unmount the installer with the command

    hdiutil detach / Volumes / Install / macOS / High / Sierra

  10. Convert macOS image to ISO format with the command

    hdiutil convert ~ / Desktop / InstallSystem.dmg -format UDTO -o ~ / Desktop / HighSierra.iso

  11. Change the extension of the image file to ISO and transfer it using a flash drive to the PC where the virtual machine will be installed.

3. Select and install virtualization software

There are many free and paid virtual machines out there. VmWare, Parallels, VirtualBox are suitable for installing macOS. For our example, take the latter: it is freely available and well known.

  1. to the official VirtualBox website and click on the Windows hosts link.
  2. Open the downloaded file and follow the instructions of the installation wizard.
  3. Confirm the installation of additional components in the process.

4. Create a virtual machine

Now in VirtualBox, we need to create our virtual computer, on which we will later install macOS.

  1. Run the utility, click the "Create" button and enter a name for the machine.
  2. Specify the type and version of the OS, in our case - Mac OS X and macOS 10.13 High Sierra.
  3. Enter the amount of RAM. The more, the better, but it is better not to go beyond the green zone.
  4. Select "Create a new virtual disk" and the VDI type.
  5. Specify the format "Dynamic" and set the desired size. Recommended from 30 GB, depending on the amount of software that you plan to use.

5. Configure the virtual machine

To start the guest OS correctly, you need to allocate the optimal amount of resources on the main computer, configure some settings and select the macOS image as the boot disk.

  1. Select the virtual machine and click Configure in the toolbar.
  2. Go to the "System" section and on the "Motherboard" tab, uncheck the "Floppy disk" item, and then move it down using the arrow. Leave the rest unchanged.
  3. On the "Processor" tab, specify the number of cores. Better not to leave the green area.
  4. In the "Display" section, set the maximum amount of video memory and make sure that both acceleration checkboxes are unchecked.
  5. In the "Media" section, click on the "Empty" line, and then on the disk icon and select the ISO image that we prepared in the second step.
  6. Click OK to save the settings and close VirtualBox.

6. Configure additional parameters

Due to the limitations mentioned above, macOS only runs on branded Apple computers. In order for the system to be installed in VirtualBox, you have to tinker a little in the console and pretend to be an iMac.

  1. Open search, enter cmd and run Command Prompt.
  2. Copy the following commands one by one, replacing mac with the name of your virtual machine.

cd "C: / Program Files / Oracle / VirtualBox \"

VBoxManage.exe modifyvm "mac" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff

VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal / Devices / efi / 0 / Config / DmiSystemProduct" "iMac11, 3"

VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal / Devices / efi / 0 / Config / DmiSystemVersion" "1.0"

VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal / Devices / efi / 0 / Config / DmiBoardProduct" "Iloveapple"

VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal / Devices / smc / 0 / Config / DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal (c) AppleComputerInc"

VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal / Devices / smc / 0 / Config / GetKeyFromRealSMC" 1

7. Install macOS in a virtual machine

Now you can proceed to the installation of macOS itself. This procedure is divided into several stages and takes about an hour. In the process, you will have to tinker with the command line again, but this time for the last time.

First step

  1. Open VirtualBox and start the virtual machine.
  2. The system will begin to preload. A lot of text will be displayed on the screen, among which there may be information about errors. Pay no attention to this.
  3. After a few minutes, the apple logo will appear and the graphical interface will load.
  4. Select your system language and run Disk Utility from the menu.
  5. Specify the virtual disk that we created in the fourth step and click the "Erase" button.
  6. Give the name and leave the rest of the options as they are. Confirm erasing.
  7. Select Install macOS from the Utilities window and click Continue.
  8. Accept the license agreement and click on the created disc.
  9. Wait while the installation files are copied to disk and the system reboots.
  10. When the macOS Utilities window reappears, go to the Apple menu and click Shut Down.

Second phase

  1. Select the virtual machine in VirtualBox and open its settings.
  2. Go to the "Media" section and click on the HighSierra.iso line, and then on the disk icon and click on "Remove disk from drive".
  3. Click OK and start the virtual machine again.
  4. After booting, a UEFI shell with a command line appears, into which you need to manually enter the following commands one by one:

Fs1:

cd "macOS Install Data"

cd "Locked Files"

cd "Boot Files"

boot.efi

Stage Three

  1. This will launch the graphical interface and continue with the installation.
  2. After a few minutes, the virtual machine will reboot and the initial system configuration interface will open.
  3. Specify the country and keyboard layout.
  4. Select Don’t transfer any information now to set up the system as new.
  5. Skip signing in to your Apple ID by clicking Setup later and Skip.
  6. Accept the terms of the license agreement, and then enter your username and password.
  7. Click Continue and follow the prompts to customize your keyboard.

8. Check the operation of the virtual machine

MacOS installation is complete. The operating system runs in a separate window that can be minimized or moved to another monitor.

To turn on the virtual machine, open VirtualBox and click the Start button. Shutdown and reboot can be done both from the utility and through the macOS system menu.

Recommended: