Sådan installeres macOS High Sierra i VirtualBox på Windows 10

Uanset om du lejlighedsvis vil teste et websted i Safari eller prøve en lille smule software i Mac-miljøet, er det nyttigt at have adgang til den nyeste version af macOS på en virtuel maskine. Desværre, du er ikke rigtig meningen at gøre dette-så få MacOS kører i VirtualBox er, for at sige det mildt, vanskelig.

Opdatering: Instruktionerne her gælder for ældre versioner af macOS. Hvis du vil installere en nyere version af macOS i VirtualBox, skal du tjekke dette script på GitHub. Det lover at tage dig igennem processen med installation og opsætning af en virtuel macOS-maskine. Vi har endnu ikke testet det selv, men vi har hørt gode ting.

Det er dog ikke umuligt. Nogle af folkene på InsanelyMac-foraene har fundet ud af en proces, der fungerer. Det eneste, der  ikke fungerer, er lyd, som af en eller anden grund er meget forvrænget eller ikke-eksisterende. Bortset fra det er dette dog macOS High Sierra, der kører problemfrit i VirtualBox.

For at gøre tingene lettere for folk har vi kombineret metoder fra et par forskellige forumtråde til en enkelt trin-for-trin tutorial komplet med skærmbilleder. Lad os dykke ind.

RELATERET: Beginner Geek: Sådan oprettes og bruges virtuelle maskiner

BEMÆRK: For at få dette til at fungere skal du have adgang til en rigtig Mac for at downloade High Sierra. Du formoder, antager vi, at få en High Sierra ISO på andre måder, men vi anbefaler det ikke. Lån en vens Mac i en time, hvis du ikke har en, og du skal have det godt - alt ud over trin et i denne vejledning kan gøres på din Windows-pc.

Hvis du bruger en Mac og vil have en virtuel macOS-maskine til brug på den Mac, anbefaler vi at tjekke Parallels Desktop Lite i stedet for, fordi den kan oprette virtuelle macOS-maskiner gratis og er meget lettere at arbejde med.

Klar til at komme i gang? Lad os hoppe ind!

Trin et: Opret en macOS High Sierra ISO-fil

For at starte skal vi oprette en ISO-fil af macOS High Sierra's installationsprogram, så vi kan indlæse den i VirtualBox på vores Windows-maskine. Tag din lånte Mac, gå til Mac App Store, søg efter Sierra, og klik på "Download".

Når processen er færdig, starter installationsprogrammet — det er okay, luk det bare med Command + Q. Vi ønsker ikke at opgradere din vens Mac; vi har bare brug for de downloadede filer.

For at konvertere disse filer til en ISO skal vi bruge terminalen, som du kan finde i Programmer> Hjælpeprogrammer.

Kør først følgende kommando for at oprette et tomt diskbillede:

hdiutil create -o /tmp/HighSierra.cdr -størrelse 7316m -layout SPUD -fs HFS + J  

Monter derefter dit blanke billede:

hdiutil vedhæft /tmp/HighSierra.cdr.dmg -overvåg -nobrowse -mountpoint / Volumes / install_build

Nu skal du gendanne BaseSystem.dmg fra installationsprogrammet til det nyligt monterede billede:

gendanne asr-kilde / Applikationer / Installer \ macOS \ High \ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target / Volumes / install_build -noprompt -noverify -erase

Bemærk, at efter at have gjort dette, er navnet på vores destinationsmonteringspunkt ændret til "OS X Base System / System." Du er næsten færdig! Afmonter billedet:

hdiutil løsne / Volumes / OS \ X \ Base \ System

Og endelig konverter det billede, du oprettede, til en ISO-fil:

hdiutil konvertere /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso

Flyt ISO til skrivebordet:

mv /tmp/HighSierra.iso.cdr ~ / Desktop / HighSierra.iso

Og du har en bootbar High Sierra ISO-fil!

Kopier det til din Windows-maskine ved hjælp af et stort flashdrev, en ekstern harddisk eller over dit lokale netværk.

Trin to: Opret din virtuelle maskine i VirtualBox

Gå derefter til din Windows-maskine, og installer VirtualBox, hvis du ikke allerede har gjort det, og sørg for at du har den nyeste version (alvorligt, ældre versioner fungerer muligvis ikke.)

Åbn den, og klik på knappen "Ny". Navngiv din virtuelle maskine "High Sierra", og vælg "Mac OS X" til operativsystemet og "Mac OS X (64-bit)" til versionen (i skrivende stund tilbydes "macOS High Sierra" ikke, men det er fint.)

Fortsæt gennem processen. Til hukommelse anbefaler vi, at du bruger mindst 4096 MB, selvom du kan vælge mere, hvis du har nok RAM til rådighed på din Windows-maskine.

Derefter bliver du spurgt om din harddisk. Vælg "Opret en virtuel harddisk nu" og klik på Opret.

Vælg VDI for harddisk type, og klik på Næste. Du bliver spurgt, om du vil have et drev med dynamisk størrelse eller fast. Vi anbefaler Fixed Size, da det er lidt hurtigere, selvom det tager lidt mere plads på harddisken på din Windows-maskine.

Klik på Næste. Du bliver spurgt, hvor stort et drev du vil have; Vi anbefaler mindst 25 GB, hvilket er stort nok til operativsystemet og et par applikationer. Afhængigt af din opbevaringssituation kan du tilbyde mere, men vi tror ikke, du virkelig kan bruge meget mindre end det.

Klik gennem vejledningen, og du har oprettet en post til din virtuelle maskine! Nu er det tid til at lave en lille konfiguration.

Trin tre: Konfigurer din virtuelle maskine i VirtualBox

Du skal se din virtuelle maskine i VirtualBoxs hovedvindue.

Select it, then click the big yellow “Settings” button. First, head to “System” in the left sidebar. On the Motherboard tab, make sure that “Floppy” is unchecked.

Next head to the “Processor” tab, and make sure you have at least two CPUs allocated to the virtual machine.

Next, click “Display” in the left sidebar, and make sure Video Memory is set to at least 128MB.

Next, click “Storage” in the left sidebar, then click the “Empty” CD drive. Click the CD icon at the top right, then browse to the High Sierra ISO file you created earlier.

Be sure to click “OK” to finalize all the changes you’ve made, then close VirtualBox. No, seriously: close VirtualBox now, or the next steps won’t work.

Step Four: Configure Your Virtual Machine From The Command Prompt

We’ve made a few tweaks, but we need to make a few more more in order to convince the operating system it’s running on a real Mac. Sadly, there are no options for this from VirtualBox’s interface, so you’ll need to open the Command Prompt.

Open the Start Menu, search for “Command Prompt,” then right-click it and select “Run as administrator.”

You need to run a number commands, in order. Paste the following commands, pressing Enter after each one and waiting for it to complete:

cd "C:Program FilesOracleVirtualBox"
VBoxManage.exe modifyvm "High Sierra" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-2BD1B31983FE1663"
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

That’s it! If everything worked, you shouldn’t see any feedback; the commands will simply run. If the command did not work, make sure your virtual machine is named “High Sierra” exactly; if it isn’t, edit the commands above putting your machine’s name in the quotes. Go ahead and close the Command Prompt. We’re heading back to VirtualBox now.

Step Five: Boot and Run The Installer

Re-open VirtualBox, click your Sierra machine, then click “Start.” Your machine will start to boot. You will see a lot of superfluous information as this happens—and I mean a lot—but don’t worry about it. It’s normal, even some of the things that look like errors.

You should only worry if a specific error hangs for five minutes or more. Just walk away and let it run for a bit. If you’ve done everything right, it’ll boot.

Eventually, you’ll see the installer asking you to pick a language:

Pick “English,” or whatever language you prefer, then click “Next.” Before you do anything else, however, click “Disk Utility” then “Continue.”

You won’t see the drive: don’t panic, High Sierra hides blank drives by default. In the menu bar, click “View” followed by “Show All Devices.”

You should now see your empty virtual drive in the sidebar. Click it, then click the “Erase” option.

Name the drive “Macintosh HD,” and leave the other two settings as-is: “Mac OS Extended Journaled” and “GUID Partition Map”. Do not create an AFS partition, because it will not work and you’ll have to start over with a new virtual hard drive. Click “Erase,” then close Disk Utility when the process is complete. You’ll be brought back to the main window.

Select “Reinstall macOS” then click “Continue.” You’ll be asked to agree with the terms.

Agree and you’ll eventually be asked to choose a hard drive; select the partition you just made.

The installation will begin! This might take a while, so be patient. Eventually your virtual machine will restart and take you…back to the installer. Don’t panic: this is to be expected.

Step Six: Boot Installer Stage Two From the Virtual Hard Drive

At this point the installer has copied files onto the virtual hard drive, and expects to boot from there. For whatever reason this does not work on the virtual machine, which is why you’re seeing the installer again.

Turn off your virtual machine and open its settings. Head to Storage, click “HighSierra.iso” in the “Storage Tree” panel, then click the CD icon at top-right and click “Remove Disk from Virtual Drive.” This will completely disconnect our installation ISO.

Now start up the virtual machine and you’ll see this lovely screen.

This is the EFI Internal Shell, and as long as you see “FS1” listed in yellow, you can use it to launch the rest of the installer. Click the virtual machine and allow it to capture you mouse and keyboard, then type fs1: and hit Enter. This will switch directories to FS1, where the rest of the installer is located.

Next we’re going to run a few commands in order to switch to the directory we need:

cd "macOS Install Data" cd "Locked Files" cd "Boot Files"

Now we can run the installer itself with the following command:

boot.efi

The installer will pick up where it left off. First you’ll see a series of text, like before, but eventually you’ll see the GUI installer come back. (Don’t worry, you only have to go through this process once.)

We’re getting there, just need a little bit more patience.

Step Eight: Log Into macOS High Sierra

Eventually the virtual machine will reboot again, this time into macOS High Sierra. If that doesn’t happen, try ejecting the ISO from the Virtual Machine. When High Sierra does boot, you’ll need to go through choosing your country, setting up a user, and the rest of the initial setup process.

Eventually, you’ll make it to the Mac desktop. Yay!

You can now try out any Mac software, though some functions, like FaceTime and Messages, won’t work because Apple won’t recognize your computer as a real Mac. But a lot of the basic stuff should work. Have fun!

Step Eight (Optional): Change Your Resolution

By default, your virtual machine will have a resolution of 1024×768, which is not a lot of room to work with. If you try to change the resolution from within macOS, however, you will see no option to do so. Instead, you need to enter a few commands.

Shut down your Virtual Machine by shutting down macOS: click the Apple in the menu bar, then click “Shut Down.” Next, close VirtualBox entirely (seriously, this step will not work if VirtualBox is still open!) and head back to Windows’ Command Prompt as an admin. You need to run the following two commands:

cd "C:Program FilesOracleVirtualBox"
VBoxManage setextradata "High Sierra" "VBoxInternal2/EfiGopMode" N

In the second command, you need to replace the N with a number from one to five, depending on what resolution you want:

  • 1 gives you a resolution of 800×600
  • 2 gives you a resolution of 1024×768
  • 3 gives you a resolution of 1280×1024
  • 4 gives you a resolution of 1440×900
  • 5 gives you a resolution of 1920×1200

Start up VirtualBox, load up your virtual machine, and it should boot to your preferred resolution!

RELATED:10 VirtualBox Tricks and Advanced Features You Should Know About

Fra nu af kan du åbne VirtualBox til enhver Mac-relateret test, du vil lave. Igen vil du se, at mange fejl dukker op under opstart, men de er fine; ignorere dem. Husk også, at lyd ikke fungerer, heller ikke ting som FaceTime eller iMessage, som kræver en ægte Mac. Dette vil ikke være perfekt, hvilket kan forventes fra en fuldstændig ikke-understøttet opsætning. Men det er macOS på en virtuel maskine, og det er ikke dårligt! Sørg for at tjekke vores guide til VirtualBoxs avancerede funktioner for også at få mest muligt ud af din maskine.

En ting mere: et stort råb til Chad S. Samuels, uden hvem jeg ikke kunne have opdateret denne guide til High Sierra. Mange tak!