Virtual Box虚拟机安装Mac苹果Monterey和big sur版本实践

虚拟机安装苹果实践,在Windows10系统,安装Virtual Box7.1.6,安装虚拟苹果Monterey版本Monterey (macOS 12) 。碰到的主要问题是安装光盘不像Windows那么容易拿到,而且根据网上很多文章制作的光盘,在viritualBox里都无法引导启动,最后只有一个big sur版本的iso可以启动,见后面调试部分。

下载安装软件

 经过多次尝试,只有这个链接里面拿到的Mac OS 盘是可以在virtualBox里引导启动的。

这篇文档里有个big sur版本mac的下载地址:VirtualBox 7.0 安装 macOS big sur + Windows 11系统-零度博客

以下制作的iso光盘都无法在VirtualBox里引导启动,留档。 

尝试下载10.12版本(无法启动)

先下载一个较老的版本10.12,下载页面:如何下载和安装 macOS - 官方 Apple 支持 (中国)

具体下载链接:http://updates-http.cdn-apple.com/2019/cert/061-39476-20191023-48f365f4-0015-4c41-9f44-39d3d2aca067/InstallOS.dmg

转换格式,到华军软件园下载转换软件:dmg转iso(dmg2img)下载2025最新pc版_dmg转iso(dmg2img)电脑版官方免费下载_华军软件园 

使用命令dmg2img.exe InstallOS.dmg InstallOS.iso 转换:

e:\360Downloads>e:\tools\dmg2img\dmg2img.exe InstallOS.dmg InstallOS.iso

dmg2img v1.6.2 is derived from dmg2iso by vu1tur (to@vu1tur.eu.org)

InstallOS.dmg --> InstallOS.iso

reading property list, 306327 bytes from address 5007575287 ...

decompressing:
opening partition 0 ...             100.00%  ok
opening partition 1 ...             100.00%  ok
opening partition 2 ...             100.00%  ok
opening partition 3 ...             100.00%  ok
opening partition 4 ...             100.00%  ok
opening partition 5 ...             100.00%  ok
opening partition 6 ...             100.00%  ok
opening partition 7 ...             100.00%  ok
opening partition 8 ...             100.00%  ok

Archive successfully decompressed as InstallOS.iso

经测试,这样转换的iso文件不行。

下载Big Sur和Monterey并转换dmg到iso文件(无法启动)

 如何在Windows 10的VirtualBox中安装macOS High Sierra:如何在Windows 10的VirtualBox中安装macOS High Sierra-腾讯云开发者社区-腾讯云

查看下载的安装文件,在/Applications

Install macOS Big Sur.app

Install macOS Monterey.app

具体来说,Monterry的盘在这里:/Applications/Install macOS Monterey.app/Contents/SharedSupport

ls -l
total 24235624
-rw-r--r--  1 root  wheel  12408638012  2 27 20:19 SharedSupport.dmg

 创建空白磁盘

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

hdiutil create -o /tmp/Monterey.cdr -size 12412m -layout SPUD -fs HFS+J

挂载空白磁盘

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

挂载成功

hdiutil attach /tmp/Monterey.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
/dev/disk3          	Apple_partition_scheme         	
/dev/disk3s1        	Apple_partition_map            	
/dev/disk3s2        	Apple_HFS                      	/Volumes/install_build

 从安装程序中还原安装镜像到挂载的空白磁盘

asr restore --source "/Applications/Install macOS Monterey.app/Contents/SharedSupport/SharedSupport.dmg" --target /Volumes/Install_build --noprompt --noverify -erase

注意,原文档里参数只有一个“-”,会报错,要修改成两个"--"

输出信息说:

Restored target device is /dev/disk3s2.

也就是/dev/disk3s2 这个盘,挂载点为/Volumes/install_build ,已经做成MacOS启动盘了

因为前面知道创建的空白磁盘是/dev/disk3,所以直接卸载它就行了。可以到“访达”里用鼠标点击卸载,也可以用命令

hdiutil detach /dev/disk3

将dmg变成iso

hdiutil convert /tmp/Monterey.cdr.dmg -format UDTO -o /tmp/Monterey.iso

完成:created: /tmp/Monterey.iso.cdr 

但是用这个文件在virtualbox里还是无法启动。

尝试学习用hdiutil转换dmg到iso(无法启动) 

hdiutil makehybrid  -iso -o Monterey.iso /tmp/Monterey.cdr.dmg 

执行这些命令:

首先,运行以下命令以创建空白磁盘映像:

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

接下来,挂载空白镜像:

hdiutil attach /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 detach /Volumes/OS/X/Base/System

最后,将您创建的映像转换为ISO文件:

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

将ISO移至桌面:

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

您已经拥有可引导的High Sierra ISO文件!

此方法未测试成功。

创建virtualbox mac虚拟机

知乎一篇文章讲到这样:

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

VBoxManage setextradata MacOS "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"

VBoxManage setextradata MacOS "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"

VBoxManage setextradata MacOS "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"

VBoxManage setextradata MacOS "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"

VBoxManage setextradata MacOS "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

# 修改屏幕分辨率为 1440 * 900
VBoxManage setextradata MacOS VBoxInternal2/EfiGopMode 4

# VirtualBox5.2版本修改分辨率命令
VBoxManage setextradata MacOS VBoxInternal2/EfiGraphicsResolution 1440x900

其实应该不用吧,现在直接有macos的虚拟机选项了。

苹果版本号对应表:

  1. Sonoma (macOS 14)

    • 发布年份:2023
    • 主要特性:增强的桌面小部件、改进的游戏体验、Safari 的新功能等。
  2. Ventura (macOS 13)

    • 发布年份:2022
    • 主要特性:引入了 Stage Manager、改进的邮件和信息应用、增强的隐私保护等。
  3. Monterey (macOS 12)

    • 发布年份:2021
    • 主要特性:引入了 Focus 模式、快捷指令、Universal Control 等。
  4. Big Sur (macOS 11)

    • 发布年份:2020
    • 主要特性:全新的用户界面设计、控制中心、改进的 Safari 浏览器等。
  5. Catalina (macOS 10.15)

    • 发布年份:2019
    • 主要特性:引入了 Sidecar、屏幕时间、完全移除 iTunes 等。
  6. Mojave (macOS 10.14)

    • 发布年份:2018
    • 主要特性:引入了黑暗模式、桌面堆栈、改进的屏幕截图工具等。
  7. High Sierra (macOS 10.13)

    • 发布年份:2017
    • 主要特性:引入了 APFS 文件系统、改进的照片应用、Metal 2 图形技术等。
  8. Sierra (macOS 10.12)

    • 发布年份:2016
    • 主要特性:引入了 Siri、优化的文件管理、Apple Pay 支持等。
  9. El Capitan (macOS 10.11)

    • 发布年份:2015
    • 主要特性:改进的窗口管理、Split View、增强的 Spotlight 搜索等。
  10. Yosemite (macOS 10.10)

    • 发布年份:2014
    • 主要特性:全新的用户界面设计、Handoff 功能、改进的通知中心等。

其它学习

下载mac软件

参考:Making the installer in macOS | OpenCore Install Guide

Using App Store
From a macOS machine that meets the requirements of the OS version you want to install, go directly to the App Store and download the desired OS release and continue to Setting up the installer.
#
Command Line Software Update Utility
Open a terminal window then copy and paste the below command:
sh
softwareupdate --list-full-installers; echo; echo "Please enter version number you wish to download:"; read REPLY; [ -n "$REPLY" ] && softwareupdate --fetch-full-installer --full-installer-version "$REPLY"

This gives you a list of available releases you can choose from. Once downloaded it will be saved in your Applications folder. You can continue to Setting up the installer.
#
Munki's InstallInstallMacOS utility
Note for users running macOS Monterey 12.3 or above
In order to run it, just copy and paste the below command in a terminal window:
sh
mkdir -p ~/macOS-installer && cd ~/macOS-installer && curl https://raw.githubusercontent.com/munki/macadmin-scripts/main/installinstallmacos.py > installinstallmacos.py && sudo
 python installinstallmacos.py

As you can see, we get a nice list of macOS installers. If you need a particular versions of macOS, you can select it by typing the number next to it. For this example we'll choose 10:

This is going to take a while as we're downloading the entire 8GB+ macOS installer, so it's highly recommended to read the rest of the guide while you wait.
Once finished, you'll find in your ~/macOS-Installer/ folder a DMG containing the macOS Installer, called Install_macOS_11.1-20C69.dmg for example. Mount it and you'll find the installer application.
• Note: We recommend to move the Install macOS.app into the /Applications folder, as we'll be executing commands from there.
• Note 2: Running Cmd+Shift+G in Finder will allow you to easily jump to ~/macOS-installer


From here, jump to Setting up the installer to finish your work. If you want to check the integrity of your download, you can check this repository of checks

softwareupdate --list-full-installers; echo; echo "Please enter version number you wish to download:"; read REPLY; [ -n "$REPLY" ] && softwareupdate --fetch-full-installer --full-installer-version "$REPLY"

参考如何在windows下安装mac虚拟机安装 | PingCode智库

使用VirtualBox安装macOS

1、安装Oracle VM VirtualBox

下载并安装VirtualBox。完成后,安装VirtualBox扩展包以获得更好的性能和更多的功能。

2、创建新的虚拟机

打开VirtualBox,点击“新建”。

  • 输入虚拟机名称,类型选择“Mac OS X”,版本选择对应的macOS版本,点击“下一步”。
  • 分配内存大小,建议至少分配8GB,点击“下一步”。
  • 创建虚拟硬盘,选择“VDI(VirtualBox磁盘映像)”,点击“下一步”。
  • 硬盘类型选择“动态分配”,点击“下一步”。
  • 指定虚拟硬盘文件的位置和大小,点击“创建”。

3、加载macOS镜像文件

  • 右键点击创建好的虚拟机,选择“设置”。
  • 在“系统”选项中,确保启用“EFI(特殊操作系统的唯一固件接口)”。
  • 在“存储”选项中,选择“空”,然后点击光盘图标,选择“选择虚拟光盘文件”,选择macOS镜像文件。

4、运行命令行配置(这个非必须)

关闭VirtualBox,打开命令提示符(以管理员身份运行),运行以下命令来配置虚拟机:

cd "C:Program FilesOracleVirtualBox"

VBoxManage modifyvm "你的虚拟机名称" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff

VBoxManage setextradata "你的虚拟机名称" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"

VBoxManage setextradata "你的虚拟机名称" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"

VBoxManage setextradata "你的虚拟机名称" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"

VBoxManage setextradata "你的虚拟机名称" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"

VBoxManage setextradata "你的虚拟机名称" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

根据自己的虚拟机的名字,叫MacOS,自己的存盘目录为:"E:\Program Files\Oracle\VirtualBox\" ,执行响应的指令:

cd "E:\Program Files\Oracle\VirtualBox\"
VBoxManage.exe modifyvm "MacOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 0 
5、启动虚拟机并安装macOS

  • 打开VirtualBox,启动虚拟机。
  • 虚拟机会启动macOS安装程序,按照提示进行安装。

实践下来,启动非常慢,大约要20-30分钟才能进入mac安装界面

调试

启动后无法从光盘启动。

解决中。经过多次尝试,只有这个链接里面拿到的Big Sur版本的Mac OS 盘是可以在virtualBox里引导启动的。

这篇文档里有个big sur版本mac的下载地址:VirtualBox 7.0 安装 macOS big sur + Windows 11系统-零度博客

这个盘是可以启动的。

启动后报错:Failed to query SMC value from the host

Failed to query SMC value from the host (VERR_INVALID_HANDLE).

返回 代码:

E_FAIL (0x80004005)

组件:

ConsoleWrap

界面:

IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}

尝试禁用禁用SMC查询

 VBoxManage.exe setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 0

上面两条命令运行后,确实管用,又重复原来无法从光盘启动的问题了。光盘启动问题解决见上面。

启动后无法看到硬盘

启动后没有硬盘可以选,导致安装卡住。解决方法是在第一个选择界面,选择第四部分磁盘工具,对磁盘进行“抹掉”操作。

一直重启,无法进入安装界面

Big Sur版本的Mac OS,虚拟机cpu数设为2,不要设多,多了之后一直重启。

### 回答1: 要将macOS Monterey降级为Big Sur,您需要按照以下步骤操作: 1.备份您的数据:在降级之前,务必备份您的数据,以防数据丢失。 2.下载Big Sur安装程序:您需要从Apple官网下载Big Sur安装程序。 3.创建启动盘:将Big Sur安装程序制作成启动盘,以便在降级时使用。 4.进入恢复模式:在启动时按住Command + R键,进入恢复模式。 5.格式化硬盘:在恢复模式下,使用磁盘工具格式化硬盘。 6.安装Big Sur:使用制作好的启动盘安装Big Sur。 7.恢复数据:在安装完成后,您可以使用备份的数据进行恢复。 请注意,降级操作可能会导致数据丢失,因此请务必备份您的数据。此外,降级后可能会出现一些兼容性问题,因此请在降级之前仔细考虑。 ### 回答2: MacOS Monterey苹果公司最新的操作系统版本,其功能用户体验都得到了很多用户的赞誉。但是,与此同时,有些用户可能会遇到一些兼容性问题或不适应新的界面设计等问题,想要将系统降级回Big Sur。下面我们就来谈谈如何降级macOS MontereyBig Sur。 首先,降级需要备份数据。最好是使用Time Machine功能,在降级之前备份整个系统。备份完成后,我们需要下载Big Sur系统镜像,可以从苹果官方网站或其他可靠的下载来源下载安装镜像。 接下来,我们需要创建一个启动U盘。在创建过程中,请务必使用大容量的U盘并保证其可靠性,防止在降级过程中出现意外问题。 完成启动U盘后,现在需要在Mac上进行操作,将电脑关机,并将启动U盘插入电脑上。然后启动电脑,并按住“Option”键,直到看到启动磁盘选项,选择启动U盘。 然后,按照提示进入安装Big Sur系统的流程,并在这个过程中格式化你的硬盘,将你的硬盘恢复为Big Sur的状态。在这个过程中,请务必注意保留你的备份数据,确保你的数据完整无缺地恢复过来。 最后,我们需要恢复数据,以完成降级操作。通过使用Time Machine或其他备份程序进行数据恢复,可以帮助您将所有数据文档从备份中恢复到降级后的Big Sur系统中。 总的来说,从Monterey降级到Big Sur需要耗费一些时间精力,但如果你遇到了一些无法克服的问题或在使用Monterey时遇到了一些不适,那么降级到Big Sur可能是对你个人或工作来说最好的选择。 ### 回答3: 如果你已经更新到了最新的 macOS Monterey 系统,但是遇到了稳定性或兼容性问题,不妨考虑将系统降级到之前的版本,比如 Big Sur。下面将介绍如何在不丢失数据的情况下安全地降级 macOS MontereyBig Sur。 首先,你需要有一份 Big Sur 系统的安装镜像,可以在苹果官网下载或通过其他途径获得。建议备份好你的数据,以防意外损失。 1. 创建启动盘 使用 USB 或者外部硬盘创建 Big Sur 启动盘。如果你已经在以前的升级中创建了启动盘,可以跳过这一步骤。 步骤一:插入空的 USB 或者外部硬盘 步骤二:打开“磁盘工具”程序,选择该设备并将其格式化为“Mac OS 扩展(日志式)” 步骤三:启动“终端”程序,输入以下命令安装 Big Sur 系统: sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume “/Volumes/MyVolume”应替换为你之前格式化的设备名称。 2. 进入恢复模式 将启动盘插入 Mac 设备中,按下电源键并立即按住 Command R 键进入恢复模式。你会看到 Apple 商标,然后松开键盘。 3. 连接网络 在恢复模式中,确保你可以访问互联网,选择 Wi-Fi 网络或连接有线网络。连接网络可以确保你获得最新的 Big Sur 安装文件。 4. 执行降级操作 在“恢复模式”下,你可以在“实用工具”菜单中找到“终端”程序,在其中输入以下命令,确保要降级的设备上已经安装Big Sur(前提是该设备之前已经升级到了 Monterey): sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/startosinstall --eraseinstall --newerfrompath /Applications/Install\ macOS\ Big\ Sur.app 此命令将从 Big Sur 安装文件中重新安装系统并抹掉所有数据以便安装。 总结 降级 macOS MontereyBig Sur 并不难,但是需要注意备份数据创建启动盘两个步骤。如果你不确定自己的操作,请咨询更有经验的人士或者寻求 Apple 官方支持。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值