请教 Vmware 如何安装从 dmg 文件安装 OSX?

2014-07-03 10:13:11 +08:00
 goldenapp
之前一直都是dmg转成iso,从10.8安装,然后升级到10.9
不过这样好麻烦啊,而且更新时间太长了

貌似10.9dmg的目录结构和10.8变化很大啊
个人不太喜欢网上转好的iso,想自己动手
求V友指导,最好有个教程啥的
谢谢各位~
51278 次点击
所在节点    macOS
12 条回复
Niphor
2014-07-03 10:28:30 +08:00
没啥变化,解压dmg,替换 link 链接 为实体目录,打包dmg
vmware打补丁,载入dmg安装

不过 新版的Vmware好像和 华硕用的lucidlogix virtu mvp有冲突,3D加速会报错
记得在 mvp里面 添加vmware的黑名单。
Niphor
2014-07-03 10:29:39 +08:00
Vmware Fusion 里面似乎还有个脚本,帮你转的。。。
qq2511296
2014-07-03 10:39:07 +08:00
vm好像有个补丁吧?
要么直接选择所有文件 选择这个dmg 看看能不能装
我用cdr格式都可以直接装
lesswest
2014-07-03 14:44:35 +08:00
.dmg文件解压出.app 能直接装的 我试过
goldenapp
2014-07-03 19:48:29 +08:00
@lesswest 不是应用啊 是系统~
goldenapp
2014-07-03 19:49:08 +08:00
@qq2511296 哪个补丁 那个是为了显示10.9的选项吧……
goldenapp
2014-07-03 19:49:28 +08:00
@Niphor 真的吗 可否示下 谢谢~
goldenapp
2014-07-03 19:50:10 +08:00
@Niphor 有的啊 10.9变成hf2什么的 文件结构和以前不一样了……
Niphor
2014-07-04 09:27:59 +08:00
@goldenapp

忘记在哪找的了,直接贴出来吧...
前提是你有原始的dmg或者.app
我是在osx下面转换的,然后vmware里面装的,可以用
只是vmware,多数要选默认项,别去改USB3支持什么的,不然鼠标什么的不能用。

```
#!/bin/bash
#
# This executable converts a Mavericks .app (which allows to upgrade a machine
# from Mac OS 10.6.7+ to Mavericks) into a Mavericks .dmg (which allows to
# install Mavericks from scratch on a machine).
#
# It has been tested with "Install OS X 10.9 Developer Preview.app" (build
# 13A476u).
#


set -x
set -e


# The first argument is the path to the .app bundle (the input of the
# executable).
inputApp="$1"
# The second argument is the path to the .dmg file (the output of the
# executable), which must end with ".dmg".
outputDmg="$2"
[ "${outputDmg: -4}" = .dmg ]


#
# The problem: /System/Installation/Packages inside /BaseSystem.dmg inside
# "$inputApp"/Contents/SharedSupport/InstallESD.dmg is a dangling symlink,
# which prevents installing Mavericks from scratch.
# The solution: Replace the symlink with the /Packages directory inside
# "$inputApp"/Contents/SharedSupport/InstallESD.dmg.
#


tmpDir=`mktemp -d -t 'Create Mavericks Installer'`
installMnt="$tmpDir"/install
installPkg="$installMnt"/Packages
outputMnt="$tmpDir"/output
outputPkg="$outputMnt"/System/Installation/Packages


cleanup() {
if [ -d "$outputMnt" ]; then
hdiutil detach "$outputMnt"
fi


if [ -d "$installMnt" ]; then
hdiutil detach "$installMnt"
fi


rmdir -- "$tmpDir"
}


# Cleanup on failure.
trap cleanup ERR


# Mount InstallESD.dmg so we can access /BaseSystem.dmg and /Packages inside.
hdiutil attach "$inputApp"/Contents/SharedSupport/InstallESD.dmg \
-mountpoint "$installMnt" -nobrowse


# Create "$outputDmg", a read/write copy of the read-only BaseSystem.dmg.
hdiutil convert "$installMnt"/BaseSystem.dmg -format UDRW -o "$outputDmg"


# Enlarge "$outputDmg" to accommodate for our modifications. The UDRW image
# format is not sparse, so we must precisely compute the new size.
curSectors=`hdiutil resize "$outputDmg" -limits | tail -1 | awk '{ print $2 }'`
extraSectors=`BLOCKSIZE=512 du -s -- "$installPkg" | awk '{ print $1 }'`
hdiutil resize "$outputDmg" -sectors $((curSectors + extraSectors))


# Mount "$outputDmg".
hdiutil attach "$outputDmg" -mountpoint "$outputMnt" -nobrowse


# Modify "$outputDmg".
rm -- "$outputPkg"
cp -r -- "$installPkg" "$outputPkg"


# Cleanup on success.
trap ERR; cleanup


ls -alh -- "$outputDmg"
```
Niphor
2014-07-04 09:33:48 +08:00
lesswest
2014-07-04 10:24:15 +08:00
@goldenapp 是啊,dmg 解压出的系统不就是 Install XXX.app 吗?然后 vmware 直接装那个app 就是系统啊。
goldenapp
2014-07-04 17:20:09 +08:00
@Niphor @lesswest 非常感谢~

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/120734

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX