My situation is similar to this post, however, none of the given solutions work for me.
I am also trying to load the wireguard module by
modprobe wireguard
but I get the error
modprobe: ERROR: could not insert 'wireguard': Operation not permitted
According to the post mentioned above, that has to do with secure boot. Unfortunately, this is a virtual server I do not have physical access to, so I cannot just go into UEFI and disable secure boot. Also, the accepted solution to do
echo 1 > /proc/sys/kernel/sysrq
echo x > /proc/sysrq-trigger
did not work, because I get permission denied (even as root).
I don't know how important that is to the situation, but before I got the current error I got this error
modprobe: FATAL: Module wireguard not found in directory /lib/modules/4.15.0
when trying to modprobe wireguard. So I checked and found out that not only the file /lib/modules/4.15.0/kernel/wireguard/wireguard.ko was missing. The whole directory /lib/modules/4.15.0/kernel wasn't present. However, there is another directory, /lib/modules/4.15.0-128-generic, which had everything including the wireguard.ko. So I just copied the directory kernel as well as the files modules.order and modules.builtin from /lib/modules/4.15.0-128-generic to /lib/modules/4.15.0. Now, modprobe is able to find the module, which leads to the problem explained above.
Does anyone have a hint on how I could proceed from here?
OS: Ubuntu 18.04 LTS