0

When I run sudo wg-quick up /etc/wireguard/wg0.conf, I see the following error:

Error: Unknown device type

When I run modprobe wireguard:

modprobe: FATAL: Module wireguard not found in directory /lib/modules/5.3.0-51-generic

When I run sudo find / -iname *wireguard.ko*:

/var/lib/dkms/wireguard/1.0.20201112/4.15.0-204-generic/x86_64/module/wireguard.ko

So it looks like wireguard is installed in 4.15.0 but modprobe is looking for it in 5.3.0-51.

What is the solution in this case?

1 Answers1

0

I'm unable to recreate the problem on a fresh fully updated copy of 18.04LTS. I suspect you have installed multiple different kernel versions and do not currently have the correct kernel module for the kernel you are booting into.

Wireguard uses DKMS to allow building of a kernel module to fit the kernel you are using but this requires the kernel headers to be installed. There are other posts on module problems with Wireguard that may be worth reviewing: Wireguard fails to build module even tho kernel headers are installed?

The default kernel for 18.04 seems to be 4.15.0 based on my fresh install but there are also 5.x.x kernels available in the standard repos. Check which kernel you're running currently:

uname -a

You can see what kernel versions you have installed with:

dpkg -l | grep linux-

If you're running a 5.x.x kernel, ensure the kernel headers and module packages are installed matching the kernel that you want to use. You could also try downgrading to 4.x.x kernel (this option may be available in grub): How can I boot with an older kernel version?

moo
  • 878