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

Catalina: /usr/sbin/diskutil failed with non-zero exit code: 1 #66

Open
gitpushdashf opened this issue Oct 21, 2020 · 3 comments
Open

Comments

@gitpushdashf
Copy link

Hi,

This is a really cool project. Trying it out on Catalina, using a Catalina image I made with macadmin-scripts (couldn't get the official download to work).

$ time sudo macinbox --box-format virtualbox --installer-dmg ~/repos/macadmin-scripts/Install_macOS_10.15.7-19H2.dmg
• Attaching installer disk image...
• Checking macOS versions...
• Creating image from installer...
  + Creating and attaching a new blank disk image...
  + Installing macOS...
    - installer: 100% done
  + Configuring the primary user account...
  + Configuring the 'vagrant' group...
  + Installing the default insecure vagrant ssh key...
  + Enabling password-less sudo...
  + Enabling sshd...
  + Enabling HiDPI resolutions...
  + Saving the image...
    - Error: /usr/sbin/diskutil failed with non-zero exit code: 1

• Cleaning up...

real    20m5.471s
user    2m21.039s
sys     1m31.510s

Might I have more luck with non-Virtualbox? Do you have any suggestions on what I can try next?

Thank you!

@bacongravy
Copy link
Owner

@gitpushdashf I’m sorry this isn’t working for you. Thanks for letting me know. Could you try rerunning the command with the verbose flag and seeing if you get more detail? I don’t think your choice of box format is the cause of this issue. Maybe you are low on disk space? Hopefully the verbose logging gives us a clue.

@vemv
Copy link

vemv commented Jan 31, 2021

I was consistently experiencing this exact same issue. Then I realised in the logs a reference to a volume image that was completely unrelated to macinbox (i.e. I had downloaded some software so I had /Volumes/foo.app mounted).

After unmounting this image, the issue was gone.

@vemv
Copy link

vemv commented Jan 31, 2021

What I said above wasn't an actual fix, it worked merely by chance.

Here's what worked though:

  • run in verbose mode
  • increase the retries from 5 to 100
    • this is simply for giving me time to debug things without having the process finish too soon
  • Execute exactly what macinbox was trying (/usr/sbin/diskutil eject /dev/disk5) in a new iTerm tab
    • Verify that indeed it will fail with Volume failed to eject
  • Now, perform /usr/sbin/diskutil unmountDisk /dev/disk5
    • This will fail with:
Unmount of disk5 failed: at least one volume could not be unmounted
Unmount was dissented by PID 135 (/Applications/<SomeAntivirus>.app)

So, using this debugging method I could become aware that an antivirus was interfering. So I can disable it, and start again.

Which worked!

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

3 participants