Kernel-module-control plug does not work

Hi experts,

I’am using snapcraft to package kernel module binary as snap, then insmod kernel module via declaring kernel-module-control interface. But it always says “insmod: ERROR: could not insert module test_module.ko: Operation not permitted”.

Here is my snapcraft.yaml.

apps:
launch:
command: start.sh
plugs:
- kernel-module-control
- kernel-module-observe

parts:
test-mod:
plugin: dump
source-type: local
source: obj

$ snap connections
Interface Plug Slot Notes
kernel-module-control test-snap:kernel-module-control :kernel-module-control manual

$ test-snap.launch
insmod: ERROR: could not insert module test_module.ko: Operation not permitted

well, i doubt you could ismod outside the snap either … without using sudo … try

$ sudo test-snap.launch

:wink:

Thanks. It works. My stupid mistake!