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.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

根据自己的虚拟机的名字,叫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,不要设多,多了之后一直重启。

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

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

相关文章

长时间目标跟踪算法(3)-GlobalTrack:A Simple and Strong Baseline for Long-termTracking

GlobalTrack的原始论文和源码均已开源,下载地址。 目录 背景与概述 1.1 长期视觉跟踪的挑战 1.2 现有方法的局限性 1.3 GlobalTrack的核心思想 算法原理与架构 2.1 全局实例搜索框架 2.2 Query-Guided RPN(QG-RPN) 2.3 Query-Guided RCNN&a…

使用mermaid查看cursor程序生成的流程图

一、得到cursor生成的流程图文本 cursor写的程序正常运行后,在对话框输入框中输入诸如“请生成扫雷的代码流程图”,然后cursor就把流程图给生成了,但是看到的还是文本的样子,保留这部分内容待用 二、注册一个Mermaid绘图账号 …

MacOS本地部署Deepseek,不联网也可以使用AI,保护隐私

苹果笔记本本地部署deepseek主要用到Ollama与open-webui 1. 安装Ollama “Ollama” 是一个轻量级的 AI 模型运行时环境(runtime),旨在简化在本地部署和使用大语言模型(LLM)的过程。它由 Vicarious 公司开发&#xff…

unity学习62,尝试做第一个小游戏项目:flappy bird

目录 学习参考 1 创建1个unity 2D项目 1.1 2D项目模板选择 1.1.1 2D(built-in-Render pipeline) 1.1.2 universe 2D 1.1.3 这次选择 2D(built-in-Render pipeline) 1.2 创建项目 1.2.1 注意点 1.2.2 如果想修改项目名 2 导入美术资源包 2.1 下载一个flappy bird的…

基于Matlab的多目标粒子群优化

在复杂系统的设计、决策与优化问题中,常常需要同时兼顾多个相互冲突的目标,多目标粒子群优化(MOPSO)算法应运而生,作为群体智能优化算法家族中的重要成员,它为解决此类棘手难题提供了高效且富有创新性的解决…

使用DiskGenius工具来实现物理机多硬盘虚拟化迁移

使用DiskGenius工具来实现物理机多硬盘虚拟化迁移 概述准备工作注意事项实操过程记录1、Win7虚拟机,安装有两个硬盘(硬盘0和硬盘1),各分了一个区,磁盘2是一块未使用的磁盘2、运行DiskGenius程序,记录现有各…

win本地vscode通过代理远程链接linux服务器

时间:2025.2.28 1. win本地下载nmap.exe nmap官网 https://nmap.org/或者 https://nmap.org/download#windows下载win版本并安装。 2. vscode插件Remote-SSH 插件下载Remote-SSH 3. 配置 按照图中顺序配置ssh 1.点击左侧工具栏的“小电视”图标 2.点击ssh的…

yolo初体验

看别人说的好简单,3行代码完成yolo11: from ultralytics import YOLO model YOLO("yolo11x.pt")##第一次运行自动下载 model.predict(source"0",showTrue) 当然代码没错:但是环境不好配: 首先:pip install ultralytics 会主动下载依赖 pytorch pandas-…

TCP 连接故障排查与 SYN 洪泛攻击防御

1 SYN 洪泛攻击防御 1.1 SYN Flood是什么? SYN Flood是互联网上最原始、最经典的DDoS(Distributed Denial of Service,分布式拒绝服务)攻击之一,旨在耗尽可用服务器资源,致使服务器无法传输合法流量。 SYN…

ArcGIS Pro应用指南:如何为栅格图精确添加坐标信息

一、引言 在地理信息系统中,栅格图是一种重要的数据类型。 然而,有时我们从网络上获取的栅格图并不包含坐标信息,这使得它们难以与其他带有坐标信息的数据进行集成和分析。 为了解决这一问题,我们需要对栅格图进行地理配准&…

Spring Boot 与 MyBatis 版本兼容性

初接触Spring Boot,本次使用Spring Boot版本为3.4.3,mybatis的起步依赖版本为3.0.0,在启动时报错,报错代码如下 org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name userMapper…

CSS—text文本、font字体、列表list、表格table、表单input、下拉菜单select

目录 1.文本 2.字体 3.列表list a.无序列表 b.有序列表 c.定义列表 4.表格table a.内容 b.合并单元格 3.表单input a.input标签 b.单选框 c.上传文件 4.下拉菜单 1.文本 属性描述color设置文本颜色。direction指定文本的方向 / 书写方向。letter-spacing设置字符…

Linux之环境变量(超详细版)

前言:各位老铁们好,好久没分享知识了,今天我要和各位老铁分享的是环境变量 ,对于Linux操作系统的学习者,我们会经常使用到环境变量,那么什么是环境变量呢?在讲环境变量之前,先问各位老铁一个问题…

【C语言】联合体 `union` 的妙用

C 语言联合体的妙用:结合 . 和 -> 操作符与 typedef 的深入剖析 在 C 语言中,联合体(union)是一种独特的复合数据类型,因其内存共享特性而在内存优化、类型切换和底层操作中展现出妙用。与结构体(struct)不同,联合体允许同一块内存存储不同类型的数据,提供高效且灵…

macOS - 使用 tmux

文章目录 安装 tmux使用更多快捷键说明 安装 tmux brew install tmux使用 在终端输入 tmux 进入 tmux 界面,然后 输入 Control Option B 进入交互模式 输入 % 左右分栏," 上下分割 上一个窗格:{,下一个:} PS…

构建私有化AI知识库:基于CentOS的Ollama + DeepSeek-R1 +ragflow 整合部署教程

操作系统:CentOS 7.9 CPU:支持 AVX 指令集的 x86_64 处理器 内存:64GB 存储:SSD 1TB 以上 GPU(可选) 一、组件介绍 Ollama Ollama 是一个专为在本地机器上部署和运行大型语言模型(LLM&a…

Goby 漏洞安全通告| Ollama /api/tags 未授权访问漏洞(CNVD-2025-04094)

漏洞名称:Ollama /api/tags 未授权访问漏洞(CNVD-2025-04094) English Name:Ollama /api/tags Unauthorized Access Vulnerability (CNVD-2025-04094) CVSS core: 6.5 风险等级: 中风险 漏洞描述: O…

Linux命令超级汇总

文件和目录操作 命令语法常用选项及说明lsls [选项] [目录名]- -l:以长格式显示文件和目录信息 - -a:显示所有文件,包括隐藏文件 - -h:与 -l 配合,以人类可读的方式显示文件大小 - -R:递归显示子目录内容cd…

Python 爬取唐诗宋词三百首

你可以使用 requests 和 BeautifulSoup 来爬取《唐诗三百首》和《宋词三百首》的数据。以下是一个基本的 Python 爬虫示例,它从 中华诗词网 或类似的网站获取数据并保存为 JSON 文件。 import requests from bs4 import BeautifulSoup import json import time# 爬取…

14. LangChain项目实战1——基于公司制度RAG回答机器人

教学视频: 12. 基于Gradio搭建基于公司制度RAG_哔哩哔哩_bilibilihttps://www.bilibili.com/video/BV11VXRYTErZ/ 环境配置: python版本:3.10.8 服务器:Ubuntu 依赖包requirements.txt文件内容: aiofiles23.2.1 …