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

.viso or .vbox files unreadable by VirtualBox #154

Closed zahroc closed 4 years ago

zahroc commented 4 years ago

Ran the script to install Mojave. It seems to work fine. Created a new directory to install HighSierra, it gets to stage: populate_macos_target and errors with:

One or more virtual storage files could not be loaded. Exiting.

If you open the VirtualBox manager, the new config says Inaccessible and when you click on it, you get:

Cannot attach medium 'C:\users\sysadmin\VirtualBox-Sierra\HighSierra_Installation_files.viso' {e4ee469b-ec85-4614-a868-c7c8a25b90a0}

Result Code: VBOX_E_OBJECT_IN_USE (0x80BB000C) Component: MediumWrap Interface: Medium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}

Running Windows 10 1909 Build 18363.592 and WSL 1

myspaghetti commented 4 years ago

Thanks for the bug report. Could you attach the files VBox.log and .vbox (and .vbox-prev if it exists) from the virtual machine's configuration and log directories?

myspaghetti commented 4 years ago

Seems to be an issue with VirtualBox releasing the VISO or the .vbox file. Workaround: reboot Windows and resume the last stage, ./macos-guest-virtualbox populate_macos_target

I'll see if there's any way to (nicely) force VirtualBox to release files.

zahroc commented 4 years ago

As requested Sierra.zip

myspaghetti commented 4 years ago

Thanks. The logs have no errors, meaning this is very likely an issue with VBoxManage.exe not releasing the file descriptor of Sierra.vbox or, less likely, the VISO file. I'll try to find a workaround other than rebooting Windows.

zahroc commented 4 years ago

When I try to remove the bad vm from the GUI, it locks up. Here is the output if I try from the CLI if that helps:

[C:]vboxmanage list vms "Microsoft Windows 10 (1909)" {72528a80-e00b-4cb0-9a69-893b8a16b6c5} "FreeDOS v1.20" {4447c099-9cb8-4cc9-a69a-2c332af6e607} "IBM OS/2 Warp 4" {9459cb8e-661f-44df-8bd2-c0d68df1f4f0} "Microsoft DOS v6.22" {6e7d208d-e59b-4b83-a23b-4cfc2375125f} "Microsoft MS-DOS v6.22" {73698cb0-7a2c-4623-be8f-a2c2b0d1fa6e} "Microsoft MS-DOS v6.22 (Games)" {5d9e6328-5ee8-4777-8879-7884af030012} "Microsoft MS-DOS v6.22" {015a07f3-ee30-47b5-b0c0-d12c3082f3ab} "Microsoft Windows 95" {168d5016-2c9d-48ff-8247-3e03f1582fbd} "Microsoft Windows 2000 Professional (MSDN)" {3192901f-3616-45ff-95d2-e830e7188e34} "Microsoft Windows v3.11" {955f3324-ae08-49db-bec4-4cbb9c0f3f2a} "Mojave" {070278b2-4c38-4814-9d5a-c02c46e56d8c} "" {7a55e1e9-944a-4171-bbba-544dcb3d8981}

[C:]vboxmanage unregistervm {7a55e1e9-944a-4171-bbba-544dcb3d8981} --delete vboxmanage.exe: error: The object is not ready vboxmanage.exe: error: Details: code E_ACCESSDENIED (0x80070005), component MachineWrap, interface IMachine, callee IUnknown vboxmanage.exe: error: Context: "DeleteConfig(ComSafeArrayAsInParam(aMedia), pProgress.asOutParam())" at line 159 of file VBoxManageMisc.cpp

myspaghetti commented 4 years ago

Did you reboot the host before trying to remove the VM?

zahroc commented 4 years ago

Yes

myspaghetti commented 4 years ago

Could be a permissions issue. Try unregistering it without the --delete flag

zahroc commented 4 years ago

I actually removed the Sierra viso from the media manager and then was able to delete it,

l-g commented 4 years ago

Same (?) issue on a Mac:

`% /opt/local/bin/bash ~/bin/macos-guest-virtualbox.sh

              Push-button 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.

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's dynamically allocated storage disk image.

The script can be resumed, as described when running the following command: /Users/db/bin/macos-guest-virtualbox.sh documentation | less -R

Press enter to review the script settings.

vmname="macOS2" # name of the VirtualBox virtual machine macOS_release_name="Mojave" # install "HighSierra" "Mojave" or "Catalina" storagesize=128000 # 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.

Mojave selected to be downloaded and installed

stage: prompt_delete_existing_vm

A virtual machine named "macOS2" already exists. Delete existing virtual machine "macOS2"? [y/N] y 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

stage: create_vm

stage: prepare_macos_installation_files

Downloading Apple macOS Mojave software update catalog Mojave_sucatalog 100%[===================>] 6,08M --.-KB/s om 0,1s
Trying to find macOS Mojave InstallAssistant download URL Mojave_sucatalog_00 100%[===================>] 39,98K --.-KB/s om 0,005s
Mojave_sucatalog_01 100%[===================>] 969 --.-KB/s om 0s
Mojave_sucatalog_02 100%[===================>] 39,90K --.-KB/s om 0,006s
Found download URL: http://swcdn.apple.com/content/downloads/34/54/041-88800-A_HLMBDM42FL/anrmoj880qkj0lbybqm0c3830p70nawjrv/

Downloading macOS installation files from swcdn.apple.com Mojave_BaseSystem.c 100%[===================>] 1,94K --.-KB/s om 0s
Mojave_InstallInfo. 100%[===================>] 1,55K --.-KB/s om 0s
Mojave_AppleDiagnos 100%[===================>] 2,87M 11,9MB/s om 0,2s
Mojave_AppleDiagnos 100%[===================>] 328 --.-KB/s om 0s
Mojave_BaseSystem.d 100%[===================>] 467,18M 70,6MB/s om 7,1s
Mojave_InstallESDDm 100%[===================>] 5,15G 64,5MB/s om 82s

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. skapar filen 'Mojave_InstallESD.part00' skapar filen 'Mojave_InstallESD.part01' skapar filen 'Mojave_InstallESD.part02' skapar filen 'Mojave_InstallESD.part03' skapar filen 'Mojave_InstallESD.part04' skapar filen 'Mojave_InstallESD.part05'

Downloading open-source APFS EFI drivers used for VirtualBox 6.0 and 5.2 AppleSupport-v2.0.4 100%[===================>] 42,20K --.-KB/s om 0,1s
Archive: AppleSupport-v2.0.4-RELEASE.zip inflating: ApfsDriverLoader.efi
inflating: AppleImageLoader.efi
inflating: AppleUiSupport.efi

stage: create_nvram_files od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] od: illegal option -- - usage: od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...]

stage: create_macos_installation_files_viso Creating EFI startup script

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

stage: create_basesystem_vdi 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"... Creating dynamic image with size 2147426304 bytes (2048MB)...

stage: create_target_vdi Creating macOS2 target system virtual disk image. 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 4197cdbb-7b55-42d8-83e9-7e510259943d

stage: create_install_vdi Creating Mojave installation media virtual disk image. 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 96ba1dc5-09a1-49b2-9c11-595712361e28

stage: configure_vm

stage: populate_virtual_disks One or more virtual storage files could not be loaded. Exiting. `

myspaghetti commented 4 years ago

@l-g possibly, but there's also a bug with od which was not gnu od. Fixed the od bug in version 0.87.3, but you still might be experiencing the file access bug.

myspaghetti commented 4 years ago

Closing until further information is available.