Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Mojave host, create boxes for previous macOS versions #40

Open
NikolausDemmel opened this issue Jun 16, 2019 · 4 comments
Open

On Mojave host, create boxes for previous macOS versions #40

NikolausDemmel opened this issue Jun 16, 2019 · 4 comments

Comments

@NikolausDemmel
Copy link

On a Mojave host, I can successfully create Mojave boxes, but it fails for older versions at different stages. Below are the errors I get for High Sierra and Sierra. Is this expected to work, or indeed working for anyone? I'd like to create VMs of older versions for running continuous integration on multiple macOS versions.

High Sierra:

sudo macinbox --box-format virtualbox --no-gui --name test-high-sierra --installer ~/macOSInstallers/Install\ macOS\ High\ Sierra.app/ --verbose
• Running command: /usr/bin/mktemp -d -t macinbox_root_temp
• Running command: /usr/bin/sudo -u cvai /usr/bin/mktemp -d -t macinbox_user_temp
• Checking macOS versions...
  + Error: InstallInfo.plist not found in installer app bundle

• Cleaning up...

Sierra:

sudo macinbox --box-format virtualbox --no-gui --name test-sierra --installer ~/macOSInstallers/Install\ macOS\ Sierra.app/ --verbose
• Running command: /usr/bin/mktemp -d -t macinbox_root_temp
• Running command: /usr/bin/sudo -u cvai /usr/bin/mktemp -d -t macinbox_user_temp
• Checking macOS versions...
  + Running command: /usr/libexec/PlistBuddy -c Print\ :System\\\ Image\\\ Info:version /Users/cvai/macOSInstallers/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallInfo.plist
  + Installer macOS version detected: 10.12.6
  + Running command: /usr/bin/sw_vers -productVersion
  + Host macOS version detected: 10.14.5
  + Warning: host OS version (10.14.5) and installer OS version (10.12.6) do not match
• Creating image from installer...
  + Running command: /usr/bin/mktemp -d -t create_image_from_installer
  + Running command: /usr/bin/stat -f \%d /
  + Running command: /usr/bin/stat -f \%d /Users/cvai/macOSInstallers/Install\ macOS\ Sierra.app
  + Creating and attaching wrapper disk image...
    - Running command: /usr/bin/hdiutil create -srcfolder /Users/cvai/macOSInstallers/Install\ macOS\ Sierra.app /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/wrapper.dmg
.............................................................................................................................................................
created: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/wrapper.dmg
    - Running command: /usr/bin/hdiutil attach /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/wrapper.dmg -nomount
    - Running command: /usr/bin/hdiutil attach /dev/disk4s1 -nobrowse
/dev/disk4s1        	41504653-0000-11AA-AA11-0030654	/Volumes/Install macOS Sierra
    - Running command: /usr/sbin/diskutil info /dev/disk4s1
  + Creating and attaching a new blank disk image...
    - Running command: /usr/bin/hdiutil create -size 64g -type SPARSE -fs APFS -volname Macintosh\ HD -uid 0 -gid 80 -mode 1775 /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/scratch.sparseimage
created: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/scratch.sparseimage
    - Running command: /usr/bin/hdiutil attach /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/scratch.sparseimage -nomount
    - Running command: /usr/bin/hdiutil attach /dev/disk6s1 -nobrowse -mountpoint /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/scratch_mountpoint -owners on
/dev/disk6s1        	41504653-0000-11AA-AA11-0030654	/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/scratch_mountpoint
  + Installing macOS...
    - Running command: /usr/bin/touch /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/scratch_mountpoint/.macinbox
    - installer: 0% done [|                                                                                                                                               ]    - Running command: /usr/sbin/installer -verboseR -dumplog -pkg /Volumes/Install\ macOS\ Sierra/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallInfo.plist -target /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/scratch_mountpoint
Jun 16 21:01:05  installer[35573] <Notice>: Hardware: Macmini8,1 @ 3.20 GHz (x 12), 65536 MB RAM
Jun 16 21:01:05  installer[35573] <Notice>: Running OS Build: Mac OS X 10.14.5 (18F132)
Jun 16 21:01:05  installer[35573] <Debug>: Env: TERM=xterm-256color
Jun 16 21:01:05  installer[35573] <Debug>: Env: SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.aJXc8HiJvs/Listeners
Jun 16 21:01:05  installer[35573] <Debug>: Env: __CF_USER_TEXT_ENCODING=0x0:0:0
Jun 16 21:01:05  installer[35573] <Debug>: Env: PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Jun 16 21:01:05  installer[35573] <Debug>: Env: HOME=/Users/cvai
Jun 16 21:01:05  installer[35573] <Debug>: Env: COLORFGBG=7;0
Jun 16 21:01:05  installer[35573] <Debug>: Env: LC_CTYPE=UTF-8
Jun 16 21:01:05  installer[35573] <Debug>: Env: COLORTERM=truecolor
Jun 16 21:01:05  installer[35573] <Debug>: Env: MAIL=/var/mail/root
Jun 16 21:01:05  installer[35573] <Debug>: Env: LOGNAME=root
Jun 16 21:01:05  installer[35573] <Debug>: Env: USER=root
Jun 16 21:01:05  installer[35573] <Debug>: Env: USERNAME=root
Jun 16 21:01:05  installer[35573] <Debug>: Env: SHELL=/bin/sh
Jun 16 21:01:05  installer[35573] <Debug>: Env: SUDO_COMMAND=/usr/local/bin/macinbox --box-format virtualbox --no-gui --name test-sierra --installer /Users/cvai/macOSInstallers/Install macOS Sierra.app/ --verbose
Jun 16 21:01:05  installer[35573] <Debug>: Env: SUDO_USER=cvai
Jun 16 21:01:05  installer[35573] <Debug>: Env: SUDO_UID=501
Jun 16 21:01:05  installer[35573] <Debug>: Env: SUDO_GID=20
Jun 16 21:01:05  installer[35573] <Debug>: Env: COMMAND_LINE_INSTALL=1
Jun 16 21:01:05  installer[35573] <Info>: Will not update firmware because we can't find the mutable product ((null))
Jun 16 21:01:05  installer[35573] <Notice>: Creating connection
Jun 16 21:01:05  installer[35573] <Notice>: Connection = 0x7f9936700f90, callers = (
	    "<IASUPCaller: 0x7f9936706920>"
	)
Jun 16 21:01:05  installer[35573] <Notice>: Registering the connection
Jun 16 21:01:05  installer[35573] <Notice>: client 0x7f99367007e0: phaseName = OS Installer 2
Jun 16 21:01:05  installer[35573] <Info>: Install will not be automated.
Jun 16 21:01:06  installer[35573] <Info>: Connected to daemon. Language set to: en_GB
Jun 16 21:01:06  installer[35573] <Info>: Install will be a InstallInfo.plist install.
Jun 16 21:01:06  installer[35573] <Error>: Installer Info install requested but we're not dmg booted
Jun 16 21:01:06  installer[35573] <Error>: InstallInfo.plist is missing payload dmg info
Jun 16 21:01:06  installer[35573] <Notice>: client 0x7f99367007e0: phaseName = OS Installer 2
Jun 16 21:01:06  installer[35573] <Notice>: Releasing Connection


• Cleaning up...
/Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/actions/create_image_from_installer.rb:112:in `write': No such file or directory @ rb_sysopen - /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/create_image_from_installer.sfZWP3dv/scratch_mountpoint/private/etc/rc.installer_cleanup (Errno::ENOENT)
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/actions/create_image_from_installer.rb:112:in `create_rc_vagrant'
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/actions/create_image_from_installer.rb:49:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:129:in `block (2 levels) in start'
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/logger.rb:17:in `info'
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:128:in `block in start'
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:122:in `chdir'
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:122:in `start'
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/lib/macinbox/cli.rb:19:in `run!'
	from /Library/Ruby/Gems/2.3.0/gems/macinbox-3.3.0/exe/macinbox:5:in `<top (required)>'
	from /usr/local/bin/macinbox:22:in `load'
	from /usr/local/bin/macinbox:22:in `<main>'
@bacongravy
Copy link
Owner

Hello, @NikolausDemmel, and thank you for this report. I (and others) have recently successfully created High Sierra VMs from Mojave. The error message you are getting suggests to me that your High Sierra installer app is corrupt (or incomplete). Likewise with the Sierra logs, it seems like the installer tool is exiting without installing anything because it can't find something that it is expecting to find.

I would consider trying to re-acquire the installer apps from a different source to see if that makes a difference. For instance, I've had success using this tool to download installer apps:

https://github.com/munki/macadmin-scripts/blob/master/installinstallmacos.py

You can use the --installer-dmg option with the images that that tool downloads.

@NikolausDemmel
Copy link
Author

Thanks for your reply. The installers were downloaded through the app store on another Mac that is still on a previous version of macos, not sure why they might be corrupted.

Just to clarify. Would I be using the final disk image they installinstallmacos.py creates, oder the installers that it downloads? The readme over there says that the resulting disk image is specific for the hardware where it was created, so if I run it on my macmini host, can the resulting installer disk image be used for a virtualbox VM that runs on that host? Or should I run the installinstallmacos.py script inside the Mojave vm that i successfully created?

@bacongravy
Copy link
Owner

One thing to look at is their size on disk; if they aren't ~6GB in size, they are missing pieces.

The issue that the README mentions of hardware-specific OS-installer-apps usually only comes up when you're using hardware that was released after the first version of the OS you're trying to install. The hardware I use to test is older than Sierra, so it may be that I haven't seen this issue for that reason.

Note that this issue could also apply when you aren't using the script, and are just manually downloading the installer app on one device, and moving it to another, as you said you have done.

If you run the installinstallmacos.py script on the macmini host, I would expect that the downloaded app installer images would install an OS that works in the VM. That's how it has worked for me and others.

@bacongravy
Copy link
Owner

So, to clarify, try using installinstallmacos.py to download/assemble the dmg on the host macmini, and then use the macinbox --installer-dmg option to use that dmg to create the Vagrant box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants