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.46k stars 1.11k forks source link

Windows filesystem path #562

Closed ahronmoshe closed 2 years ago

ahronmoshe commented 2 years ago

Hello, I have this problem when I execute the script on Windows system (WSL is installed as well as all dependency packages).

Here is the troubleshooting file

macOS_troubleshoot.txt

Downloading macOS 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.
creating file 'Catalina_InstallESD.part00'
creating file 'Catalina_InstallESD.part01'
creating file 'Catalina_InstallESD.part02'
creating file 'Catalina_InstallESD.part03'
creating file 'Catalina_InstallESD.part04'
creating file 'Catalina_InstallESD.part05'
creating file 'Catalina_InstallESD.part06'
creating file 'Catalina_InstallESD.part07'

stage: create_nvram_files

stage: create_macos_installation_files_viso
Creating EFI startup script

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

stage: configure_vm

stage: populate_basesystem_virtual_disk
Converting BaseSystem.dmg to BaseSystem.img

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

Catalina_BaseSystem.dmg --> Catalina_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 Catalina_BaseSystem.img
Converting from raw image file="Catalina_BaseSystem.img" to file="Catalina_BaseSystem.vdi"...
VBoxManage.exe: error: Cannot open file "Catalina_BaseSystem.img": VERR_FILE_NOT_FOUND
Failed to create "Catalina_BaseSystem.vdi".

Some versions of WSL require the script to execute on a Windows filesystem path,
for example   /mnt/c/Users/Public/Documents
Switch to a path on the Windows filesystem if VBoxManage.exe fails to
create or open a file.
macos_vm_vars_file
Exiting.

I change the path to the Windows filesystem as described in the script with "export macos_vm_vars_file= /mnt/c/Users/Public/Documents" and the problem is still not solved.

What should I do?

myspaghetti commented 2 years ago

Thanks for the detailed bug report!

This looks like a VBoxManage.exe file access issue as the error message says. I'm not sure how the macos_vm_vars_file text got into the error message, it's not supposed to be there.

Either way, move the script and its temporary files to /mnt/c/Users/Public/Documents or some other path that WSL sees on the Windows filesystem. Check that the user has read/write permissions for this path and files. You can continue where the script left off with ./macos-guest-virtualbox.sh populate_basesystem_virtual_disk and_all_subsequent_stages but if that fails you can start the script from the beginning.

ahronmoshe commented 2 years ago

Thanks for the quick help. That was really helpful.