Skip to content

Driver Signing Certificate

Sorecchione07435 edited this page Nov 8, 2026 · 2 revisions

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.

1. Create a Test Certificate

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 = MyVirtualBoxCert

The 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.

2. Export the Public Certificate

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.

3. Configure the Build Environment

Make sure the following variables are configured in LocalConfig.kmk:

VBOX_SIGNING_MODE = test
VBOX_CERTIFICATE_SUBJECT_NAME = MyVirtualBoxCert

The build process uses the configured certificate to sign the generated drivers automatically.

No additional manual signing operation is required after compilation.

4. Trust the Certificate on the Test Machine

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.

5. Enable Windows Test Signing

Windows must be configured to allow test-signed kernel-mode drivers.

Open Command Prompt as Administrator and execute:

bcdedit /set TESTSIGNING ON

Restart 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.

6. Automatic Driver Signing During Compilation

Once the certificate and build configuration are correctly configured, the project handles driver signing as part of its build process.

The workflow is:

  1. Create the test certificate.
  2. Configure the certificate subject in LocalConfig.kmk.
  3. Start the VirtualBox build.
  4. The build scripts automatically sign the generated drivers.
  5. Install the public certificate and configure the test machine.
  6. 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.

Clone this wiki locally