Virtual Box虚拟机安装苹果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.isodmg2img v1.6.2 is derived from dmg2iso by vu1tur (to@vu1tur.eu.org)InstallOS.dmg --> InstallOS.isoreading 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%  okArchive 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 bfebfbffVBoxManage 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

5、启动虚拟机并安装macOS

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

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

调试

启动后无法从光盘启动。

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

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

这个盘是可以启动的 

启动后报错:

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

确实管用,又重复原来无法从光盘启动的问题了。光盘启动问题解决见上面。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/70919.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

dify基础之prompts

摘要:在大型语言模型(LLM)应用中,Prompt(提示词)是连接用户意图与模型输出的核心工具。本文从概念、组成、设计原则到实践案例,系统讲解如何通过Prompt解锁LLM的潜能,提升生成内容的…

【学写LibreCAD】0 仿写LibreCAD简介

一、LibreCAD 核心模块: 核心模块(Core) 功能:处理 CAD 的核心逻辑,如几何计算、图形对象管理、坐标系转换等。关键组件: 图形对象:如直线、圆、圆弧、多段线等。数学工具:向量、矩…

HTML元素,标签到底指的哪块部分?单双标签何时使用?

1. 标签&#xff08;Tag&#xff09; vs 元素&#xff08;Element&#xff09; 标签&#xff08;Tag&#xff09; 标签是 HTML 中用于定义元素的符号&#xff0c;用尖括号 < > 包裹。例如 <img> 是标签。元素&#xff08;Element&#xff09; 元素是由 标签 内容…

Android APK组成编译打包流程详解

Android APK&#xff08;Android Package&#xff09;是 Android 应用的安装包文件&#xff0c;其组成和打包流程涉及多个步骤和文件结构。以下是详细的说明&#xff1a; 一、APK 的组成 APK 是一个 ZIP 格式的压缩包&#xff0c;包含应用运行所需的所有文件。解压后主要包含以…

Token相关设计

文章目录 1. 双Token 机制概述1.1 访问令牌&#xff08;Access Token&#xff09;1.2 刷新令牌&#xff08;Refresh Token&#xff09; 2. 双Token 认证流程3. Spring Boot 具体实现3.1 生成 Token&#xff08;使用 JWT&#xff09;3.2 解析 Token3.3 登录接口&#xff08;返回…

HTTP 请求时传递多部分表单数据

HTTP 请求时传递多部分表单数据&#xff08;multipart/form-data&#xff09; --data-raw $------demo11111\r\nContent-Disposition: form-data; name"Filedata"; filename"截屏2025-02-27 15.45.46.png"\r\nContent-Type: image/png\r\n\r\n\r\n------d…

Java基础关键_013_日期处理

目 录 一、传统 API 1.System.currentTimeMillis() &#xff08;1&#xff09;说明 &#xff08;2&#xff09;实例 2.构造方法 &#xff08;1&#xff09;说明 &#xff08;2&#xff09;无参构造 &#xff08;3&#xff09;有参构造 3.日期格式化 &#xff08;1&am…

51单片机中reg52.h与regx52.h在进行位操作时的不同

reg52.h中不能使用例如 P2_0;这样的定义 而只能使用 P2^0;这样的定义 但是都不可以对位进行直接赋值操作&#xff1b; 而 regx52.h中可以使用 P2_0和P2^0&#xff1b;但是只有使用下划线的才可以对位进行赋值操作 例如P2_0 1; 但不可以是P2^0 1; 在 C 语言中&#xff0c;…

基于Rook的Ceph云原生存储部署与实践指南(上)

#作者&#xff1a;任少近 文章目录 1 Ceph环境准备2 rook部署ceph群集2.1 Rook 帮助地址2.2 安装ceph2.3 获取csi镜像2.4 Master参加到osd2.5 设置默认存储 3 Rook部署云原生RBD块存储3.1 部署storageclass资源3.2 部署WordPress使用RBD3.3 WordPress访问 4 Rook部署云原生RGW…

FastExcel与Reactor响应式编程深度集成技术解析

一、技术融合背景与核心价值 在2025年企业级应用开发中&#xff0c;大规模异步Excel处理与响应式系统架构的结合已成为技术刚需。FastExcel与Reactor的整合方案&#xff0c;通过以下技术协同实现突破性性能&#xff1a; 内存效率革命&#xff1a;FastExcel的流式字节操作与Re…

DeepSeek R1/V3满血版——在线体验与API调用

前言&#xff1a;在人工智能的大模型发展进程中&#xff0c;每一次新模型的亮相都宛如一颗投入湖面的石子&#xff0c;激起层层波澜。如今&#xff0c;DeepSeek R1/V3 满血版强势登场&#xff0c;为大模型应用领域带来了全新的活力与变革。 本文不但介绍在线体验 DeepSeek R1/…

Spring Data JPA 中的分页实现:从 BasePage 到 Pageable

文章目录 Spring Data JPA 中的分页实现&#xff1a;从 BasePage 到 Pageable背景&#xff1a;为什么需要分页&#xff1f;认识 BasePage 类深入 toPageable() 方法1. 处理页码和页面大小2. 处理排序方向3. 处理排序字段4. 生成 Pageable 对象 实战&#xff1a;如何使用 BasePa…

Android Studio 新版本Gradle发布本地Maven仓库示例

发布代码到JitPack示例&#xff1a;https://blog.csdn.net/loutengyuan/article/details/145938967 以下是基于 Android Studio 24.2.2&#xff08;Gradle 8.10.2 AGP 8.8.0 JDK17&#xff09; 的本地 Maven 仓库发布示例&#xff0c;包含aar和jar的不同配置&#xff1a; 1.…

python量化交易——金融数据管理最佳实践——qteasy创建本地数据源

文章目录 qteasy金融历史数据管理总体介绍本地数据源——DataSource对象默认数据源查看数据表查看数据源的整体信息最重要的数据表其他的数据表 从数据表中获取数据向数据表中添加数据删除数据表 —— 请尽量小心&#xff0c;删除后无法恢复&#xff01;&#xff01;总结 qteas…

Android中使用Robolectric测试点击事件(不需要手机)

文章目录 一、前言二、简单示例三、参考文档 一、前言 Robolectric 是一个由 Google 维护的开源 Android 测试框架&#xff0c;它允许你以 Android 运行时环境运行单元测试。 Robolectric 提供了一个模拟 Android 运行时环境&#xff0c;允许你测试你的代码是否正确地使用 And…

Spring Boot 接口 JSON 序列化优化:忽略 Null 值的九种解决方案详解

一、针对特定接口null的处理&#xff1a; 方法一&#xff1a;使用 JsonInclude 注解 1.1 类级别&#xff1a;在接口返回的 ‌DTO 类或字段‌ 上添加 JsonInclude 注解&#xff0c;强制忽略 null 值&#xff1a; 类级别&#xff1a;所有字段为 null 时不返回 JsonInclude(Js…

ds回答-开源llm应用开发平台

以下是几个著名的开源 LLM 应用开发平台&#xff0c;涵盖不同场景和技术特点&#xff1a; 1. Dify 特点&#xff1a;低代码 / 无代码开发、支持 RAG 检索、Agent 智能体、模型管理、LLMOps 全流程优化。核心功能&#xff1a;可视化工作流编排、数百种模型兼容&#xff08;如 GP…

LDR6020 PD3.1 协议芯片在特定设备中的应用

在电子设备互联互通的时代&#xff0c;芯片技术成为提升设备性能与功能的关键驱动力。LDR6020 PD3.1 协议芯片以其出色的性能&#xff0c;在 TYPE-C 台式显示器 / 便携显示器、一拖二快充线以及手机电脑转接器等设备中展现出独特价值&#xff0c;为用户带来更便捷、高效的使用体…

wzl-django学习

####################################################总的urls.py from django.contrib import admin from django.urls import path,include, re_path from django.views.static import serve from django.conf import settings from drf_yasg import openapi from drf_yas…

python -ssh学习

def exe_sshcmd(ip,username,userpswd,port,cmd): """ 功能&#xff1a;SSH登录到指定设备&#xff0c;并执行对应的命令 入参&#xff1a;前四项为ssh登录shell的ip和port&#xff0c;具备管理员权限的用户名和密码&#xff0c; cmd可以…