myspaghetti / macos-virtualbox

Push-button installer of macOS Catalina, Mojave, and High Sierra guests in Virtualbox on x86 CPUs for Windows, Linux, and macOS
GNU General Public License v2.0
13.51k stars 1.12k forks source link

Cannot open file "Mojave_BaseSystem.img": VERR_FILE_NOT_FOUND #92

Closed mapleleafs89 closed 5 years ago

mapleleafs89 commented 5 years ago

Installer reported below errors, virtual box VM started but it booted to uefi shell with "Error. No mapping found". This was completed on WSL clean install of ubuntu.

                Semi-automatic installer of macOS on VirtualBox
-------------------------------------------------------------------------------

This script installs only open-source software and unmodified Apple binaries.

The script checks for dependencies and will prompt to install them if unmet.
Some stages may fail due to errant keyboard presses; run the script with
"./macos-guest-virtualbox.sh stages" to see how to run only certain stages.

For iCloud and iMessage connectivity, the script needs to be edited with genuine
or genuine-like Apple parameters. macOS will work without these parameters, but
Apple-connected apps will not.

The installation requires about 40GB of available storage, 25GB for
temporary installation files and 15GB for the virtual machine. Deleting the
temporary files when prompted reduces the storage requirement by about 10GB.

Press enter to review the script settings.

vmname="macOS"             # name of the VirtualBox virtual machine
storagesize=22000          # VM disk image size in MB. minimum 22000
cpucount=2                 # VM CPU cores, minimum 2
memorysize=4096            # VM RAM in MB, minimum 2048
gpuvram=128                # VM video RAM in MB, minimum 34, maximum 128
resolution="1280x800"      # VM display resolution

These values may be customized by editing them at the top of the script file.

Press enter to continue, CTRL-C to exit.
Can't find VBoxManage in PATH variable,
checking /mnt/c/Program Files/Oracle/VirtualBox/VBoxManage.exe
Found VBoxManage

Press a key to select the macOS version to install on the virtual machine:
 [H]igh Sierra (10.13)
 [M]ojave (10.14)
 [C]atalina (10.15 beta)

 [H/M/C] M
Mojave selected

Downloading Apple macOS Mojave software update catalog
Mojave_sucatalog              100%[=================================================>]   5.09M  7.62MB/s    in 0.7s
Trying to find macOS Mojave InstallAssistant download URL
Mojave_sucatalog_00_InstallAs 100%[=================================================>]  39.90K  --.-KB/s    in 0.03s
Found download URL: http://swcdn.apple.com/content/downloads/16/00/041-94412/t6w6bldyviccosh24jj36g9dy7t7jly9sy/

Downloading macOS installation files from swcdn.apple.com
Mojave_BaseSystem.chunklist   100%[=================================================>]   1.90K  --.-KB/s    in 0s
Mojave_InstallInfo.plist      100%[=================================================>]   1.55K  --.-KB/s    in 0s
Mojave_AppleDiagnostics.dmg   100%[=================================================>]   2.85M  4.34MB/s    in 0.7s
Mojave_AppleDiagnostics.chunk 100%[=================================================>]     328  --.-KB/s    in 0s
Mojave_BaseSystem.dmg         100%[=================================================>] 458.04M  9.08MB/s    in 45s
Mojave_InstallESDDmg.pkg      100%[=================================================>]   5.16G  11.0MB/s    in 8m 39s

Downloading open-source APFS EFI drivers
AppleSupport-v2.0.4-RELEASE.z 100%[=================================================>]  42.20K  --.-KB/s    in 0.04s
Archive:  AppleSupport-v2.0.4-RELEASE.zip
  inflating: ApfsDriverLoader.efi
  inflating: AppleImageLoader.efi
  inflating: AppleUiSupport.efi

Creating EFI startup script
Creating VirtualBox 6 virtual ISO containing the
installation files from swcdn.apple.com

Splitting the several-GB InstallESDDmg.pkg into 1GB parts because
VirtualBox hasn't implemented UDF/HFS VISO support yet and macOS
doesn't support ISO 9660 Level 3 with files larger than 2GB.
Converting to BaseSystem.dmg to BaseSystem.img

dmg2img v1.6.7 (c) vu1tur (to@vu1tur.eu.org)

Mojave_BaseSystem.dmg --> Mojave_BaseSystem.img

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

Archive successfully decompressed as Mojave_BaseSystem.img
Converting from raw image file="Mojave_BaseSystem.img" to file="Mojave_BaseSystem.vdi"...
VBoxManage.exe: error: Cannot open file "Mojave_BaseSystem.img": VERR_FILE_NOT_FOUND
Creating macOS target system virtual disk image.
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to create medium
VBoxManage.exe: error: Could not create the medium storage unit 'C:\WINDOWS\system32\macOS.vdi'.
VBoxManage.exe: error: VDI: cannot create image 'C:\WINDOWS\system32\macOS.vdi' (VERR_ACCESS_DENIED)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreateMedium(struct HandlerArg *)" at line 462 of file VB
oxManageDisk.cpp
Creating Mojave installation media virtual disk image.
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to create medium
VBoxManage.exe: error: Could not create the medium storage unit 'C:\WINDOWS\system32\Install Mojave.vdi'.
VBoxManage.exe: error: VDI: cannot create image 'C:\WINDOWS\system32\Install Mojave.vdi' (VERR_ACCESS_DENIED)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCreateMedium(struct HandlerArg *)" at line 462 of file VB
oxManageDisk.cpp
VBoxManage.exe: error: Could not find file for the medium 'C:\WINDOWS\system32\macOS.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUn
known
VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpe
n, pMedium.asOutParam())" at line 191 of file VBoxManageDisk.cpp
VBoxManage.exe: error: Invalid UUID or filename "macOS.vdi"
VBoxManage.exe: error: Could not find file for the medium 'C:\WINDOWS\system32\Install Mojave.vdi' (VERR_FILE_NOT_FOUND)

VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUn
known
VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpe
n, pMedium.asOutParam())" at line 191 of file VBoxManageDisk.cpp
VBoxManage.exe: error: Invalid UUID or filename "Install Mojave.vdi"
VBoxManage.exe: error: Could not find file for the medium 'C:\WINDOWS\system32\Mojave_BaseSystem.vdi' (VERR_FILE_NOT_FOU
ND)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUn
known
VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpe
n, pMedium.asOutParam())" at line 191 of file VBoxManageDisk.cpp
VBoxManage.exe: error: Invalid UUID or filename "Mojave_BaseSystem.vdi"
VBoxManage.exe: error: Could not find file for the medium 'C:\WINDOWS\system32\Mojave_installation_files.viso' (VERR_FIL
E_NOT_FOUND)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUn
known
VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpe
n, pMedium.asOutParam())" at line 191 of file VBoxManageDisk.cpp
VBoxManage.exe: error: Invalid UUID or filename "Mojave_installation_files.viso"
Starting virtual machine macOS. This should take a couple of minutes.
Waiting for VM "macOS" to power on...
VM "macOS" has been successfully started.

Press enter when the Language window is ready.^C
myspaghetti commented 5 years ago

Duplicate of issue 83. VBoxManage.exe on WSL defaults to C:\WINDOWS\system32\ as a working directory. I cannot reproduce the issue. Possibly a permissions issue or some other issue with the working directory. I'll try to make a workaround.

myspaghetti commented 5 years ago

@mapleleafs89 please test version 0.75.0 and tell me if it fixes the C:\WINDOWS\system32 issue.