Coder Social home page Coder Social logo

geerlingguy / macos-virtualbox-vm Goto Github PK

View Code? Open in Web Editor NEW
2.5K 2.5K 313.0 55 KB

Instructions and script to help you create a VirtualBox VM running macOS.

License: MIT License

Shell 100.00%
box mac macos shell-script virtual-machine virtualbox vm

macos-virtualbox-vm's Introduction

macOS VirtualBox VM Instructions

Current macOS version: High Sierra (10.13), tested with VirtualBox 5.2.16 r123759

To build a VM running macOS, follow the directions below:

  1. Download the installer from Mac App Store (it should be available in the 'Purchases' section if you've acquired it previously). The installer will be placed in your Applications folder. (Should work for Yosemite, El Capitan, Sierra and High Sierra, Mojave - 10.10-10.14.)

    • Note: On newer hardware, you might not be able to download older OS releases that Apple doesn't support on the newer hardware (e.g. the 2016 MacBook Pro can only download 10.12 Sierra or later). In this case, you need to use an older Mac to download the older OS.
  2. Make the script executable and run it: chmod +x prepare-iso.sh && ./prepare-iso.sh.

    If the script fails to find the installer you can specify its path as the first parameter. By default, the output is saved as <Yosemite|El Capitan|Sierra|High Sierra|Mojave>.iso on the Desktop. You can change this using the second parameter. Example:

     ./prepare-iso.sh /Applications/Install\ macOS Sierra\ 2.1\ Beta\ 2.app sierra-2.1-b2
    
  3. Open VirtualBox and create a new VM.

  4. Set:

    • name: Choose a name
    • type: Mac OS X
    • version: Mac OS X (64-bit).
  5. Follow the rest of the VM creation wizard and either leave the defaults or adjust to your liking.

    • For Big Sur, the installer requires the disk to have at least 35.3 GB.
  6. Go into the Settings for the new VM you created and: 1. Under 'Display', increase the Video Memory to at least 128MB, otherwise macOS might not boot correctly, and display performance will be abysmal. 2. Under 'Audio', uncheck 'Enable Audio', otherwise the VM may display 'choppy' performance.

  7. In Terminal, run the command VBoxManage modifyvm VM_NAME --cpuidset 00000001 000306a9 00020800 80000201 178bfbff (where VM_NAME is the exact name of the VM set in step 4) so the VM has the right CPU settings for macOS.

  8. Click 'Start' to boot the new VM.

  9. Select the iso created in step 2 when VirtualBox asks for it.

  10. In the installer, select your preferred language.

  11. Open Disk Utility and format the volume: 1. Go to Utilities > Disk Utility, select the VirtualBox disk, and choose Erase to format it as:

    • For macOS < 10.13, choose Mac OS Extended (Journaled)
    • For macOS 10.13 and later, choose APFS.
  12. Quit Disk Utility, and then continue with installation as normal.

Troubleshooting & Improvements

  • I've noticed that sometimes I need to go in and explicitly mark the iso as a Live CD in the VM settings in order to get the VM to boot from the image.

  • If you try to start your VM and it does not boot up at all, check to make sure you have enough RAM to run your VM.

  • Conversely, VirtualBox sometimes does not eject the virtual installer DVD after installation. If your VM boots into the installer again, remove the ISO in Settings -> Storage.

  • VirtualBox uses the left command key as the "host key" by default. If you want to use it for shortcuts like command+c or command-v (copy&paste), you need to remap or unset the "Host Key Combination" in Preferences -> Input -> Virtual Machine.

  • The default Video Memory of 16MB is far below Apple's official requirement of 128MB. Increasing this value may help if you run into problems and is also the most effective performance tuning.

  • Depending on your hardware, you may also want to increase RAM and the share of CPU power the VM is allowed to use.

  • When the installation is complete, and you have a fresh new macOS VM, you can shut it down and create a snapshot. This way, you can go back to the initial state in the future. I use this technique to test the mac-dev-playbook, which I use to set up and configure my own Mac workstation for web and app development.

  • If for High Sierra you can not find the VirtualBox disk created inside the Disk Utility select View -> Show All Devices and format the newly visible device (Source: tinyapps.org).

  • If for High Sierra you encounter boot / EFI problems, restart the VM and hit F12 to get to the VirtualBox boot manager. Select EFI In-Terminal Shell and run:

      Shell> fs1:
      FS1:\> cd "macOS Install Data"
      FS1:\macOS Install Data\> cd "Locked Files"
      FS1:\macOS Install Data\Locked Files\> cd "Boot Files"
      FS1:\macOS Install Data\Locked Files\Boot Files\> boot.efi
    
  • If keyboard and mouse do not work inside the VM:

    1. Ensure the VirtualBox Extension Pack is installed.
    2. In the VM settings, under Ports > USB, select USB 3.0 (xHCI) Control.
  • If for Big Sur the installer says The selected volume is not large enough to install on. A minimum of 35.3 GB is required., shutdown the VM, go to File > Virtual Media Manager, and increase the disk size. Now, restart the VM, go to Disk Utility, delete the too-small partition and re-create it to use all of the available space.

Larger VM Screen Resolution

To control the screen size of your macOS VM:

  1. Shutdown your VM

  2. Run the following VBoxManage command:

     VBoxManage setextradata VM_NAME VBoxInternal2/EfiGopMode N
    

Replace VM_NAME with the name of your Virtual Machine. Replace N with one of 0,1,2,3,4,5. These numbers correspond to the screen resolutions 640x480, 800x600, 1024x768, 1280x1024, 1440x900, 1920x1200 screen resolution, respectively.

The video mode can only be changed when the VM is powered off and remains persistent until changed. See more details in this forum discussion.

Notes

  • The code for this example originally came from VirtualBox forums and especially this article.
  • Subsequently updated to support Yosemite - Sierra based on this thread, and High Sierra and beyond based on the work of a number of contributors (thanks!).
  • To install command line tools after macOS is booted, open a terminal window and enter xcode-select --install (or just try using git, gcc, or other tools that would be installed with CLI tools).

Author

This project was created in 2015 by Jeff Geerling.

macos-virtualbox-vm's People

Contributors

1f5 avatar alenros avatar ansonhoyt avatar bgondy avatar cipaterson avatar eelkeblok avatar geerlingguy avatar indirection avatar ipmb avatar jbeard6 avatar lony avatar macteo avatar matthiaswinkelmann avatar msabramo avatar o-kasso avatar paul-calls9 avatar robbieclarken avatar s-sanjay avatar sumityadav avatar tsaodown 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-vm's Issues

installation confusion

Do you create the vbox on the pc or mac? I have a amd fx-8350 on sabertooth gen 2 motherboard.

Sierra 10.12.4 hangs during boot, stuck at gIOScreenLockState

Hey, I'm trying to get this to boot the first time. After following the README directions it just hangs about 30 seconds into starting up. The last log lines when it hangs are shown below. Any idea what the issue is?

I'm on Virtualbox 5.1.18 r114002 (Qt5.6.2) and MacOS 10.12.4 on an early 2015 Macbook Pro, and in Virtualbox I'm using 4GB RAM, 128MB video memory, 2 CPUs, and I've tried marking the ISO as Live CD/DVD

screen shot 2017-04-01 at 5 37 14 pm

VirtualBox with High-Sierra fails, "Attempting system restart...MACH Reboot" or repeating reboots

VirtualBox: tried with two versions:

One thing is new: Now VirtualBox pretends to explicitely support macOS 10.13 High Sierra (64bit):
grafik

Information in README.md is outdated:

If for High Sierra you encounter boot / EFI problems, restart the VM and hit F12 to get to the VirtualBox boot manager. Select EFI In-Terminal Shell and run:

Shell> fs1:
FS1:\> cd "macOS Install Data"
FS1:\macOS Install Data\> cd "Locked Files"
FS1:\macOS Install Data\Locked Files\> cd "Boot Files"
FS1:\macOS Install Data\Locked Files\Boot Files\> boot.efi

Neither drive (fs1:) nor path (macOS Install Data) exists:

virtualbox_mac os x high sierra - failed_06_09_2018_09_18_56

I tried according to the documentation and ended with Attempting system restart...MACH Reboot, see snapshots from the screen-video:

vlcsnap-2018-09-06-09h31m52s073
vlcsnap-2018-09-06-09h32m04s182
vlcsnap-2018-09-06-09h33m21s439
vlcsnap-2018-09-06-09h33m35s536
vlcsnap-2018-09-06-09h33m44s595

Next I tried a new image without the CPU-patch, so I did not enter the following command:

  1. In Terminal, run the command VBoxManage modifyvm VM_NAME --cpuidset 00000001 000306a9 00020800 80000201 178bfbff (where VM_NAME is the exact name of the VM set in step 4) so the VM has the right CPU settings for macOS.

It then goes further, but still fails and constantly reboots, here some screenshots from the video:

vlcsnap-2018-09-06-09h38m09s412
vlcsnap-2018-09-06-09h38m22s838
vlcsnap-2018-09-06-09h38m37s909
vlcsnap-2018-09-06-09h38m47s025
vlcsnap-2018-09-06-09h38m56s149
vlcsnap-2018-09-06-09h39m03s730
vlcsnap-2018-09-06-09h39m11s153
vlcsnap-2018-09-06-09h39m17s964
vlcsnap-2018-09-06-09h39m24s812
vlcsnap-2018-09-06-09h39m30s893
vlcsnap-2018-09-06-09h39m38s940
vlcsnap-2018-09-06-09h39m58s527
vlcsnap-2018-09-06-09h40m11s407
vlcsnap-2018-09-06-09h40m23s550
vlcsnap-2018-09-06-09h40m30s904
vlcsnap-2018-09-06-09h40m36s522

Unable to install High Sierra (no FS1)

Hi @geerlingguy,

thanks for your time and effort you put together to make this work. It saved me a lot of time, but unfortunatly I'm stuck, right before it should all work. I tried all ways and also downgraded VirtualBox to 5.2.16 r123759. I also experienced #52 and used the solution from #52 (comment).

After following your steps closely, I'm always stuck with a system, which is booting into "Recovery Mode", if I leave the DVD in place or I only see the following screen:

bildschirmfoto 2018-11-18 um 21 14 49

Since there is no FS1, I think this issue is not related to #53 and as you can see in the screenshot, there is data folder in FS0.

I'm wondering if someone could help me out here. I'm a little bit stuck here and would really like to bring High Sierra into VirtualBox to separate several tasks and processes for testing etc.

Thanks again for all the work and effort!

Higher Resolution? Lag?

Is there any way to increase the resolution past option 5 to 2560x1440?

Also there's a lot of lag on display, especially when dragging or resizing windows. Is there a way to reduce lag?

Networking Issues on install

Hi, thanks for the great little script to get a sierra iso.

I cannot get any networking to work. I've tried every combination of bridged and nat. How did you get yours going?

I am on a Macbook Air 13" 2013 host, using your VM image. I've tried reinstalling it twice.

Thanks.

Leverage Bash associative arrays

It might be nice to consolidate the nested if ... else ... fi blocks into an iterative loop over a bash associative array. As new installers are supported they can be added in a declarative manner instead of a deeply nested if block.

Pseudocode would look something like:

# Init
declare -a installers
installers=(
    ["Sierra"]="Install macOS Sierra.app",
    ["ElCapitan"]="Install OS X El Capitan.app",
    ["Yosemite"]="Install OS X Yosemite.app"
)
# Loop
for iso_name in "${!installers[@]}"; do
    installerExists "${installers[$iso_name]}"
    result=$?
   if [ ${result} -eq 0 ] ; then
       createISO "${installers[$iso_name]}" "${iso_name}"
       exit 0
   fi
done
# Failure
echo "Could not find any installer"
exit 1

Parameters for prepare-iso.sh ignored

I wanted to create a 10.11 and 10.12 image. I have both the installers in /Applications, but the logic in the script seems to just check for the applications and ignores specifying which version or image name I want per the readme.

Enabling FileVault prevents booting

So, I enabled FileVault, not thinking this would cause issues. And unfortunately, now the VM won't boot. I've managed to find a way to boot the OS to where I can input my FileVault password, but then the system just doesn't recognize my keyboard. I suspect there might be some missing drivers that I can hopefully load?

High Sierra 10.13

It seems that macOS 10.13 has changed the installer and BaseSystem.dmg is no longer in the InstallESD.dmg. I tried to make an iso using the BaseSystem.dmg/.chunklist that is inside the installer, but when the installation starts (after the selection of the language) an error appears that OSXInstall.mpkg is broken.

Any idea how to create macOS 10.13 beta iso from the installation app?

For some reason VirtualBox sometimes installs OS again

For some reason VirtualBox sometimes installs the OS again when I double click on my VM. Any thoughts on why it wants to install it again? Last time my VM state was fine after the re-install. It's doing it again now, so I hope I can say the same this time.

Script ignores first argument

installerExists "Install macOS Sierra.app"

The script instructions say the first argument is the path to the installer, but it does no use this argument and instead looks for Sierra, then Capitan, then etc. installers. This causes confusion if you have multiple installers including Sierra, but want to run the script on something other than Sierra.

Install without an internet connection using only the iso content?

This is more of an question about the process rather than an issue with script that prepares the iso.

I tried to install High Sierra, having successfully created the iso using the script. Everything goes fine except that it appears to download everything from Apple instead of using the iso (already the product of a 6GB download). Do I have that wrong? The install time was estimated at 3+hours.

I killed everything and tried again with the network cable (virtually) unplugged. This time the installer would not start, but popped up an error stating that The Recovery Server Could Not Be Contacted.

I killed everything once more and tried again with Sierra, which works as expected and takes around 15 minutes to complete.

So, is it possible to install High Sierra without an internet connection using only the content in the iso?


I started with Mojave, after updating the script to produce an iso, but that has problems because VirtualBox lacks certain support - it hangs during the initial text part of the boot process at apfs_module_start and my initial reading indicates that virtualbox lacks afps support. So I tried to install High Sierra (unsuccessfully because I didn't want to download everything again), and then I successfully installed Sierra.

(All images were downloaded from Apple using my macBook Air which is currently running Sierra.)

El Capitan guest, Sierra host, VB 5.2.2 r119230 -> "invalid opcode" error when trying to boot

Got Install OS X El Capitan.app at 9th December 2017 (yesterday at the time of writing) from mac app store. Installer has version 1.7.50.

Made the .iso file from it by using the script from this repository. Resulting file size = 8015142912 bytes and its sha256 sum is 4c8f512b963a29f48b34552cca75c789a8fc14d1413dd0a4549e5817a6465355.

Created VirtualBox VM as described in README (incl. the cpuid step), then tried to boot it, and it only reaches a panic state with an "invalid opcode" error. (full screenshot below)

virtualbox_osx_10_12_2017_09_46_06

What could go wrong?

OSX 10.11 (El Capitan) fails to create on OSX 10.11

Errors

Resize the partition in the sparse bundle to remove any free space
--------------------------------------------------------------------------
$ hdiutil resize -size 3927744b /tmp/ElCapitan.sparseimage
hdiutil: resize: failed. Resource temporarily unavailable (35)

Convert the sparse bundle to ISO/CD master
--------------------------------------------------------------------------
$ hdiutil convert /tmp/ElCapitan.sparseimage -format UDTO -o /tmp/ElCapitan
hdiutil: convert failed - Resource temporarily unavailable

Remove the sparse bundle
--------------------------------------------------------------------------
$ rm /tmp/ElCapitan.sparseimage

Rename the ISO and move it to the desktop
--------------------------------------------------------------------------
$ mv /tmp/ElCapitan.cdr /Users/my.user/Desktop/ElCapitan.iso
mv: rename /tmp/ElCapitan.cdr to /Users/my.user/Desktop/ElCapitan.iso: No such file or directory

Can't boot into recovery mode or EFI

I am trying to install clover onto my Catalina VM. However, I can't get into recovery mode to disable the SIP.
holding F2 just boots into macos. EFI is working on my mohave VM.

discouraging use of option -r with cp(1)

From Apple's legacy cp(1) Mac OS X Manual Page:

COMPATIBILITY

Historic versions of the cp utility had a -r option. This implementation supports that option; however, its use is strongly discouraged, as it does not correctly copy special files, symbolic links, or fifo's.

The -v and -n options are non-standard and their use in scripts is not recommended.

– (sic; should be fifos (not fifo's)). The same discouragement appears in the manual page for cp(1) in pre-release build 17A264c of Mac OS X 10.13.

Please:

  • does anyone know of a good reason for the use of -r in prepare-iso.sh?

(I sped through some of the documentation that's referred from README.md, found no explanation.)

Install Guest Additions on macOS 10.15 Catalina.

On macOS 10.15 Catalina, Guest Additions cannot be installed by default. The installation cannot be completed as normal because the OS now require packages to be digitally signed. To get around this security limitation, you need to disable multiple security features in order to install the package. I think this applies to macOS 10.14 as well.

I managed to install Guest Additions using VirtualBox version 6.1.16 on Windows 7 to share the clipboard values between the host and the guest. If someone else wants to install this, here is the whole process:

Disable Gatekeeper

  1. Be sure to exit System Preferences on your Mac.
  2. Open a Terminal
  3. Enter the command sudo spctl --master-disable.

Source: How to open apps from unidentified developers on Mac in macOS Catalina

Check Gatekeeper is disabled

  1. Click on System Preferences on your Mac Dock.
  2. Choose Security & Privacy.
  3. Look at Allow apps download from:, it should be set to Anywhere. If it is, you are done.
  4. If not, click the lock icon at the bottom left of the screen.
  5. Choose the Anywhere option under Allow apps downloaded from. Prior to making the change, this option wasn't available.
  6. Click the unlocked lock again to keep the change.

Disable SIP (System Integrity Protection)

  1. Restart your computer in Recovery mode.
  2. Launch Terminal from the Utilities menu.
  3. Run the command csrutil disable .
  4. Restart your computer.

I tried pressing F12, F8 and even ESC key in order to configure VirtualBox to boot into the EFI shell but was not able to do so. In the end, this comment from issue 46 had the solution:

  1. In your VM's terminal enter the following command to reboot in recovery mode:
    sudo nvram recovery-boot-mode=unused && sudo shutdown -r now
  2. Once in recovery mode open a terminal in Utilities->Terminal.
  3. Run the commands you want like:
    csrutil disable
    spctl kext-consent add VB5E2TV963
    (note the last command is explained in steps below)
  4. Enter the following command to exit recovery mode:
    nvram -d recovery-boot-mode && shutdown -r now
  5. And you'll get back into normal macOS.

Check SIP is disabled

You can verify that SIP is disabled with the command:
csrutil status
which should display:
System Integrity Protection status: disabled..

Allow Oracle identifier for kext

  1. Restart your computer in Recovery mode. Refer to previous section to know how to do this.
  2. Launch Terminal from the Utilities menu.
  3. Run the command spctl kext-consent add VB5E2TV963 .
  4. Restart your computer.

VB5E2TV963 is the code for oracle.

Source: Install problem 10.14.5 vBox 6.0

Change ownership and permissions on filesystem

Enable writing to /System/Library/Extensions/.

In your VM's terminal enter the following commands:

sudo mount -uw /
sudo chown :admin /System/Library/Extensions/
sudo chmod 775 /System/Library/Extensions/

Source: Guest Additions not installing on macOS 10.15 Catalina guests

Install Guest Additions

At this point, the installation of Guest Addition should succeed. Proceed with normal installation instructions.

  1. On VirtualBox emulation window, click on Devices menu.
  2. Select Insert Guest Additions CD image....
  3. In your VM, click on the new CD image on the desktop.
  4. Click on VBoxDarwinAdditions.pkg.
  5. Follow the instructions on screen.
  6. A reboot is required after the installation.

Check clipboard sharing is working

Check that clipboard is shared between the host and the guest.

  1. On VirtualBox emulation window, click on Devices menu.
  2. Select menu Shared Clipboard, Bidirectional.
  3. In your VM, open a terminal.
  4. Select text.
  5. Right-click on the selected text and select Copy.
  6. On your host, open a note taking appplication.
  7. Right-click and select Paste.

Revert disabled security features

Enable Gatekeeper

  1. Be sure to exit System Preferences on your Mac.
  2. Open a Terminal
  3. Enter the command sudo spctl --master-enable.

Enable SIP

  1. Restart your computer in Recovery mode.
  2. Launch Terminal from the Utilities menu.
  3. Run the command csrutil enable .
  4. Restart your computer.

128mb vram now required?

I was unable to get the VM past a black screen without increasing vram all the way to 128mb.

Even tried 64mb.

Not sure if this is a consistent issue but sticking this here in case other folks run into this.

"Failed to mount the InstallESD.dmg" Error

Hello!

I'm running a fresh copy of Sierra and a fresh download of the Sierra installer (10.12.3) in my Applications directory. When I run this script, I get the following error:

Mount the installer image
-----------------------------------------------------------
$ hdiutil attach /Applications/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil: attach failed - Resource busy
Failed to mount the InstallESD.dmg from the instaler at Install macOS Sierra.app.  Exiting. (1)

Any thoughts?

virtualize installed copy

I had a friend run the installed copy of windows inside a VM from linux running on the same machine. I see some value in this. Have you tried this and if so it might be nice to provide an example.

Fails if multiple disks are already attached

  • Original error was:
$ ./prepare-iso.sh 
hdiutil: detach: only a single device name can be specified
Usage:	hdiutil detach [options] <devname>
	hdiutil detach -help

Mount the installer image
-----------------------------------------------------------
$ hdiutil attach /Applications/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil: attach failed - Resource busy
Failed to mount the InstallESD.dmg from the instaler at Install macOS Sierra.app.  Exiting. (1)
  • Found line that was attempting to call hdiutil detach, and ran all but the command to determine what arguments were being sent in:
$ hdiutil info | grep /dev/disk | grep partition | cut -f 1
  • The output from this was:
/dev/disk1
/dev/disk2

... which explains why the error complained that "only a single device name can be specified".

  • This was resolved by manually detaching each disk separately using the following commands, but just wanted to mention this in case there was a way you could iterate the results and call it for each line (not familiar enough with xargs to suggest a resolution).
$ hdiutil detach -force /dev/disk1
$ hdiutil detach -force /dev/disk2

macOS Sierra 10.12.4 Failed to mount the InstallESD.dmg

Downloaded 2017-04-28 macOS Sierra:

vit:tmp vitaly$ ./prepare-iso.sh
hdiutil: detach: only a single device name can be specified
Usage:	hdiutil detach [options] <devname>
	hdiutil detach -help

Mount the installer image
-----------------------------------------------------------
$ hdiutil attach /Applications/Install macOS Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil: attach failed - Resource busy
Failed to mount the InstallESD.dmg from the instaler at Install macOS Sierra.app.  Exiting. (1)

Just in case:

vit:tmp vitaly$ cat /Applications/Install\ macOS\ Sierra.app/Contents/version.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>BuildVersion</key>
	<string>55</string>
	<key>CFBundleShortVersionString</key>
	<string>12.4.06</string>
	<key>CFBundleVersion</key>
	<string>12406</string>
	<key>ProjectName</key>
	<string>InstallAssistant</string>
	<key>SourceVersion</key>
	<string>842012000000000</string>
</dict>
</plist>

MacOS 10.14: Did not boot until I selected 2 CPU

During first boot from iso, boot always stopped at a certain time "Dawin bootstrap 6.0.0....".
After changing number of processors from 1 to 2, boot continued. Don't know if this is only an issue for my Macbook Air 2014 (MacBookAir6,2).

hdiutil command does not exist on Fedora 27

I am trying to install macOSSierra on my Fedora 27 machine, but hdiutil does not exist.
Do you have a solution for it?

$ ./prepare-iso.sh 
./prepare-iso.sh: line 143: hdiutil: command not found
xargs: hdiutil: No such file or directory
Could not find installer for Yosemite (10.10), El Capitan (10.11) or Sierra (10.12).
$ uname -a
Linux auris.stone 4.16.7-200.fc27.x86_64 #1 SMP Wed May 2 20:33:31 UTC 2018 x86_64 x86_64 
$ cat /etc/redhat-release 
Fedora release 27 (Twenty Seven)
$ 


"asr: Couldn't personalize volume" on Mojave

I kept running into this issue with Install macOS Mojave.app when the prepare-iso.sh script would get to the asr restore command:

	Validating target...done
	Validating source...done
	Retrieving scan information...done
	Validating sizes...done
	Restoring  ....10....20....30....40....50....60....70....80....90....100
	Restored target device is /dev/disk4s2.
	Remounting target volume...done
Personalization succeeded
asr: Couldn't personalize volume /Volumes/macOS Base System

Oddly enough, though, it appears the "Personalization succeeded," but this emits a non-zero status, so the script dies right here.

I decided to see if I could manually run the commands that followed to see what would happen, and sure enough, everything succeeds, but there was one other thing I needed to change.

I needed to replace:

/Volumes/OS\ X\ Base\ System

with:

/Volumes/macOS\ Base\ System

For Mojave, it appears that, when the asr restore command mounts the volume for the base system, it uses the name "macOS Base System" instead of the older "OS X Base System."

Setup documentation terminology

The readme.md specifies using the dropdown to select macOS Sierra, if your version of VirtualBox has been updated to include it

on 5.1.22 the latest selection is El Capitan, leading me to use Mac OS X (64 bit) - is there a beta version somewhere or was this said to "future-proof" the documentation? Is there any problem using this generic selection of Mac OS X (64 bit) for all installations? Does anyone know is a difference in specifying the exact version?

Thanks 😄

Hangs during initial boot - Yosemite and VB 5.2.4 on Linux

This looks like excellent work! Thank you. I used my mac to download Yosemite, then your script to create an ISO then moved it to my Linux Box and tried to create the VM. Everything worked like it should, including setting the CPU parameters. However, when I try to boot for the first time, this is where it hangs. Should this work on Linux?
yosemite_vm

VMBox can't boot

After selecting the installation drive, I start the VM and it stucks at:

root device uuid is ''
End InitBootStruct
Start LoadRAMDisk
End LoadRAMDisk
Start FinalizeBootStruct
Start RandomSeed
End RandomSeed

And the log is like this:

00:00:08.478039 GUI: 2D video acceleration is disabled
00:00:08.478049 GUI: HID LEDs sync is not supported on this platform
00:00:08.487998 GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=0, Machine-state=5
00:00:08.559437 EFI: Adding variable 8be4df61-93ca-11d2-aa0d-00e098032b8c::'BootCurrent' fAttrib=0x6 cbValue=0x2
00:00:08.560164 EFI: Adding variable 4c19049f-4137-4dd3-9c10-8b97a83ffdfa::'MemoryTypeInformation' fAttrib=0x3 cbValue=0x40
00:00:08.633646 EFI: VBoxDbg> loadimage64 'boot.efi' 0xdadc5000 LB 0x8e000
00:00:08.634286 EFI: Adding variable 4d1ede05-38c7-4a6a-9cc6-4bcca8b38c14::'ROM' fAttrib=0x6 cbValue=0x6
00:00:08.634960 EFI: Adding variable 4d1ede05-38c7-4a6a-9cc6-4bcca8b38c14::'MLB' fAttrib=0x6 cbValue=0x142
00:00:12.325270 EFI: Adding variable 7c436110-ab2a-4bbb-a880-fe41995c9f82::'platform-uuid' fAttrib=0x7 cbValue=0x10
00:00:12.338061 IEM: wrmsr(0x8b,0x0`00000000) -> #GP(0)

My version is Version 5.2.34_Ubuntu r133883

Any Ideas? Thank you!

Nothing would boot for me until I set EFI/SMC vars

From https://www.maketecheasier.com/install-macos-virtualbox/:

VBoxManage setextradata "[name of vm]" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "[name of vm]" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "[name of vm]" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "[name of vm]" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "[name of vm]" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Neither Mojave nor High Sierra would boot until I set those values.

It doesn't work with Install macOS Mojave.app

Here is the log


~/Downloads/macos-virtualbox-vm$ ./prepare-iso.sh
"disk3" unmounted.
"disk3" ejected.
hdiutil: detach failed - No such file or directory

Mount the installer image

$ hdiutil attach /Applications/Install macOS Mojave.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
/dev/disk2 GUID_partition_scheme
/dev/disk2s1 EFI
/dev/disk2s2 Apple_HFS /Volumes/install_app

Create Mojave blank ISO image with a Single Partition - Apple Partition Map

$ hdiutil create -o /tmp/Mojave -size 8g -layout SPUD -fs HFS+J -type SPARSE
created: /tmp/Mojave.sparseimage

Mount the sparse bundle for package addition

$ hdiutil attach /tmp/Mojave.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
/dev/disk3 Apple_partition_scheme
/dev/disk3s1 Apple_partition_map
/dev/disk3s2 Apple_HFS /Volumes/install_build

Restore the Base System into the Mojave ISO image

$ asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
Validating target...done
Validating source...
Could not recognize "/Volumes/install_app/BaseSystem.dmg" as an image file
Could not validate source - Invalid argument

Remove Package link and replace with actual files

$ rm /Volumes/OS X Base System/System/Installation/Packages
rm: /Volumes/OS X Base System/System/Installation/Packages: No such file or directory
$ cp -rp /Volumes/install_app/Packages /Volumes/OS X Base System/System/Installation/
cp: /Volumes/OS X Base System/System/Installation: No such file or directory
cp: /Volumes/install_app/Packages: unable to copy extended attributes to /Volumes/OS X Base System/System/Installation: No such file or directory
cp: /Volumes/OS X Base System/System/Installation/Core.pkg: No such file or directory
cp: /Volumes/OS X Base System/System/Installation/EmbeddedOSFirmware.pkg: No such file or directory
cp: /Volumes/OS X Base System/System/Installation/FirmwareUpdate.pkg: No such file or directory
cp: /Volumes/OS X Base System/System/Installation/OSInstall.mpkg: No such file or directory
cp: /Volumes/OS X Base System/System/Installation/SecureBoot.pkg: No such file or directory
cp: utimes: /Volumes/OS X Base System/System/Installation: No such file or directory
cp: chown: /Volumes/OS X Base System/System/Installation: No such file or directory
cp: chmod: /Volumes/OS X Base System/System/Installation: No such file or directory
cp: chflags: /Volumes/OS X Base System/System/Installation: No such file or directory
cp: /Volumes/install_app/Packages: unable to copy ACL to /Volumes/OS X Base System/System/Installation: No such file or directory

Copy macOS Mojave installer dependencies

$ cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS X Base System/BaseSystem.chunklist
cp: /Volumes/install_app/BaseSystem.chunklist: No such file or directory
$ cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS X Base System/BaseSystem.dmg
cp: /Volumes/install_app/BaseSystem.dmg: No such file or directory

Unmount the installer image

$ hdiutil detach /Volumes/install_app
"disk2" unmounted.
"disk2" ejected.

Unmount the sparse bundle

$ hdiutil detach /Volumes/OS X Base System/
hdiutil: detach failed - No such file or directory

Resize the partition in the sparse bundle to remove any free space

$ hdiutil resize -size 221720b /tmp/Mojave.sparseimage
hdiutil: resize: failed. Resource temporarily unavailable (35)

Convert the Mojave sparse bundle to ISO/CD master

$ hdiutil convert /tmp/Mojave.sparseimage -format UDTO -o /tmp/Mojave
hdiutil: convert failed - Resource temporarily unavailable

Remove the sparse bundle

$ rm /tmp/Mojave.sparseimage

Rename the ISO and move it to the desktop

$ mv /tmp/Mojave.cdr /Users/jiangxin/Desktop/Mojave.iso
mv: rename /tmp/Mojave.cdr to /Users/jiangxin/Desktop/Mojave.iso: No such file or directory

add support for Big Sur

I have tested manually to create a virtualbox-based vm. and it works. The script does not accomodate for it.

May create PR to add it.

Unable to install High Sierra

Been trying to get an image of High Sierra running on my MacBook Pro running 12.13.3 a few days now.

First time I follwed the instructions in the README.md but always got this error.
screen shot 2018-09-12 at 11 06 44

I then tried what this ticket says #52 . But then I get instead of the above error it exists prematurely and restarts.
screen shot 2018-09-12 at 14 25 41
screen shot 2018-09-12 at 14 26 08

I have after this tried to follow the README again but get always get the second error now.

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.