วิธีติดตั้ง macOS High Sierra ใน VirtualBox บน Windows 10

ไม่ว่าคุณจะต้องการทดสอบเว็บไซต์ใน Safari เป็นครั้งคราวหรือลองใช้ซอฟต์แวร์เล็กน้อยในระบบ Mac การเข้าถึง macOS เวอร์ชันล่าสุดในเครื่องเสมือนก็มีประโยชน์ น่าเสียดายที่คุณไม่ควรทำสิ่งนี้จริงๆดังนั้นการทำให้ macOS ทำงานใน VirtualBox นั้นเป็นเรื่องที่ยุ่งยาก

อัปเดต:คำแนะนำที่นี่ใช้กับ macOS เวอร์ชันเก่า หากคุณต้องการติดตั้ง macOS เวอร์ชันใหม่กว่าใน VirtualBox ให้ดูสคริปต์นี้ใน GitHub สัญญาว่าจะนำคุณผ่านขั้นตอนการติดตั้งและตั้งค่าเครื่องเสมือน macOS เรายังไม่ได้ทดสอบด้วยตัวเอง แต่เราได้ยินสิ่งดีๆ

อย่างไรก็ตามไม่ใช่เรื่องที่เป็นไปไม่ได้ คนบางคนในฟอรัม InsanelyMac ได้ค้นพบกระบวนการที่ใช้ได้ผล สิ่งเดียวที่ใช้  ไม่ได้คือเสียงซึ่งด้วยเหตุผลบางประการที่ผิดเพี้ยนอย่างมากหรือไม่มีอยู่จริง นอกเหนือจากนั้นนี่คือ macOS High Sierra ซึ่งทำงานได้อย่างราบรื่นใน VirtualBox

เพื่อให้ง่ายขึ้นสำหรับผู้คนเราได้รวมวิธีการจากเธรดฟอรัมที่แตกต่างกันสองสามหัวข้อไว้ในบทช่วยสอนทีละขั้นตอนพร้อมภาพหน้าจอ มาดำน้ำกันเถอะ

ที่เกี่ยวข้อง: Geek เริ่มต้น: วิธีสร้างและใช้เครื่องเสมือน

หมายเหตุ: ในการทำงานนี้คุณจะต้องเข้าถึง Mac จริงเพื่อดาวน์โหลด High Sierra คุณสามารถทำได้เราคิดว่าขอรับ ISO High Sierra ด้วยวิธีอื่น แต่เราไม่แนะนำ ยืม Mac ของเพื่อนเป็นเวลาหนึ่งชั่วโมงหากคุณไม่มีและคุณควรจะสบายดีทุกอย่างที่อยู่นอกเหนือขั้นตอนหนึ่งของบทช่วยสอนนี้สามารถทำได้บนพีซี Windows ของคุณ

หากคุณใช้ Mac และต้องการเครื่องเสมือน macOS สำหรับใช้งานบน Mac นั้นเราขอแนะนำให้ลองใช้ Parallels Desktop Lite แทนเนื่องจากสามารถสร้างเครื่องเสมือน macOS ได้ฟรีและทำงานได้ง่ายกว่า

พร้อมที่จะเริ่มแล้วหรือยัง? กระโดดเข้ามา!

ขั้นตอนที่หนึ่ง: สร้างไฟล์ ISO ของ macOS High Sierra

ในการเริ่มต้นเราจะต้องสร้างไฟล์ ISO ของโปรแกรมติดตั้งของ macOS High Sierra เพื่อให้เราสามารถโหลดใน VirtualBox บนเครื่อง Windows ของเรา หยิบ Mac ที่ยืมมาไปที่ Mac App Store ค้นหา Sierra แล้วคลิก“ ดาวน์โหลด”

เมื่อกระบวนการเสร็จสิ้นโปรแกรมติดตั้งจะเปิดขึ้นไม่เป็นไรเพียงปิดด้วย Command + Q เราไม่ต้องการอัปเกรด Mac ของเพื่อนคุณ เราต้องการไฟล์ที่ดาวน์โหลดมา

ในการแปลงไฟล์เหล่านั้นเป็น ISO เราจะต้องใช้ Terminal ซึ่งคุณสามารถพบได้ใน Applications> Utilities

ขั้นแรกให้รันคำสั่งต่อไปนี้เพื่อสร้างอิมเมจดิสก์เปล่า:

hdiutil สร้าง -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS + J  

ถัดไปติดตั้งภาพเปล่าของคุณ:

hdiutil แนบ /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint / Volumes / install_build

ตอนนี้คุณจะกู้คืน BaseSystem.dmg จากตัวติดตั้งไปยังอิมเมจที่ติดตั้งใหม่:

asr restore -source / Applications / Install \ macOS \ High \ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target / Volumes / install_build -noprompt -noverify -erase

โปรดทราบว่าหลังจากทำสิ่งนี้ชื่อของจุดต่อเชื่อมปลายทางของเราได้เปลี่ยนเป็น“ OS X Base System / System” เกือบเสร็จแล้ว! ยกเลิกการต่อเชื่อมภาพ:

hdiutil ถอด / ไดรฟ์ข้อมูล / OS \ X \ Base \ System

และสุดท้ายแปลงภาพที่คุณสร้างเป็นไฟล์ ISO:

hdiutil แปลง /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso

ย้าย ISO ไปที่เดสก์ท็อป:

mv /tmp/HighSierra.iso.cdr ~ / เดสก์ท็อป / HighSierra.iso

และคุณมีไฟล์ High Sierra ISO ที่สามารถบู๊ตได้!

คัดลอกไปยังเครื่อง Windows ของคุณโดยใช้แฟลชไดรฟ์ขนาดใหญ่ฮาร์ดไดรฟ์ภายนอกหรือผ่านเครือข่ายภายในของคุณ

ขั้นตอนที่สอง: สร้างเครื่องเสมือนของคุณใน VirtualBox

จากนั้นไปที่เครื่อง Windows ของคุณและติดตั้ง VirtualBox หากคุณยังไม่ได้ดำเนินการตรวจสอบให้แน่ใจว่าคุณมีเวอร์ชันล่าสุด (อย่างจริงจังเวอร์ชันเก่าอาจใช้งานไม่ได้)

เปิดขึ้นมาแล้วคลิกปุ่ม "ใหม่" ตั้งชื่อเครื่องเสมือนของคุณว่า“ High Sierra” และเลือก“ Mac OS X” สำหรับระบบปฏิบัติการและ“ Mac OS X (64-bit)” สำหรับเวอร์ชัน (ณ ที่เขียนนี้จะไม่มี“ macOS High Sierra” แต่ ไม่เป็นไร.)

ผ่านขั้นตอนต่อไป สำหรับหน่วยความจำเราขอแนะนำให้คุณใช้อย่างน้อย 4096MB แม้ว่าคุณจะสามารถเลือกใช้งานได้มากกว่านี้หากคุณมี RAM เพียงพอสำหรับเครื่อง Windows ของคุณ

ต่อไปคุณจะถูกถามเกี่ยวกับฮาร์ดไดรฟ์ของคุณ เลือก“ สร้างฮาร์ดดิสก์เสมือนเดี๋ยวนี้” แล้วคลิกสร้าง

เลือก VDI สำหรับประเภทฮาร์ดดิสก์แล้วคลิกถัดไป ระบบจะถามว่าคุณต้องการไดรฟ์ขนาดไดนามิกหรือคงที่ เราขอแนะนำ Fixed Size เนื่องจากเร็วกว่าเล็กน้อยแม้ว่าจะใช้พื้นที่ฮาร์ดไดรฟ์เพิ่มขึ้นเล็กน้อยในเครื่อง Windows ของคุณ

คลิกถัดไป คุณจะถูกถามว่าคุณต้องการไดรฟ์ขนาดใหญ่แค่ไหน เราขอแนะนำอย่างน้อย 25GB ซึ่งใหญ่พอสำหรับระบบปฏิบัติการและแอปพลิเคชันบางตัว ขึ้นอยู่กับสถานการณ์การจัดเก็บข้อมูลของคุณคุณสามารถนำเสนอได้มากขึ้น แต่เราไม่คิดว่าคุณจะใช้งานได้น้อยกว่านั้นจริงๆ

คลิกผ่านข้อความแจ้งและคุณได้สร้างรายการสำหรับเครื่องเสมือนของคุณแล้ว! ตอนนี้ถึงเวลาทำการกำหนดค่าเล็กน้อย

ขั้นตอนที่สาม: กำหนดค่าเครื่องเสมือนของคุณใน VirtualBox

คุณควรเห็นเครื่องเสมือนของคุณในหน้าต่างหลักของ VirtualBox

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

From now on, you can open VirtualBox for any Mac-related testing you want to do. Again, you’ll see a lot of errors pop up during boot, but they’re fine; ignore them. Also, remember that audio won’t work, nor will things like FaceTime or iMessage, which require a real Mac. This isn’t going to be perfect, which is to be expected from an entirely unsupported setup. But it’s macOS, in a virtual machine, and that’s not bad! Be sure to check out our guide to VirtualBox’s advanced features to get the most out of your machine, too.

One more thing: a huge shout-out to Chad S. Samuels, without whom I could not have updated this guide for High Sierra. Thank you so much!