How to show loaded kernel modules inside OpenVZ virtual server

5,953

Solution 1

As far as I understand, OpenVZ guests share the host's kernel and all loaded modules. Guests and are not allowed to load modules into the host's kernel, consequently lsmod shows an empty list. Apparently it is not possible to show what modules are loaded into the host's kernel, without access to the host.

Solution 2

The list is also in /proc/modules but I think this is unavailable inside an openVZ container (in fact, I'd guess that's where lsmod gets its info, which is why it has none).

Keep in mind that even if you find a way to list loaded modules, just because inotify is not listed does not mean it was not built into the kernel. Put another way, listing loaded modules may not be very helpful if you do not know how the kernel is configured to start with, as a lot of things you may associate with a module can be configured in.

You are perhaps better off looking for a way to determine how to tell if inotify specifically is loaded.

Solution 3

If the guest kernel is configured to have /proc/config.gz you could use that to find out the configuration options for the currently running kernel (edit: and thus find out if inotify is enabled or not). However I do not know if that will work for you.

Solution 4

Kernel modules can not be loaded in the guest VM's (VE's), consequently you can't list what modules are loaded in the host either. You have to load them in the host node (HN).

Share:
5,953

Related videos on Youtube

Hurrdurrfurr
Author by

Hurrdurrfurr

Updated on September 18, 2022

Comments

  • Hurrdurrfurr
    Hurrdurrfurr over 1 year

    I am trying to find out what kernel modules are loaded inside a OpenVZ virtual server. Command lsmod is empty and I believe the reason is the way how OpenVZ's virtualisation is working.

    Specifically, I like to know if the inotify module is loaded.

    I have only access to the guest system.

  • Hurrdurrfurr
    Hurrdurrfurr over 10 years
    Thanks for your answer. I didn't think of that it might be built into the kernel. I can work with this answer, however I cannot mark it because it's not the answer to this exact question. But thank you!
  • Hurrdurrfurr
    Hurrdurrfurr over 10 years
    Thank you for your answer. File /proc/config.gz does not exist.