黑苹果安装使用 macos10.14 on vmware15 or virtualbox

01 基本信息

macos可以安装在windows版本的vmware或者virtualbox上面。网上有很多教程,完整的virtualbox安装的较少。vmware安装的比较完整。
测试了一些提供virtualbox磁盘文件的帖子,可用。原始文件较小,大约5个G的压缩包。解压后安装后,是原始的macos10.12.6系统。可自己升级到10.13或者10.14。
也有vmware比较完整的安装方法说明。
关于vmware安装macos的。https://blog.csdn.net/galaxy_yyg/article/details/82891044 说明较完整,(除了安装盘如何制作成ldr没说明外)。
把dmg制作成iso,可以参考:
https://www.jianshu.com/p/7e5261d55d45
https://jingyan.baidu.com/article/a681b0de7ba53b3b18434699.html
http://www.pc6.com/edu/80611.html

virtualbox流程,参考:https://www.cnblogs.com/liming2017/p/7566953.html

:: 安装最新virtualbox
https://download.virtualbox.org/virtualbox/5.2.18/VirtualBox-5.2.18-124319-Win.exe
https://download.virtualbox.org/virtualbox/5.2.18/Oracle_VM_VirtualBox_Extension_Pack-5.2.18.vbox-extpack

:: 按照https://www.cnblogs.com/liming2017/p/7566953.html说明,安装macos10.12
d:
cd D:\install\oracle\VirtualBox
VBoxManage.exe modifyvm MacOS10.12 --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata MacOS10.12 "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata MacOS10.12 "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata MacOS10.12 "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata MacOS10.12 "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata MacOS10.12 "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

02 安装xcode

以上安装后的是纯洁的系统。如果尝试编译开源软件。需要自己安装xcode。
比如,编译mac下面的obs-studio。
建议先安装xcode,再下载Qt。

https://github.com/obsproject/obs-studio.git

根据编译说明:https://github.com/obsproject/obs-studio/wiki/Install-Instructions

git clone --recursive https://github.com/obsproject/obs-studio.git
cd obs-studio

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
sudo xcode-select --switch /Applications/Xcode.app/

这个动作会直接安装Command Line Tools,下载时间比较长。


brew install git
brew install wget

brew list               // 列出已安装的软件

brew update        // 更新
brew
brew home   // 用浏览器打开brew的官方网站
brew info             // 显示软件信息

brew deps            // 显示包依赖

# 安装cmake-gui需要手动下载安装包
# https://cmake.org/download/
# https://cmake.org/files/v3.12/cmake-3.12.3-Darwin-x86_64.dmg

brew install cmake
brew install make
brew install FFmpeg
brew install x264

qt.io 注册账号,下载mac版本qt。
qt的下载较繁琐,也比较耗时,仅选择自己需要的版本即可。

下载完成后,使用cmake-gui配置xcode工程。主要是配置qt的路径。
把obs-studio 代码切换到 22.0.3稳定tag,然后用xcode9.2编译。可以顺利编译通过。如果要运行,还需要把qt的依赖库链接到当前目录。
根据官网说明下载obs-studio
./obs
dyld: Library not loaded: @rpath/QtWidgets.framework/Version/5/QtWidgets Referenced from: /Users/soft/git/obs-studio/build/mac/installbin./obs
Reason: image not found

ln -s /Users/soft/Qt/5.11.2/clang_64/lib/QtCore.framework ./QtCore.framework
ln -s /Users/soft/Qt/5.11.2/clang_64/lib/QtGui.framework ./QtGui.framework
ln -s /Users/soft/Qt/5.11.2/clang_64/lib/QtMacExtras.framework ./QtMacExtras.framework
ln -s /Users/soft/Qt/5.11.2/clang_64/lib/QtWidgets.framework ./QtWidgets.framework

# git clone --recursive https://gitlab.cdnunion.com/XMF/xmfmac.git xmfmac1

macos10.12.6 只能不能安装xcode9.4,可以安装xcode9.2

参考:
VMWare15 安装 Mac OS 系统
https://blog.csdn.net/galaxy_yyg/article/details/82891044

教程 如何制作一个 macOS 10.14 的USB启动盘.
https://www.macx.cn/forum.php?mod=viewthread&tid=2214334

03 cmake-gui找不到xcode的c、c++编译器

用cmake生成xcode项目时候,提示找不到 c和c++编译器,需要执行下面指令即可
且当控制台无法使用gcc指令,也同样执行下面命令

sudo xcode-select --switch /Applications/Xcode.app/

04 卡在DSMOS has arrived的解决办法

未测试,遇到这个问题再次重启虚拟机即可。
https://blog.csdn.net/skykingf/article/details/40322781

/sbin/fsck -fy
/sbin/mount -uw /
chmod -R 755 mach_kernel
chown -R root:wheel mach_kernel
chmod -R 755 /System/Library/Extensions/
chown -R root:wheel /System/Library/Extensions/
rm -rf /System/Library/Caches/*
reboot

05 macos10.14启动usb盘制作

下载好完整安装文件后,用如下命令写入usb盘.
一个8GBusb2.0的u盘,插入后,会在桌面显示为Untitled.
(/Volumes/Untitled是usb的设备名称)
使用金士顿64GB的usb3.0U盘可以。

sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled/ /Applications/Install\ macOS\ Mojave.app
# 输入密码
# Ready to start.
# To continue we need to erase the volume at /Volumes/Untitled/.
# If you wish to continue type (Y) then press return: Y
Erasing disk: 0%... 10%... 20%... 30%... 100%
Copying to disk: 0%... 10%... 20%... 30%... 100%

在这里插入图片描述

使用上面制作好的macos10.14启动u盘,在VMWare15中安装。一切顺利。
参考 https://blog.csdn.net/galaxy_yyg/article/details/82891044
在这里插入图片描述

06 制作macOS 10.12 ISO安装文件

出处:https://zhuanlan.zhihu.com/p/25579396

hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil convert /tmp/Sierra.cdr.dmg -format UDTO -o /tmp/Sierra.iso
mv /tmp/Sierra.iso.cdr ~/Desktop/Sierra.iso

验证修改处

install_app和install_build可以自己任意名,
BaseSystem.dmg和BaseSystem.chunklist是在/Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/目录下
这样制作的iso文件,在VMWare下可以直接启动到安装界面
在virtualbox下面,需要用virtualbox的命令行设置好配置项后,才能正常启动。参加 01 中的 https://www.cnblogs.com/liming2017/p/7566953.html

hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil convert /tmp/Sierra.cdr.dmg -format UDTO -o /tmp/Sierra.iso
mv /tmp/Sierra.iso.cdr ~/Desktop/Sierra.iso

07 Mac上将dmg文件转成iso的方法

未测试,还不知道怎么下载macos的dmg文件。
网上很多dmg文件是无法自启动的。如:
https://blog.csdn.net/testcs_dn/article/details/51356399

hdiutil convert ~/Downloads/OSX109.dmg -format UDTO -o ~/Downloads/OSX109.iso

08 参考

https://www.jianshu.com/p/69cb2c3b86ef/

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值