Coder Social home page Coder Social logo

myspaghetti / macos-virtualbox Goto Github PK

View Code? Open in Web Editor NEW
13.5K 13.5K 1.1K 813 KB

Push-button installer of macOS Catalina, Mojave, and High Sierra guests in Virtualbox on x86 CPUs for Windows, Linux, and macOS

License: GNU General Public License v2.0

Shell 100.00%
bash-script macos macos-installer macos-virtual-machine virtualbox virtualbox-efi

macos-virtualbox's Introduction

macOS inside a VirtualBox window with the dock positioned on the left

Push-button installer of macOS on VirtualBox

macos-guest-virtualbox.sh is a Bash script that creates a macOS virtual machine guest on VirtualBox with unmodified macOS installation files downloaded directly from Apple servers.

A default install only requires the user to sit patiently and, less than ten times, press enter when prompted by the script, without interacting with the virtual machine.

Tested on bash and zsh on Cygwin. Works on macOS, CentOS 7, and Windows on x86 CPUs with VT-x or AMD-V. Should work on most modern Linux distros.

macOS Catalina (10.15), Mojave (10.14), and High Sierra (10.13) currently supported.

Maintainer wanted

If you would like to become the maintainer of this repository, please see issue #645 - maintainer wanted.

Documentation

Documentation can be viewed by executing the command ./macos-guest-virtualbox.sh documentation

The majority of the script is either documentation, comments, or actionable error messages, which should make the script straightforward to inspect and understand.

iCloud and iMessage connectivity and NVRAM

iCloud, iMessage, and other connected Apple services require a valid device name and serial number, board ID and serial number, and other genuine (or genuine-like) Apple parameters. These can be set in EFI and NVRAM by editing the script. See the documentation command for further information.

Storage size

The script by default assigns a target virtual disk storage size of 80GB, which is populated to about 25GB on the host on initial installation. After the installation is complete, the storage size may be increased. See the documentation command for further information.

Primary display resolution

The following primary display resolutions are supported by macOS on VirtualBox: 5120x2880 2880x1800 2560x1600 2560x1440 1920x1200 1600x1200 1680x1050 1440x900 1280x800 1024x768 640x480. See the documentation command for further information.

Scope and unsupported features

The scope of the script is completing a default macOS install process on VirtualBox on supported hardware. Further functioning order of VirtualBox or macOS is beyond the scope of this script. Some features may behave unexpectedly, such as USB device support, audio support, FileVault boot password prompt support, and other features, including critical functionality.

CPU compatibility

The script is designed for x86 CPU Mac hardware. macOS guests on VirtualBox are generally incompatible with other CPU models. If the guest macOS boot process hangs on “LoadKernelFromStream”, “EndRandomSeed”, or "EXITBS", see the documentation command regarding VirtualBox CPU profiles and CPUID settings. Some CPU models released in 2020 and later may fail to start or complete the installer, and may require manually adjusting the CPUID settings.

Upgrading to Big Sur and Monterey

The virtual machine may be upgraded to the latest macOS Big Sur (11) and macOS Monterey (12) versions through Software Update. Big Sur may be installed in-place. Monterey may require attaching another volume to the virtual machine and selecting the volume as the installation target, otherwise the upgrade is prone to failing and entering a boot loop.

Performance and deployment

After successfully creating a working macOS virtual machine, consider importing it into more performant virtualization software, or packaging it for configuration management platforms for automated deployment. These virtualization and deployment applications require additional configuration that is beyond the scope of the script.

QEMU with KVM is capable of providing virtual machine hardware passthrough for near-native performance. QEMU supports the VMDK virtual disk image storage format, which can be configured to be created by the script. See the documentation command for further information. QEMU and KVM require additional configuration that is beyond the scope of the script.

VirtualBox Native Execution Manager (NEM)

The VirtualBox Native Execution Manager (NEM) is an experimental VirtualBox feature. VirtualBox uses NEM when access to VT-x and AMD-V is blocked by virtualization software or execution protection features such as Hyper-V, WSL2, WSLg, Windows Sandbox, memory integrity protection, Application Guard, Credential Guard, Device Guard, and other features and software. macOS and the macOS installer have memory corruption issues under NEM virtualization. The script checks for NEM and exits with an error message if it is detected.

VirtualBox can run on WSL2 and WSLg with some kernel module compilation, though performance is extremely low. At the point that kernel module compilation is required, it may be preferable to use QEMU/KVM on WSL2 and WSLg, which is orders of magnitude faster than VirtualBox on WSL2 and WSLg. WSL2, WSLg, QEMU, and KVM require additional configuration that is beyond the scope of the script.

Bootloaders

The macOS VirtualBox guest is loaded without extra bootloaders, but it is compatible with OpenCore. OpenCore requires additional configuration that is beyond the scope of the script.

Audio

macOS may not support any built-in VirtualBox audio controllers. The bootloader OpenCore may be able to load open-source or built-in audio drivers in VirtualBox, providing the configuration for STAC9221 (Intel HD Audio) or SigmaTel STAC9700,83,84 (ICH AC97) is available.

Display scaling

VirtualBox does not supply an EDID for its virtual display, and macOS does not enable display scaling (high PPI) without an EDID. The bootloader OpenCore can inject an EDID which enables display scaling.

FileVault

The VirtualBox EFI implementation does not properly load the FileVault full disk encryption password prompt upon boot. The bootloader OpenCore is able to load the password prompt with the parameter ProvideConsoleGop set to true. See sample config.plist

Dependencies

The following dependencies should be available through a package manager:
bash coreutils gzip unzip wget xxd dmg2img virtualbox

The following optional packages provide optical character recognition that reduces the required interaction with the script:
tesseract-ocr tesseract-ocr-eng

Supported versions:

  • VirtualBox ≥ 6.1.6, though versions as low as 5.2 may work.
  • GNU Bash ≥ 4.3, on Windows run through Cygwin or WSL "1", see NEM
  • GNU coreutils ≥ 8.22, GNU gzip ≥ 1.5, Info-ZIP unzip ≥ v6.0, GNU wget ≥ 1.14, xxd ≥ 1.11
  • dmg2img ≥ 1.6.5, on Cygwin the package is not available through the package manager so the script downloads it automatically.
  • tesseract-ocr ≥ 4

macos-virtualbox's People

Contributors

azdralovic avatar bittner avatar bronson avatar codyps avatar compugenius-programs avatar deepio avatar dvershinin avatar jonathanweinberg avatar khrj avatar kiendang avatar mechantrouquin avatar myspaghetti avatar natecraddock avatar rafork avatar ricciardi-adrien avatar slowpeek avatar someuser12 avatar steeleduncan avatar thispsj avatar tiagofilipesilva avatar trikosuave avatar wc7086 avatar wesselvanderlinden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macos-virtualbox's Issues

The disk doesn't have enough free space to download AppleSupport

In the step where I should manually download the AppleSupport-v2.0.4-RELEASE.zip, I receive the folowing error on Safari:

Safari could not download the file "AppleSupport-v2.0.4-RELEASE.zip" because the disk does not have enough free space.
Try deleting documents or downloading to another disk.

However, if I open the Disk Utility, it appears that "Mojave" has 43.9GB free and "macOS Base System" 4.82GB.


Environment:

I'm running WSL (Ubuntu) on Windows 10 1809 Home Single Language.

Here's my settings

vmname="Mojave"
storagesize=48000
cpucount=4
memorysize=8192
gpuvram=128
resolution="1980x1080"
serialnumber="NOTAVALIDSN0"
devicename="MacBookPro11,3"
boardid="Mac-2BD1B31983FE1663"

VBOX_E_OBJECT_NOT_FOUND - Could not find a registered machine named 'Mojave'

I'm getting the following error when running the sh script. What actions do I need to take to correct?

VBoxManage.exe: error: Could not find a registered machine named 'Mojave'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(pszVM).raw(), machine.asOutParam())" at line 595 of file VBoxManageMisc.cpp

Very minor error at the end when cleaning up temporary files

Everything seems to have been fine, with one very minor exception: the script failed when trying to delete the temporary files at the end.

Press enter when the virtual machine shutdown is complete.
Waiting for VM "Mojave" to power on...
VM "Mojave" has been successfully started.

macOS Mojave 10.14.2 will now install and start up.

Delete temporary files? [y/n] y./macos-guest-virtualbox.sh: line 550: syntax error: unexpected end of file

The temporary files indeed appear to have not been cleaned up. No big deal, obviously, but figured it was worth mentioning.

I'm running *buntu 18.04.

Problems with spaces in virtual machine name

At the

Loading base system onto installer virtual disk ...

stage, the command

asr restore ...

fails if the virtual machine name includes spaces - here.

I am conscious it may not be a good idea to include spaces in a machine name anyway, but just thought it would be worth highlighting this.

macOS host

I went through and followed along with the shell script until it finished. During the ensuing installation process, it freezes at "Installing Mojave, 12 minutes remaining."

Virtualbox 6.0.4
Host OS: macOS Mojave 10.14.3
screen shot 2019-03-05 at 12 12 34 am 1

Trying to start the VM from VM Manager fails.

It installs and works. I then use the .vdi file to create and run a Mac VM from the virtual box VM manager.

After this it doesn't boot the OS. Gets stuck in a loop as shown in the screenshot below ,after which it restarts.

Specs : Manjaro , Linux Kernel 4.14 , VB VM version 6
screenshot from 2019-02-08 20-24-27

Preparing to run macOS Installer...

In the VM, the terminal gets to "Preparing: 5.9%" then stops due to "an error [..] validating the installer data."

This has occurred twice, so doesn't appear to be a one-time bad download.

(cygwin)

Syntax error in Cygwin and WSL

I cloned the repo, chmod'd the sh file, and ran it, but I'm getting the following error:

./macos-guest-virtualbox.sh: line 261: syntax error near unexpected token (' ./macos-guest-virtualbox.sh: line 261: "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"'

I'll work on it, but just in case there's already a workaround or I'm doing something wrong....

Thanks!

"Command Not Found" screen corruption during install

Not quite sure what happened here but it was only cosmetic -- the script kept running.

When the installer finishes preparing, the virtual machine will reboot
into the base system, not the installer.

After the reboot, press enter when the Language window ./macos-guest-virtualbox.sh: line 491: or Utilities window is ready.\033[0m: command not found


Press enter when the macOS Utilities window is ready.

Although seeing "command not found" was a little scary, I could proceed as if nothing strange had happened.

segmentation fault on converting dmg

Hello! I got this error while script trying to convert downloaded basesystem dmg:

# uname -a
Linux ru-mi 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
...

Downloading BaseSystem.dmg from swcdn.apple.com
Downloaded BaseSystem.dmg. Converting to BaseSystem.img

dmg2img v1.6.5 (c) vu1tur ([email protected])

BaseSystem.dmg --> BaseSystem.img

./macos-guest-virtualbox.sh: line 221: 28510 Segmentation fault      dmg2img "BaseSystem.dmg" "BaseSystem.img"
Converting from raw image file="BaseSystem.img" to file="BaseSystem.vdi"...
Creating dynamic image with size 0 bytes (0MB)...
VBoxManage: error: Cannot create the disk image "BaseSystem.vdi": VERR_INVALID_PARAMETER
macOS Mojave.vdi target system virtual disk image ready.
Creating macOS Mojave installation media virtual disk image.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

A different error loading base system onto disk

I had an interruption while running the script, so I'm trying to pick up where I left off. So I commented everything above the point of interruption (except environment variable definitions), letting the modified script begin at the command asr restore --source /Volumes/Mojave/BaseSystem.dmg -- target /Volumes/Install --erase --noprompt.

It gives an error response:

"/Volumes/Install" is not a volume
Could not validate target - No such file or directory

For what it's worth, ls \Volumes returns

Mojave        OS X Base System        OS X Base System 1

Any suggestions? Thanks.

Error at the very end

Right at the last boot, when the Cygwin terminal asks to delete temporary files, the VM doesn't load macOS but rather this page:
capture

VM fails to start after moving installation files to the virtual disk

The VM setup makes it to the reboot in the step with the comment # reboot, because the installer does not work when the partition is remounted, but then the VM crashes when starting with this error.

The instruction at 0x0007F9E97884AC0 referenced memory at 0x00000000000000000010. The memory could not be used.

Also, there appears to be some sort of limit imposed by Apple for how many files you can download in a certain timeframe from swcdn.apple.com. I had to manually issue curl commands to download some of the files in the downloading macOS step.

Automatically parse Apple catalog

Requested enhancements:

  • Windows Subsystem on Linux support (requires minimal adjustments)
  • Resume at selected step
  • Select virtual disk size

[not bug] shared folder

Hello! Is there a way to make shared folder between host system and macOS? Like with VirtualBox Guest Additions.

keyboardputscancode fail on WSL

I have managed to get some progress with setting the paths under WSL.
The disk images gets created up until the Language screen, now however the keyboard commands are not being entered.

I'm getting:
VBoxManage.exe: error: Missing argument to 'keyboardputscancode'. Expected IBM PC AT set 2 keyboard scancode(s) as hex byte(s).

However it does work if I call the same command and scancodes from the comandline. So I have to assume it's not processing the lookups correctly. Will dig a little more, but any help would be appreciated.

Windows, Cygwin, Line-endings

My default setting for repositories on windows is 'use Windows line-endings \r\n and check-in Unix line-endings \n'. According to this, Cygwin does not like Windows line-endings at all. Errors appear, if there is an empty line or commands like read.

$ ./macos-guest-virtualbox.sh
./macos-guest-virtualbox.sh: Zeile 6: $'\r': Kommando nicht gefunden.
./macos-guest-virtualbox.sh: Zeile 10: $'\r': Kommando nicht gefunden.
./macos-guest-virtualbox.sh: Zeile 23: $'\r': Kommando nicht gefunden.
./macos-guest-virtualbox.sh: Zeile 28: $'\r': Kommando nicht gefunden.

  One-key semi-automatic installation of macOS On VirtualBox - Mojave 10.14.3
-------------------------------------------------------------------------------

This installer uses only open-source software and original
unmodified Apple binaries.

 of available storage,res
22GB for the virtual machine and 11.5GB for temporary installation files.
Assigning more storage for the virtual machine is recommended for long-term use.

The script checks for dependencies and will prompt to install them if unmet.

For iCloud and iMessage functionality, you will need to provide a valid
Apple serial number. macOS will work without it, but not Apple-connected apps.

./macos-guest-virtualbox.sh: Zeile 46: $'read\r': Kommando nicht gefunden.
./macos-guest-virtualbox.sh: Zeile 47: $'\r': Kommando nicht gefunden.
./macos-guest-virtualbox.sh: Zeile 49: $'\r': Kommando nicht gefunden.
./macos-guest-virtualbox.sh: Zeile 53: Syntaxfehler beim unerwarteten Wort `elif'
'/macos-guest-virtualbox.sh: Zeile 53: `elif [ "${BASH_VERSION:0:1}" -lt 4 ]; then

The problem can be solved by checking the repository out with Unix line-endings or installing dos2unix via Cygwin packet manager as well. Just run dos2unix macos-guest-virtualbox.sh once to convert the line-endings.

You should add an info and/or checks for this.

Fails to unmount after partitioning

I'm running Windows 10 with latest Cygwin and Virtualbox 6. Executing the script there is an error pretty early after partitioning, which lets the installation fail completely. Should I give it a trial with VB 5.2 or anything else to keep in mind?
unmount_fails

Check for VirtualBox Extension Pack

Hello.

I'm trying to run your script with my Ubuntu 18.04 and VirtualBox 6.0 and I get a lot of random errors like:

VBoxManage: error: Failed to send a scancode

Then the commands to be executed in terminal got corrupted, usually I see the last letter of current command sent repeated indefinitely. I tried to introduce all of them manually, but there is a lot of them...

I don't why I get these errors. Any clue?

Download link broken

I went in and disabled the download link since I had the old DMG file, but it'll need to be adjusted for others.

--2019-05-05 15:24:57--  http://swcdn.apple.com/content/downloads/34/52/041-38914/dhgsi49xaudtqpbj3zibbmjy3ry9ola2rb/BaseSystem.dmg
Resolving swcdn.apple.com (swcdn.apple.com)... 17.253.21.204, 17.253.21.207, 2620:149:a10:f000::5, ...
Connecting to swcdn.apple.com (swcdn.apple.com)|17.253.21.204|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-05-05 15:24:58 ERROR 404: Not Found.```

Nothing happens after "installer started" in install script

After the text Installer started. Please wait for the license prompt to appear at the bottom of the virtual machine terminal, then press enter here. This will accept the license on the virtual machine. Nothing happens.
The bash shell in the VM runs the command cd "/Install macOS Mojave.app/Contents/Resources/"; ./startosinstall --volume "/Volumes/'"${vmname}"'" and then shows a prompt for a new command. I waited for a long time and nothing seemed to be running. I have tried multiple times.

Invalid wget options on CentOS 7

On CentOS 7, the wget option --show-progress is invalid.
wget version is 1.14
CentOS version is 7.3.1611

Work around is to remove "--quiet --show-progress" from the wget commands.

VDI isn't created automatically

The VDI "Install Mojave" isn't created, I have to do it manually and to attach it too.
Windows 10 with WSL

`Downloading BaseSystem.dmg from swcdn.apple.com
--2019-03-09 18:07:35-- http://swcdn.apple.com/content/downloads/34/52/041-38914/dhgsi49xaudtqpbj3zibbmjy3ry9ola2rb/BaseSystem.dmg
Resolving swcdn.apple.com (swcdn.apple.com)... 17.253.109.203, 17.253.109.202
Connecting to swcdn.apple.com (swcdn.apple.com)|17.253.109.203|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 485306481 (463M) [application/octet-stream]
Saving to: 'BaseSystem.dmg'

BaseSystem.dmg 100%[=================================================>] 462.82M 2.86MB/s in 97s

2019-03-09 18:09:12 (4.78 MB/s) - 'BaseSystem.dmg' saved [485306481/485306481]

Downloaded BaseSystem.dmg. Converting to BaseSystem.img

dmg2img v1.6.5 (c) vu1tur ([email protected])

BaseSystem.dmg --> 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 BaseSystem.img
Converting from raw image file="BaseSystem.img" to file="BaseSystem.vdi"...
Creating dynamic image with size 2146541568 bytes (2048MB)...
Creating MacOS target system virtual disk image.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: ebe9ac1c-90bf-4e21-a086-dc114e5284ac
Creating MacOS installation media virtual disk image.
Oracle VM VirtualBox Command Line Management Interface Version 6.0.4
(C) 2005-2019 Oracle Corporation
All rights reserved.

Usage:

VBoxManage createmedium [disk|dvd|floppy] --filename
[--size |--sizebyte ]
[--diffparent |
[--format VDI|VMDK|VHD] (default: VDI)
[--variant Standard,Fixed,Split2G,Stream,ESX,
Formatted]

Syntax error: Invalid parameter 'MacOS.vdi'
Oracle VM VirtualBox Command Line Management Interface Version 6.0.4
(C) 2005-2019 Oracle Corporation
All rights reserved.

Usage:

VBoxManage storageattach <uuid|vmname>
--storagectl
[--port ]
[--device ]
[--type dvddrive|hdd|fdd]
[--medium none|emptydrive|additions|
<uuid|filename>|host:|iscsi]
[--mtype normal|writethrough|immutable|shareable|
readonly|multiattach]
[--comment ]
[--setuuid ]
[--setparentuuid ]
[--passthrough on|off]
[--tempeject on|off]
[--nonrotational on|off]
[--discard on|off]
[--hotpluggable on|off]
[--bandwidthgroup ]
[--forceunmount]
[--server |]
[--target ]
[--tport ]
[--lun ]
[--encodedlun ]
[--username ]
[--password ]
[--passwordfile ]
[--initiator ]
[--intnet]

VBoxManage.exe: error: Invalid parameter 'MacOS.vdi'
Starting virtualmachine MacOS. This should take a couple of minutes.
Waiting for VM "MacOS" to power on...
VM "MacOS" has been successfully started.`

Mojave installer fails during "preparation"

The Mojave installer fails during the preparation stage at roughly 73%. I retried the script from the beginning, deleting all temp files, and re-downloading as suggested in #24, thinking it might have been a corrupted download or something. It failed again at nearly the same %.

There were no visible errors during any of the previous steps, other than VirtualBox warning about "critical disk space" as noted by the script.

However, increasing the size of the installer virtual disk to the recommended 12GB solved the problem. The third try was successful. Maybe some recent updates have pushed the installer size beyond the original 8GB allocated by the script?

Error during Loading base system onto installer virtual disk

I have to admit I'm new to this, but this script is exactly what I'm looking for - installing MacOS on the VirtualBox VM. I've resolved a couple of issues, like installing the VirtualBox Expansion Pack to enable USB 2.0/3.0 support and prefixing 'string:' to the extradata DmiSystemSerial value mentioned in the other issue.

However now when I get to the 'Loading base system onto installer virtual disk' step, I get an error in the bash terminal window that it can't find the restore command (see attached screenshot). Am I missing an environment variable maybe?

image

WSL gets the paths wrong.

I'm trying to run this on WSL but by the looks of it because the file locations are all relative it's getting the locations wrong between the WSL commands and Windows native commands.
eg I'm on a WSL shell and I execute the shell script there which would be /home/rabie/macos (I placed the script there.
The wget works and dumps the BaseSystem.dmg in /home/rabie/macos and the convert to .img works, but then when VBoxManage.exe (and all related Windows native commands) gets called it defaults to c:\Windows\System32 as it's working directory. It then looks for all the IMG and VDI files there which then failes.

A solution would be to specify a working directory eg "/mnt/c/temp/" and "c:\temp" and then prepend all relevant file operations with those paths or (less than ideal nor not sure how this would be possible) to change directory prior to calling the exes)
If I manage to, I'll try and fix and upload the script.

Herewith the failed messages:

Press enter to continue, CTRL-C to exit.
VBoxManage.exe: error: Could not find a registered machine named 'MacOsMojave'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(VMNameOrUuid).raw(), machine.asOutParam())" at line 2621 of file VBoxManageInfo.cpp
Downloading BaseSystem.dmg from swcdn.apple.com
--2019-03-08 08:20:39-- http://swcdn.apple.com/content/downloads/34/52/041-38914/dhgsi49xaudtqpbj3zibbmjy3ry9ola2rb/BaseSystem.dmg
Resolving swcdn.apple.com (swcdn.apple.com)... 197.80.131.145, 197.80.131.146
Connecting to swcdn.apple.com (swcdn.apple.com)|197.80.131.145|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 485306481 (463M), 478478818 (456M) remaining [application/octet-stream]
Saving to: ‘BaseSystem.dmg’

BaseSystem.dmg 100%[+=================================================================================>] 462.82M 1.25MB/s in 6m 38s

2019-03-08 08:27:19 (1.15 MB/s) - ‘BaseSystem.dmg’ saved [485306481/485306481]

Downloaded BaseSystem.dmg. Converting to BaseSystem.img

dmg2img v1.6.7 (c) vu1tur ([email protected])

BaseSystem.dmg --> 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 BaseSystem.img
Converting from raw image file="BaseSystem.img" to file="BaseSystem.vdi"...
VBoxManage.exe: error: Cannot open file "BaseSystem.img": VERR_FILE_NOT_FOUND
Creating MacOsMojave 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\MacOsMojave.vdi'.
VBoxManage.exe: error: VDI: cannot create image 'C:\Windows\system32\MacOsMojave.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 VBoxManageDisk.cpp
Creating MacOsMojave installation media virtual disk image.
Oracle VM VirtualBox Command Line Management Interface Version 6.0.4
(C) 2005-2019 Oracle Corporation
All rights reserved.

Usage:

VBoxManage createmedium [disk|dvd|floppy] --filename
[--size |--sizebyte ]
[--diffparent |
[--format VDI|VMDK|VHD] (default: VDI)
[--variant Standard,Fixed,Split2G,Stream,ESX,
Formatted]

Syntax error: Invalid parameter 'MacOsMojave.vdi'
VBoxManage.exe: error: Could not find file for the medium 'C:\Windows\system32\MacOsMojave.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUnknown
VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 191 of file VBoxManageDisk.cpp
VBoxManage.exe: error: Invalid UUID or filename "MacOsMojave.vdi"
Oracle VM VirtualBox Command Line Management Interface Version 6.0.4
(C) 2005-2019 Oracle Corporation
All rights reserved.

Usage:

VBoxManage storageattach <uuid|vmname>
--storagectl
[--port ]
[--device ]
[--type dvddrive|hdd|fdd]
[--medium none|emptydrive|additions|
<uuid|filename>|host:|iscsi]
[--mtype normal|writethrough|immutable|shareable|
readonly|multiattach]
[--comment ]
[--setuuid ]
[--setparentuuid ]
[--passthrough on|off]
[--tempeject on|off]
[--nonrotational on|off]
[--discard on|off]
[--hotpluggable on|off]
[--bandwidthgroup ]
[--forceunmount]
[--server |]
[--target ]
[--tport ]
[--lun ]
[--encodedlun ]
[--username ]
[--password ]
[--passwordfile ]
[--initiator ]
[--intnet]

VBoxManage.exe: error: Invalid parameter 'MacOsMojave.vdi'
VBoxManage.exe: error: Could not find file for the medium 'C:\Windows\system32\BaseSystem.vdi' (VERR_FILE_NOT_FOUND)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUnknown
VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 191 of file VBoxManageDisk.cpp
VBoxManage.exe: error: Invalid UUID or filename "BaseSystem.vdi"
Starting virtualmachine MacOsMojave. This should take a couple of minutes.
Waiting for VM "MacOsMojave" to power on...
VM "MacOsMojave" has been successfully started.

Works on Windows Subsystem for Linux

A Debian guest running in WSL worked great. This script is really impressive.

To prepare, I only had to make VBoxManage.exe available as VBoxManage. I did it like this:

sudo apt-get dmg2img unzip wget
mkdir -p ~/bin
ln -s /mnt/c/Program\ Files/Oracle/VirtualBox/VBoxManage.exe ~/bin/VBoxManage
export PATH=~/bin:$PATH

If you think it's worth it, I could send a PR that prepares a WSL path similar to how it currently prepares a Cygwin path and calls VBoxManage.exe if VBoxManage is missing.

usb support?

The readme says usb is not supported, but I was able to plug in my iphone and update it using iTunes with macOS guest and linux host.

Can't determine BASH_VERSION. Exiting.

i'm running ubuntu 16.04
tried running script, it terminated. \e[48;2;0;0;9m\e[38;2;255;255;255mPress enter to continue, CTRL-C to exit.macos-guest-virtualbox.sh: 46: read: arg count
Can't determine BASH_VERSION. Exiting.

checked bash version;
bash is already installed at the latest version (4.3-14ubuntu1.2), so it will not be upgraded.

Virtual Machine not starting

I used the script and after that I tried to start the VM with:
vboxmanage startvm macOS_Mojave_GE
Got the following result:

vboxmanage startvm macOS_Mojave_GE
Waiting for VM "macOS_Mojave_GE" to power on...
VBoxManage: error: The virtual machine 'macOS_Mojave_GE' has terminated unexpectedly during startup with exit code 1 (0x1)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine

SHA1 checksum for downloads

You have made awesome script. But one thing that could be improved is src files cache. Is it possible to download src dmg files directly by the script and then put them to the VM?

Download InstallESDDmg.pkg (6GB file) to host for easier resuming

This is a wish for an improvement, not really a bug.
The script should avoid downloading again and again the same MacOSX image if it find it already downloaded from a previously run of the same script. I ask this because, especially at start, it is easy to make mistakes and run it more than once, and downloading the already downloaded the same (big) image file could be a nice improvement...
that's all

Serial number not set as string

Running the script yields this error message:

Waiting for VM "Mojave" to power on...
VBoxManage: error: Configuration error: Querying "DmiSystemSerial" as a string failed (VERR_CFGM_NOT_STRING)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

I was able to fix the issue with this command:

vboxmanage setextradata "Mojave" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" "string:000000000000"

Now the VM starts successfully. Apparently the 'string:' prefix on the value is important for the value to be parsed correctly.

Mojave virtual machine already exists. Exiting.

I had to cancel the installation at one point and now I get this message every time. I deleted all the VM files in the script's home folder but it keeps saying the same thing even though no such VM is present in Virtualbox. What do I need to delete?

Stuck in UEFI shell.

Host: Fedora 29 x64

Stuck after:

Detaching initial base system and starting virtual machine.
The VM will boot from the new base system on the installer virtual disk.
Waiting for VM "Macintosh HD" to power on...
VM "Macintosh HD" has been successfully started.

Press enter when the Language window is ready.

I've run into issue #15 , where on (possiblly the final?) boot, it sends me to the UEFI shell. FS0 and FS1 are empty. FS2 has a directory with no name, somehow.

Sorry, I wasn't sure if anyone would see my comment in a closed issue so I opened a new one. Unsure of the protocol there.

I tried the solutions in issue #15 , but as I said the .efi file is inaccessible to me. If it exists, it is probably in a directory with no name.

Also, the OS is already set as High Sierra 64-bit in settings, even though we are installing Mojave.

The only changes I've made to the installer script were these variables: vmname (Macintosh HD), storagesize (48000), memorysize (2048), gpuvram (34), serialnumber, devicename, boardid (last 3 copy/pasted from About This Mac).

Help, please?

screenshot_20190201_090626

screenshot_20190201_091052

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.