這個開源腳本文件可快速幫你安裝 MacOS 虛擬機!

大家好,我是 JackTian。

安裝 Windows 和 Linux 操作系統是最熟悉不過的必備技能了。

那麼,給大家推薦一個非常實用的開源腳本:macos-guest-virtualbox.sh,幫你在 VirtualBox上快速安裝MacOS 操作系統

macos-guest-virtualbox.sh是一個Bash腳本,該開源腳本其主要作用:可幫你快速安裝macOS 操作系統並直接通過 macOS 操作系統使用 Apple 服務器下載的未修改 macOS 安裝文件。

在 macOS,適用於 Linux 的 Windows 子系統和 centOS 7 上運行。

在安裝時,只需根據腳本提示按 Enter 鍵不到十次操作即可,無需與虛擬機進行任何交互式操作。

當前支持 macOS Catalina(10.15),Mojave(10.14)和High Sierra(10.13)。

iCloud、iMessage 和其他已連接的 Apple 服務,需要有效的設備名稱、序列號等;

若使用這些服務以及其他正版 Apple參數,可通過編輯腳本在 NVRAM 中進行設置即可。

#!/bin/bash
# Push-button installer of macOS on VirtualBox
# (c) myspaghetti, licensed under GPL2.0 or higher
# url: https://github.com/myspaghetti/macos-virtualbox
# version 0.93.3
...... # 省略部分內容
function set_variables() {
# Customize the installation by setting these variables:
vm_name="macOS"                  # name of the VirtualBox virtual machine
macOS_release_name="Catalina"    # install "HighSierra" "Mojave" or "Catalina"
storage_size=80000               # VM disk image size in MB, minimum 22000
storage_format="vdi"             # VM disk image file format, "vdi" or "vmdk"
cpu_count=2                      # VM CPU cores, minimum 2
memory_size=4096                 # VM RAM in MB, minimum 2048
gpu_vram=128                     # VM video RAM in MB, minimum 34, maximum 128
resolution="1280x800"            # VM display resolution

# The following commented commands, when executed on a genuine Mac,
# may provide the values for NVRAM and other parameters required by iCloud,
# iMessage, and other connected Apple applications.
# Parameters taken from a genuine Mac may result in a "Call customer support"
# message if they do not match the genuine Mac exactly.
# Non-genuine yet genuine-like parameters usually work.

#   system_profiler SPHardwareDataType
DmiSystemFamily="MacBook Pro"        # Model Name
DmiSystemProduct="MacBookPro11,2"    # Model Identifier
DmiSystemSerial="NO_DEVICE_SN"       # Serial Number (system)
DmiSystemUuid="CAFECAFE-CAFE-CAFE-CAFE-DECAFFDECAFF" # Hardware UUID
DmiOEMVBoxVer="string:1"             # Apple ROM Info
DmiOEMVBoxRev="string:.23456"        # Apple ROM Info
DmiBIOSVersion="string:MBP7.89"      # Boot ROM Version
#   ioreg -l | grep -m 1 board-id
DmiBoardProduct="Mac-3CBD00234E554E41"
#   nvram 4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:MLB
DmiBoardSerial="NO_LOGIC_BOARD_SN"
MLB="${DmiBoardSerial}"
#   nvram 4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:ROM
ROM='%aa*%bbg%cc%dd'
#   ioreg -l -p IODeviceTree | grep \"system-id
SYSTEM_UUID="aabbccddeeff00112233445566778899"
#   csrutil status
SYSTEM_INTEGRITY_PROTECTION='10'  # '10' - enabled, '77' - disabled

默認情況下,該腳本分配了 80GB 的目標虛擬磁盤存儲大小。

在初始安裝時主機上的目標虛擬磁盤存儲大小約爲 20GB,安裝完成後,存儲空間可能會增加。

你還可以根據實際需求設置存儲 / 內存大小、CPU 數、分辨率等;

由於安裝的是 macOS 虛擬機,受限於硬件與 VirtulBox 本身的產品功能,一些功能無法支持,例如:USB設備支持音頻支持FileVault啓動密碼提示支持以及其他功能等;

當然了,如果平時喜歡使用 macOS 操作系統,但又買不起蘋果電腦,可以考慮該開源腳本來幫你快速安裝並體驗 macOS 系統,大大減少了不少精力,適用於Windows,Linux 和 macOS 等多個主流操作系統。

GitHub 地址:https://github.com/myspaghetti/macos-virtualbox

原創不易,碼字不易。 覺得這篇文章對你有點用的話,麻煩你爲本文點個贊,或轉發一下,因爲這將是我輸出更多優質文章的動力,感謝!

⬇⬇⬇⬇⬇⬇⬇⬇

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章