Repository navigation
Driver Signing Certificate
The project automatically signs the generated Windows drivers during the build process.
You do not need to manually sign each driver. However, every developer must create and configure their own test-signing certificate before building the project.
Windows PowerShell includes the New-SelfSignedCertificate cmdlet, which can generate a self-signed certificate for code-signing purposes.
Open PowerShell and execute:
$cert = New-SelfSignedCertificate `
-Subject "CN=MyVirtualBoxCert" `
-Type CodeSigningCert `
-CertStoreLocation "Cert:\CurrentUser\My" `
-KeyAlgorithm RSA `
-KeyLength 2048 `
-HashAlgorithm SHA256 `
-NotAfter (Get-Date).AddYears(3)Tip
The certificate subject must match the value specified in VBOX_CERTIFICATE_SUBJECT_NAME in LocalConfig.kmk.
For this example:
VBOX_SIGNING_MODE = test
VBOX_CERTIFICATE_SUBJECT_NAME = MyVirtualBoxCertThe example creates the certificate in the current user's Personal certificate store. If the project's signing scripts expect a different certificate store, adjust the location accordingly.
Export the public portion of the certificate as a .cer file:
Export-Certificate -Cert $cert -FilePath "$env:USERPROFILE\Desktop\MyVirtualBoxCert.cer"The .cer file contains the public certificate and can be distributed to test machines.
Never distribute the private key. Keep it protected on the development machine. If you need a backup, export it separately as a password-protected .pfx file and store it securely.
Make sure the following variables are configured in LocalConfig.kmk:
VBOX_SIGNING_MODE = test
VBOX_CERTIFICATE_SUBJECT_NAME = MyVirtualBoxCertThe build process uses the configured certificate to sign the generated drivers automatically.
No additional manual signing operation is required after compilation.
Before installing the generated drivers, import the public .cer certificate into the appropriate Windows certificate stores.
For the standard Windows driver test-signing workflow, Microsoft documents installing the certificate into:
- Trusted Root Certification Authorities.
- Trusted Publishers.
These operations require administrator privileges.
Windows must be configured to allow test-signed kernel-mode drivers.
Open Command Prompt as Administrator and execute:
bcdedit /set TESTSIGNING ONRestart Windows for the change to take effect.
Warning
Secure Boot policy can prevent enabling this option. If Windows reports that the setting is protected by Secure Boot policy, consult the Microsoft documentation before changing the system's boot configuration.
Once the certificate and build configuration are correctly configured, the project handles driver signing as part of its build process.
The workflow is:
- Create the test certificate.
- Configure the certificate subject in
LocalConfig.kmk. - Start the VirtualBox build.
- The build scripts automatically sign the generated drivers.
- Install the public certificate and configure the test machine.
- Install and test the resulting drivers.
Security notice: Test certificates are intended for development and testing only. They do not provide the same trust guarantees as certificates issued through Microsoft's production driver-signing process.
See Microsoft's Test Signing documentation for additional information.