August 15, 2014

Unattended Deployment of Virtualbox

At first, the unattended deployment of VirtualBox might sound quite complicated, because the installer needs to set up drivers and do quite a bit of complicated stuff. Additionally, the installer of VirtualBox offered on the website is an EXE file and not a convenient MSI file.

But overall, it is quite simple to do an unattended installation of virtualbox. With a little bit of googling you can find this excellent guide on the VirtualBox website. Then, the steps are simple:

  1. Download the latest version from the VirtualBox website.
  2. Fortunately, the EXE file is just a wrapper for a MSI. Just run:
    VirtualBox.exe -extract
    (adjust the filename as needed). After a short time, a dialog box will tell you where the MSIs (for x64 and x86) has been extracted to.
  3. Now comes the tricky part. VirtualBox will install some drivers that are signed with a certificate that Windows does not trust by default. Thus, a prompt will apear during the installation. The trick is to import the certificates into the certificate store before installation:
    1. Install VirtualBox on your computer. When a driver prompt appears, be sure to check the box "Always trust Content" and click "Install".
    2. After the installation has finished, start
      certmgr.msc
      and navigate to "Trusted Publishers". Export every certificate that has "Oracle" or "Sun" in its name to a path of your choice.
    3. Distribute the exported certificates with the MSI files from above.
  4. For the installation, run the following command for each of the certificates you have exported above:
    certutil -addstore "TrustedPublisher" oracle.cer
  5. Then, run the installation like a normal MSI:
    msiexec /i Virtualbox.msi /passive

In my case, I created a small batch file that installed the certificates and then imported it into MDT. Works like a charm!

Powered by Hugo & Kiss.