How To Resolve The Installation Failed Error When Install VirtualBox On Mac

When I install VirtualBox on macOS, I meet an error message like this The installation failed. The installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. I struggled for some time and finally find the solution to fix it. Now let me tell you.

1. How To Enable VirtualBox To Be Installed On macOS.

  1. To fix this issue is not hard, you just need to follow the below steps.
  2. Click the Apple menu (  ) at the top left menu bar.
  3. Then click the System Preferences menu item in the popup menu lists.
  4. Click Security & Privacy icon, then click the General tab.
  5. You can see there is a message ( System software from developer “Oracle America, Inc.” was blocked from loading ) is displayed at the bottom of the window.
  6. Click the Allow button to make the message disappear, now install the VirtualBox again, it will be successful.
    macos-system-preferences-security-privacy-general-allow-oracle-inc-software-virtualbox-

2. Install MacOS Application From Both App Store & Identified Developers.

  1. By default, your macOS only allow installing macOS app from App Store.
  2. But you have the choice to install the macOS app from identified developers, please follow the below steps.
  3. Open Security & Privacy window as described in section 1.
  4. Click the little lock icon at the window bottom-left corner to unlock the settings, you need to provide the administrator password.
  5. Select App Store and identified developers radio button in the section Allow apps downloaded from.
  6. Click the little lock to save the changes.
  7. Now you can install macOS apps downloaded from both App Store & identified developers.

3. Question & Answer.

3.1  Failed To Install VirtualBox On Catalina.

  1. I just reinstalled Catalina on my MacBook pro. And when I install the VirtualBox, it pops up a dialog that said “The installation failed. The installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
  2. So I open the VirtualBox installation log file in the path /var/log/install.log and get the below log data. Can anyone give me some help? Thanks.
    Nov 29 15:16:36 jerry-macbook installd[519]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 “An error occurred while running scripts from the package “VirtualBox.pkg”.” UserInfo={NSFilePath=./postflight, NSURL=file://localhost/Volumes/VirtualBox/VirtualBox.pkg#VBoxKEXTs.pkg, PKInstallPackageIdentifier=org.virtualbox.pkg.vboxkexts, NSLocalizedDescription=An error occurred while running scripts from the package “VirtualBox.pkg”.} {
    NSFilePath = “./postflight”;
    NSLocalizedDescription = “An error occurred while running scripts from the package U201cVirtualBox.pkgU201d.”;
    NSURL = “file://localhost/Volumes/VirtualBox/VirtualBox.pkg#VBoxKEXTs.pkg”;
    PKInstallPackageIdentifier = “org.virtualbox.pkg.vboxkexts”;
    }
  3. Do you check whether the VirtualBox you installed has been blocked by the macOS system or not? You can follow this article to check the System Preferences —> Security & Privacy —> General tab. You can follow the below steps to install the VirtualBox again.
    1. Download the latest version of VirtualBox.
    2. Click the downloaded dmg to run it, then it will mount a device.
    3. Click the .pkg file to install VirtualBox, if this is the first time you install it, it will fail when it comes to the validation wizard.
    4. Close the VirtualBox installer and click the file uninstaller.tool to uninstall the installed VirtualBox.
    5. Remain the mounted installer device, do not remove it.
    6. Now you can go to the System Preferences —> Security & Privacy —> General tab to allow to install the blocked VirtualBox from ‘Oracle America’.
    7. Now run the VirtualBox installer again, it will install it correctly.

3.2 Answer To The comments-95247

  1. The macOS that is newer than High Sierra has a gatekeeper feature. This feature will block any apps that do not sign with the mac identified developer id.
  2. So if you meet such an error when installing VirtualBox, you can go to the System Preferences —> Security & Privacy —> General to see whether macOS block the VirtualBox installation or not.
  3. If you see an Allow button, that means macOS has blocked the VirtualBox installation, you can click the Allow button to install it.
  4. If you do not see anything, you can first run the command sudo spctl –master-disable in the terminal, this will allow you to install VirtualBox which is developed without an identified developer id.
  5. This will also add a radio choice Anywhere in the System Preferences —> Security & Privacy —> General tab, now the macOS will allow installing apps downloaded from anywhere.
  6. Then you should uninstall VirtualBox entirely to make sure no VirtualBox installation files are left on your macOS, and eject the mounted VirtualBox image.
  7. Download the newest version of the VirtualBox installer and install it. Now the error will disappear.
  8. After that, if you want to make your mac safer, you had better run the command sudo spctl –master-enable to enable the gatekeeper.

References

  1. How To Install Programs From Unidentified Developers In Mac OS

3 thoughts on “How To Resolve The Installation Failed Error When Install VirtualBox On Mac”

  1. I install VirtualBox on my iMac, but it failed at the end. The log file shows the below error. Then I uninstall the VirtualBox with the uninstall.tool which exist in the VirtualBox package and reinstall it, but the error still exist. How can I fix it.

    Jun 03 06:29:26 MyiMac installd[61695]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 “An error occurred while running scripts from the package “VirtualBox.pkg”.” UserInfo=0x7f90d0471f40 {NSFilePath=./postflight, NSURL=file://localhost/Volumes/VirtualBox/VirtualBox.pkg#VBoxKEXTs.pkg, PKInstallPackageIdentifier=org.virtualbox.pkg.vboxkexts, NSLocalizedDescription=An error occurred while running scripts from the package “VirtualBox.pkg”.} {
       NSFilePath = “./postflight”;
       NSLocalizedDescription = “An error occurred while running scripts from the package \U201cVirtualBox.pkg\U201d.”;
       NSURL = “file://localhost/Volumes/VirtualBox/VirtualBox.pkg#VBoxKEXTs.pkg”;
       PKInstallPackageIdentifier = “org.virtualbox.pkg.vboxkexts”;
    }

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Clicky