The simplest way to install DKMS module is to run the same kernel in template VM as in appVM. In this way the command should be straightforward (
sudo dkms autoinstall -k $(uname -r)) and the directory to install the DKMS module is auto inferred; otherwise
there are some tricks (involving creating the correctly named directory in you will not have the header directory structure and cannot compile the module IMHO.
/lib/module which is error prone)
modules.img is a ROM, containing module .ko’s and headers; /lib/modules are mostly overlay of the rom and the root fs (xvda). This technical details should be irrelevant as DKMS module should work out of box, given that the template VM uses the same kernel as appVM.
When you run the same kernel, this command will do everything for you.
sudo dkms autoinstall -k $(uname -r)