joefitzgerald / packer-windows

Windows Packer Templates
MIT License
1.63k stars 1.12k forks source link

vbox additions certificate is expired #230

Closed rjhornsby closed 6 years ago

rjhornsby commented 7 years ago

The included vbox guest additions certificate is expired:

$ keytool -printcert -file oracle-cert.cer
Owner: CN=Oracle Corporation, OU=VirtualBox, OU=Digital ID Class 3 - Microsoft Software Validation v2, O=Oracle Corporation, L=Redwood Shores, ST=California, C=US
Issuer: CN=VeriSign Class 3 Code Signing 2010 CA, OU=Terms of use at https://www.verisign.com/rpa (c)10, OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US
Serial number: 51ca009816fdbd80f120e015ee75823e
Valid from: Sun Dec 22 18:00:00 CST 2013 until: Thu Dec 22 17:59:59 CST 2016
...

The certificate will still install in Windows, but causes the scripted vbox additions installation to fail silently.

Logged PR 229 with updated certificate.

nap commented 7 years ago

Replacing the virtualbox goto label definition with the following would also work. It would also effectively remove the need to maintain the certificate.

:virtualbox
move /Y C:\Users\vagrant\VBoxGuestAdditions.iso C:\Windows\Temp
cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd /c C:\Windows\Temp\virtualbox\cert\VBoxCertUtil add-trusted-publisher C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer --root C:\Windows\Temp\virtualbox\cert\vbox-sha1.cer
cmd /c C:\Windows\Temp\virtualbox\cert\VBoxCertUtil add-trusted-publisher C:\Windows\Temp\virtualbox\cert\vbox-sha256.cer --root C:\Windows\Temp\virtualbox\cert\vbox-sha256.cer
cmd /c C:\Windows\Temp\virtualbox\cert\VBoxCertUtil add-trusted-publisher C:\Windows\Temp\virtualbox\cert\vbox-sha256-r3.cer --root C:\Windows\Temp\virtualbox\cert\vbox-sha256-r3.cer
cmd /c C:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe /S
StefanScherer commented 6 years ago

Fixed with #247