在 VirtualBox 中安裝 Mavericks

在 VirtualBox 中安裝 Mavericks

我想在 VirtualBox 中安裝 Mavericks。我嘗試了不同的解決方案,但我無法完成這項工作。首先,我從應用程式商店下載了 Mavericks。

然後我InstallESD.dmg使用磁碟工具將其轉換為 ISO,然後重命名該檔案。但是當我嘗試啟動時,我在 VirtualBox 中收到此錯誤:

致命:找不到可啟動介質!系統停止

當我用這個腳本建立 ISO 時,也發生了同樣的事情

#!/bin/bash
ESD=$1
TMP=$2

if [ -z "$ESD" ] || [ -z "$TMP" ]; then
    echo usage: "'$0' /path/to/esd /path/to/tmpdir"
    exit 1
fi
if ! [ -e "$ESD" ]; then
    echo "file '$ESD' does not exist"
    exit 1
fi
if ! [ -e "$TMP" ]; then
    echo "dir '$TMP' does not exist"
    exit 1
fi

MPAPP=/Volumes/install_app
MPIMG=/Volumes/install_img
IMGSPARSE=$TMP/install.sparseimage
IMGDVD=$TMP/install.cdr

detach_all() {
  if [ -d "$MPAPP" ]; then hdiutil detach "$MPAPP"; fi
  if [ -d "$MPIMG" ]; then hdiutil detach "$MPIMG"; fi
}
exit_all() {
  echo +++ Command returned with error, aborting ...
  exit 2
}

trap detach_all EXIT
trap exit_all ERR

echo +++ Trying to unmount anything from previous run
detach_all

echo +++ Mount the installer image
hdiutil attach "$ESD" -noverify -nobrowse -readonly -mountpoint "$MPAPP"


echo +++ Convert the boot image to a sparse bundle
rm -f "$IMGSPARSE"
hdiutil convert "$MPAPP"/BaseSystem.dmg -format UDSP -o "$IMGSPARSE"


echo +++ Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g "$IMGSPARSE"

echo +++ Mount the sparse bundle for package addition
hdiutil attach "$IMGSPARSE" -noverify -nobrowse -readwrite -mountpoint "$MPIMG"

echo +++ Remove Package link and replace with actual files
rm -f "$MPIMG"/System/Installation/Packages
cp -rp "$MPAPP"/Packages "$MPIMG"/System/Installation/

echo +++ Unmount the installer image
hdiutil detach "$MPAPP"

echo +++ Unmount the sparse bundle
hdiutil detach "$MPIMG"

echo +++ Resize the partition in the sparse bundle to remove any free space
hdiutil resize -sectors min "$IMGSPARSE"

echo +++ Convert the sparse bundle to ISO/CD master
rm -f "$IMGDVD"
hdiutil convert "$IMGSPARSE" -format UDTO -o "$IMGDVD"

echo +++ Remove the sparse bundle
rm "$IMGSPARSE"

echo "Done"
echo "Find your DVD at '$IMGDVD'"

我還創建了一個可啟動的筆式驅動器與這裡的訊息我將其安裝為虛擬磁碟。但當我嘗試掛載映像時,VirtualBox 再次拋出錯誤:

Failed to open the hard disk file /Users/username/Documents/usbdrive.vmdk.

Could not open the medium '/Users/username/Documents/usbdrive.vmdk'.

VD: error VERR_RESOURCE_BUSY opening image file '/Users/username/Documents/usbdrive.vmdk' (VERR_RESOURCE_BUSY).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Medium
Interface: IMedium {05f2bbb6-a3a6-4fb9-9b49-6d0dda7142ac}
Callee: IVirtualBox {fafa4e17-1ee2-4905-a10e-fe7c18bf5554}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

答案1

我認為馬克在以下位置回答了這個問題:

https://apple.stackexchange.com/questions/106476/how-to-install-os-x-mavericks-in-virtualbox#

我通常會在外部網站中新增摘要(但它是一個 StackExchange 網站)。

相關內容