<p>I need to check if <code>dkms</code> is installed on my host, and if it is, I need to check that it's associated with a specific driver. This check is intended to happen from inside a privileged container in Kubernetes. The purpose is to facilitate system requirements check for some drivers or packages our product needs to work.</p>
<p>I tried to follow <a href="https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-breakout/docker-breakout-privilege-escalation" rel="nofollow noreferrer">this guide</a>, but I'm not getting anywhere. It assumes I'm using docker (our cluster uses podman) and also requires me to install packages on my host (nsenter), which I want to avoid. What am I missing?</p>
<p>How do I access dkms from a privileged container?</p>

Oren_C
<p>DKMS is supported by running the DKMS scripts inside a privileged container.</p>
<p>As given in the <a href="https://rancher.com/docs/os/v1.0/en/configuration/loading-kernel-modules/" rel="nofollow noreferrer">document</a>:</p>
<blockquote>
<p>To deploy containers that compiles DKMS modules, you will need to
ensure that you bind-mount /usr/src and /lib/modules.</p>
<p>To deploy containers that run any DKMS operations (i.e., modprobe),
you will need to ensure that you bind-mount /lib/modules</p>
</blockquote>
<p>By default, the /lib/modules folder is already available in the console deployed via RancherOS System Services, but not /usr/src. You will likely need to deploy your own container for compilation purposes.</p>
