Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

/InstallESD.dmg: Read-only file system #156

Closed
jschlight opened this issue Jan 31, 2020 · 10 comments
Closed

/InstallESD.dmg: Read-only file system #156

jschlight opened this issue Jan 31, 2020 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@jschlight
Copy link

I'm running this script on macOS Mojave 10.14.6 attempting to install Mojave on Virtualbox 6.0.16.

Everything goes well until the first time Terminal starts in the VM. Here's what I see:

Screen Shot 2020-01-31 at 11 34 06 AM

And here's the output from the script:

stage: configure_vm

stage: populate_virtual_disks
Starting virtual machine macOS Mojave. This should take a couple of minutes.

Press enter when the Language window is ready.

Press enter when the macOS Utilities window is ready.

Press enter when the Terminal command prompt is ready.

Please wait
Partitioning the target virtual disk and the installer virtual disk.
Loading base system onto the installer virtual disk. Moving installation
files to installer virtual disk, updating InstallInfo.plist, and rebooting the
virtual machine.

The virtual machine may report that disk space is critically low; this is fine.

When the installer virtual disk is finished being populated, the script will
shut down the virtual machine. After shutdown, the initial base system will be
detached from the VM and released from VirtualBox.

If the partitioning fails, exit the script by pressing CTRL-C.
Otherwise, please wait.
Mojave_BaseSystem.vdi detached from the virtual machine
and released from VirtualBox Manager.

stage: populate_macos_target
One or more virtual storage files could not be loaded. Exiting.
domus:~ jim$ 

How should I best proceed?

@myspaghetti myspaghetti self-assigned this Feb 1, 2020
@myspaghetti myspaghetti added the bug Something isn't working label Feb 1, 2020
@myspaghetti
Copy link
Owner

Hi! Thanks for the bug report. It looks like the very first or second command silently failed, an no disks were partitioned. Please start the script from the beginning. You will be prompted to delete the existing virtual machine, press y and continue the script.

If you get to the same state again, enter in the virtual machine Terminal diskutil list and post a screenshot of the output here, or if you prefer, enter diskutil list | curl -F 'f:1=<-' ix.io and paste the output from the URL that is returned in Terminal.

@jschlight
Copy link
Author

Hello Jack. Here's the screenshot from Terminal:

Screen Shot 2020-01-31 at 9 39 39 PM

I also tried running the script after completely deleting the the macOS VM from VirtualBox with the same result. Here's the complete output from the script:

domus:macos-guest-virtualbox-master jim$ bash ./macos-guest-virtualbox.sh 

                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.

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:
  ./macos-guest-virtualbox.sh documentation | less -R

Press enter to review the script settings.

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

stage: create_vm

stage: prepare_macos_installation_files

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: 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 macOS target system virtual disk image.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 80bca403-2c17-4442-b1ce-0a593e379ff5

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: abb93917-dfbe-4340-bc89-2bf307cb743a

stage: configure_vm

stage: populate_virtual_disks
Starting virtual machine macOS. This should take a couple of minutes.

Press enter when the Language window is ready.

Press enter when the macOS Utilities window is ready.

Press enter when the Terminal command prompt is ready.

Please wait
Partitioning the target virtual disk and the installer virtual disk.
Loading base system onto the installer virtual disk. Moving installation
files to installer virtual disk, updating InstallInfo.plist, and rebooting the
virtual machine.

The virtual machine may report that disk space is critically low; this is fine.

When the installer virtual disk is finished being populated, the script will
shut down the virtual machine. After shutdown, the initial base system will be
detached from the VM and released from VirtualBox.

If the partitioning fails, exit the script by pressing CTRL-C.
Otherwise, please wait.
Mojave_BaseSystem.vdi detached from the virtual machine
and released from VirtualBox Manager.

stage: populate_macos_target
One or more virtual storage files could not be loaded. Exiting.
domus:macos-guest-virtualbox-master jim$ 

I installed the dependencies required by your script using Homebrew.

I'm happy to provide any other assistance I can.

@myspaghetti
Copy link
Owner

That is a weird error. I'll try to reproduce it. Congrats, that is the weirdest bug I've seen on this script yet.

@myspaghetti
Copy link
Owner

Just to rule out a bad download, can you run the following on the host on the script's working directory?

md5 Mojave_BaseSystem.img

This should be the output for the installer version 10.14.4.0.0.1552634279:

b10c7482b32c747283536f29d1c4b9ca *Mojave_BaseSystem.dmg

I don't think this is the issue but I just want to make sure the dmg is not corrupt.

@jschlight
Copy link
Author

Hello Jack. Here's what I've got:

domus:macos-guest-virtualbox-master jim$ ls -al
total 25671840
drwxr-xr-x@  30 jim  staff         960 Jan 31 21:28 .
drwxr-xr-x+ 104 jim  staff        3328 Jan 31 11:49 ..
-rw-r--r--    1 jim  staff       11968 Sep 21  2018 ApfsDriverLoader.efi
-rw-r--r--    1 jim  staff       10116 Sep 21  2018 AppleImageLoader.efi
-rw-r--r--    1 jim  staff       43214 Sep 21  2018 AppleSupport-v2.0.4-RELEASE.zip
-rw-r--r--    1 jim  staff       46656 Sep 21  2018 AppleUiSupport.efi
-rw-------    1 jim  staff     2097152 Jan 31 21:32 Install Mojave.vdi
-rwxr-xr-x@   1 jim  staff       18092 Jan 31 04:18 LICENSE
-rw-r--r--    1 jim  staff         328 Oct 16 17:06 Mojave_AppleDiagnostics.chunklist
-rw-r--r--    1 jim  staff     3008007 Oct 16 17:06 Mojave_AppleDiagnostics.dmg
-rw-r--r--    1 jim  staff        1984 Oct 16 17:06 Mojave_BaseSystem.chunklist
-rw-r--r--    1 jim  staff   489876488 Oct 16 17:07 Mojave_BaseSystem.dmg
-rw-------    1 jim  staff  1571815424 Jan 31 21:32 Mojave_BaseSystem.vdi
-rw-r--r--    1 jim  staff  1000000000 Jan 31 12:01 Mojave_InstallESD.part00
-rw-r--r--    1 jim  staff  1000000000 Jan 31 12:02 Mojave_InstallESD.part01
-rw-r--r--    1 jim  staff  1000000000 Jan 31 12:03 Mojave_InstallESD.part02
-rw-r--r--    1 jim  staff  1000000000 Jan 31 12:04 Mojave_InstallESD.part03
-rw-r--r--    1 jim  staff  1000000000 Jan 31 12:04 Mojave_InstallESD.part04
-rw-r--r--    1 jim  staff   533153115 Jan 31 12:05 Mojave_InstallESD.part05
-rw-r--r--    1 jim  staff  5533153115 Oct 16 17:14 Mojave_InstallESDDmg.pkg
-rw-r--r--    1 jim  staff        1584 Oct 16 17:14 Mojave_InstallInfo.plist
-rw-r--r--    1 jim  staff         934 Jan 31 21:26 Mojave_Installation_files.viso
-rwxr-xr-x@   1 jim  staff        3064 Jan 31 04:18 README.md
-rw-------    1 jim  staff     2097152 Jan 31 21:32 macOS.vdi
-rw-r--r--    1 jim  staff          57 Jan 31 21:26 macOS_MLB.bin
-rw-r--r--    1 jim  staff          46 Jan 31 21:26 macOS_ROM.bin
-rw-r--r--    1 jim  staff          69 Jan 31 21:26 macOS_csr-active-config.bin
-rw-r--r--    1 jim  staff         962 Jan 31 21:26 macOS_startup.nsh
-rw-r--r--    1 jim  staff          68 Jan 31 21:26 macOS_system-id.bin
-rwxr-xr-x@   1 jim  staff       55597 Jan 31 04:18 macos-guest-virtualbox.sh
domus:macos-guest-virtualbox-master jim$ md5 Mojave_BaseSystem.dmg
MD5 (Mojave_BaseSystem.dmg) = b10c7482b32c747283536f29d1c4b9ca
domus:macos-guest-virtualbox-master jim$ 

I'm working with two Macs: a recent MacBook Pro and a Mac Pro (Mid 2010) (Model Identifier MacPro5,1). My objective is to install the VM on the Mac Pro. Everything I've reported is from the Mac Pro.

Based on your comments, I decided to update to VirtualBox 6.1.2 on both Macs today. I completely uninstalled the previous VirtualBox version on both machines and then installed 6.1.2.

Under this new configuration, I am able to successfully create and run a Mojave VM on the MacBook Pro. But I'm still seeing the same error on the Mac Pro.

Please let me know if there is further information I can provide.

@myspaghetti
Copy link
Owner

Thanks! Like the other Mac issue, I can't reproduce it. I'm afraid that this will eventually close unsolved too.

For a workaround, you can copy macOS.vdi from your MacBook Pro to your Mac Pro and run ./macos-guest-virtualbox.sh create_vm configure_vm

Back to the issue, as far as I understand it, diskutil fails to run. This may be because the script fails to detect that the virtual machine is still running with VBoxManage list runningvms and detaches Mojave_BaseSystem.vdi, or because the VM loses access to Mojave_BaseSystem.vdi for some other reason, or the VM can't allocate memory for diskutil or fails to run it for some other reason.

Please try the attached script populate_virtual_disks.txt which doesn't detach Mojave_BaseSystem.vdi. If the partitioning succeeds with that one, the issue is with the detection of the running VMs. You can resume the rest of the steps with the complete script with ./macos-guest-virtualbox.sh populate_macos_target

populate_virtual_disks.txt - script without everything after the populate_virtual_disks step

@jschlight
Copy link
Author

Success! I ran the custom script you posted above and it ran successfully to completion. I then ran ./macos-guest-virtualbox.sh populate_macos_target which also ran to completion. So I've successfully built and run the VM on the Mac Pro.

If you decide to incorporate this improvement into your main script, please let me know if you'd like me to run it on the Mac Pro as a test before you post it live.

Thank you for a wonderful contribution to the community! I am in awe!

@myspaghetti
Copy link
Owner

Thank you jsclight.

Can you post the output of VBoxManage list runningvms from Terminal on the host Mac Pro when the guest is running?

@jschlight
Copy link
Author

Here it is:

domus:~ jim$ VBoxManage list runningvms
"Windows 10" {85e41d27-1b57-474c-94a2-618d25d017ef}
"macOS Mojave" {b54a041d-ee24-4200-889a-b758acab0685}
domus:~ jim$ 

I renamed the VM after installing it.

@myspaghetti
Copy link
Owner

Thanks. Turns out the part in the script that identifies that the VM is running doesn't deal with newlines properly. Fixed in version 0.86.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants