Install Nvidia drivers without kernel modules (Secure Boot)

Hi all,
I am trying to install the Nvidia driver on VMs have Secure Boot

That’s means the kernel modules (those ko files) need to be signed.
I know I can pass in my private key to the run file to sign the kernel modules and enroll the keys to MOK. But this won’t quite work in my case:

  1. I don’t have access to the private key on my target VM
  2. I can’t enroll a new key to MOK on my target VM

I think my solution will be build and sign the kernel modules in a separate machine which will have the private key or signing infra available (I will make sure the kernel version match the target machine), and cache the signed ko file.

So on my target VM, I can pull the cached signed ko files directly. And then I can run the driver installer (version matched) to install everything else except for the kernel modules.

I think the the installer will use DKMS to build the modules by default, so I want to know if there is a way to disable that.

Any advice would be helpful!!