3

Problem

I had a Linksys WUSB 6300 dual-band USB WiFi adapter happily running on on my desktop PC with driver module 8812AU.

When I first got it to work I used the driver signing method to get it to work with Secure Boot. It worked fine with Kernel version 4.4.0-23-generic and later also with 4.4.0-24-generic where I resigned it after the update.

After the update to 4.4.0-28-generic resigning for some reason does not have the desired effect anymore and it does not seem to load the driver module 8812AU.

After updating to 4.4.0-38-generic the behavior remains the same.

The Additional Drivers tool now shows me this, so I am not sure if somehow the module files got messed up. I am pretty new to Ubuntu, so I wouldn't know how to tell. When it was still working it showed me this.

So in consequence the network adapter is not working and I am out of ideas what to check or do in order to get it back to work.

Details

lsusb shows me that the adapter is recognized as USB device:

Bus 002 Device 002: ID 13b1:003f Linksys WUSB6300 802.11a/b/g/n/ac Wireless Adapter [Realtek RTL8812AU]

sudo lshw -C network only shows me the Ethernet and the internal WiFi (it has a very similar name). It is an integrated WiFi adapter which is working poorly under Ubuntu and is thus not useful for me.

Note: 8821AE is the internal WiFi. I am trying to get 8812AU to run which is not listed here because it does not seem to be loaded.

*-network
   description: Ethernet interface
   product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:03:00.0
   logical name: enp3s0
   version: 11
   serial: 54:a0:50:d5:4b:0b
   size: 10Mbit/s
   capacity: 1Gbit/s
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168g-2_0.0.1 02/06/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
   resources: irq:42 ioport:e000(size=256) memory:f7d00000-f7d00fff memory:f0000000-f0003fff
*-network
   description: Wireless interface
   product: RTL8821AE 802.11ac PCIe Wireless Network Adapter
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:04:00.0
   logical name: wlp4s0
   version: 00
   serial: 54:27:1e:d6:91:8d
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
   configuration: broadcast=yes driver=rtl8821ae driverversion=4.4.0-22-generic firmware=N/A ip=192.168.0.20 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
   resources: irq:46 ioport:d000(size=256) memory:f7c00000-f7c03fff

Running rfkill list all shows that nothing seems to be blocked:

0: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no
1: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no

Any help would be greatly appreciated!

Many thanks.

mz1000
  • 73
  • I believe the correct driver for the USB is 8812au. What is the exact result of: sudo modprobe -r rtl8821ae and next: sudo modprobe 8812au ? Welcome to askubuntu. – chili555 Oct 02 '16 at 21:44
  • Oh. The 8812au dkms driver has a problem. DKMS builds a module for the prior kernel during the MAKE step, and it won't load in the current kernel (where it's supposed to). You can tell if you've got a kernel module load error at boot time. A modinfo 8812au will show vermagic as incorrect. A manual dkms remove/build/install works though. There's a problem in makefile, if memory serves me, and I haven't been able to fix it yet. Cheers, Al – heynnema Oct 02 '16 at 22:23
  • See my manual dkms fix it script below in an answer. Adjust the version number if you need to. Cheers, Al – heynnema Oct 02 '16 at 22:36
  • Don't feel bad the Additional Drivers screen kept changing around inexplicably on me too during same boot visits. After picking a Nvidia driver to install the entire section disappeared altogether. Someone here told me this was because I picked a PPA to install from shrugs. – WinEunuuchs2Unix Oct 02 '16 at 23:02
  • @mz1000 the short answer is that you need to install rtl8812au-dkms using Synaptic. Also read and download my fixit script so that after any kernel software update, you can fix that the driver broke again (until somebody fixes it). Cheers, Al – heynnema Oct 03 '16 at 15:23

3 Answers3

5

This package can be fixed by editing the dkms.conf files...

sudo -H gedit /usr/src/rtl8812au-4.3.8.12175.20140902+dfsg/dkms.conf

Then change line 4 from MAKE="'make' all" to MAKE="'make' all KVER=${kernelver}"

Save and exit the editor then do the same with:

sudo -H gedit /var/lib/dkms/rtl8812au/4.3.8.12175.20140902+dfsg/build/dkms.conf

As a similar problem was reported on Ubuntu Forums and my edits have worked for the last kernel update I got.

For your current kernel you should be able to:

dkms build rtl8812au/4.3.8.12175.20140902+dfsg -k $(uname -r)
dkms install rtl8812au/4.3.8.12175.20140902+dfsg -k $(uname -r)
Reboot
Jeremy31
  • 12,602
  • 10
  • 58
  • 114
  • Your dkms build and dkms install commands have an incorrect -k parameter. You have an older kernel listed. Should be 4.4.0-38-generic/x86_64. See my script for another way to get the correct kernel. Thanks for the potential fix! Cheers, Al – heynnema Oct 03 '16 at 22:31
  • I am sorry about that as I was also trying to put a fixed version on github. The poster must have posted lshw -c net results from the older kernel Thanks heynnema – Jeremy31 Oct 03 '16 at 23:03
3

Here is a quick script that I wrote to manually fix a broken rtl8812au-dkms driver issue that occurs after every kernel software update. Run the script with sudo after a kernel software update has occurred. The problem with this driver is that dkms builds it for the wrong kernel. It's a problem with dkms.conf, in the source code. I may have a permanent fix pending.

You can tell if you've got a kernel module load error in /var/log/syslog at boot time. In terminal, a modinfo 8812au will show vermagic as incorrect.

#!/bin/bash  
# save as ~/Desktop/fix_8812au.sh  
# in terminal: chmod +x ~/Desktop/fix_8812au.sh
# in terminal, run with: sudo ~/Desktop/fix_8812au.sh

cd /var/lib/dkms

# rtl8812au  

dkms remove rtl8812au/4.3.8.12175.20140902+dfsg -k "$(uname -r)/$(uname -p)"  
dkms build rtl8812au/4.3.8.12175.20140902+dfsg -k "$(uname -r)/$(uname -p)"  
dkms install rtl8812au/4.3.8.12175.20140902+dfsg -k "$(uname -r)/$(uname -p)"

Update: the user was also using an older version of the 8812au driver, so we installed the current version of rtl8812au-dkms from the repositories, and it all worked. The script will be required immediately after the next kernel software update.

Update #2: the proper fix (thanks @Jeremy31) for this bug is to edit these two files:

gksudo gedit /usr/src/rtl8812au-4.3.8.12175.20140902+dfsg/dkms.conf

gksudo gedit /var/lib/dkms/rtl8812au/4.3.8.12175.20140902+dfsg/build/dkms.conf

and replace MAKE="'make' all" with this line:

MAKE[0]="'make' all KVER=${kernelver}"
heynnema
  • 70,711
  • How is this related to the question? – Pilot6 Oct 02 '16 at 22:55
  • @Pilot6, see my comments, above. I couldn't post this script in a comment. It's a temporary workaround for a broken rtl8812au-dkms driver. I put it here for chili555's info. I'll edit it. – heynnema Oct 02 '16 at 22:57
  • The question is about SIGNING of kernel modules. – Pilot6 Oct 02 '16 at 22:58
  • @Pilot6, yes, signing, but actually, getting the 8812au driver to work again. – heynnema Oct 02 '16 at 23:00
  • @heynnema Seems like you are on the right track. In the syslog I see the message: 8812au: disagrees about version of symbol module_layout. modinfo gives me this. Should I change the version in your script to 4.2.2_7502.20130517? Above you mentioned I should use Synaptic to install the driver. How to do that? – mz1000 Oct 03 '16 at 20:01
  • @mz1000 Your paste.ubuntu.com lead to a blank page. Did you get the URL correct? I'm sure that it said vermagic was for an old kernel, not the one that you're running now. Also, also your version number is lower than mine (the one in the Ubuntu repositories), the date on yours is 2013, and mine is 2014. Hum. If I had to, I'd recommend using the one from the repositories, as I don't know where you got your version from. But yes, if you decide to use what you've got, you'll have to update the script with the correct version numbers. Cheers, Al – heynnema Oct 03 '16 at 20:08
  • @mz1000 to use Synaptic to load the newer driver, start Synaptic, click the RELOAD icon, then SEARCH icon, enter rtl8812au-dkms, mark it for install, click APPLY icon. Cheers, Al – heynnema Oct 03 '16 at 20:11
  • @mz1000 remember that my script is only required 1) if the kernel gets updated during a software update, and 2) if nobody comes up with a fix for the bug in the driver (I may have a fix pending). Cheers, Al – heynnema Oct 03 '16 at 20:15
  • @mz1000 and oh, you'll want to dkms remove your older driver, else you'll get two of them trying to load. Just use the single command from my script as an example, and using sudo dkms remove and changing the version number. You'll also need to sudo rmmod 8814au to unload the older driver from the kernel. Cheers, Al – heynnema Oct 03 '16 at 20:26
  • @heynnema Thanks a lot for all your suggestions. I used Synaptic to install the newer driver version and it worked. Even without running your script. I didn't remove the previous module version, should I clean up now or leave it because it is working now? I am wondering why I was stuck on the old version and why apt-get upgrade didn't give me the newer version. – mz1000 Oct 03 '16 at 20:34
  • @heynnema Your comments solved my problem because I could install the newer driver version with Synaptic. I would like to appreciate your help by marking it as accepted. But I am not sure because the solution that worked for me is actually not mentioned in the answer (I am new to askubuntu). What do you recommend? – mz1000 Oct 03 '16 at 20:38
  • @mz1000 you'll only need the script if they update the kernel in future software updates. You don't need the rmmod command if installing the new version overwrote it, and it's working. A reboot would tell for sure. You do need to cleanup the old driver... in terminal, type dkms status, and if you see the old version listed, we should sudo dkms remove it (and then you may have to reinstall the new one again). Go ahead and vote/accept the answer, as the comments support what it says well enough. Cheers, Al – heynnema Oct 03 '16 at 21:04
  • @mz1000 I did a minor edit to my answer. Cheers, Al – heynnema Oct 03 '16 at 21:52
  • @heynnema I got a new kernel version and I am trying to get the WiFi back to run with your script. I successfully removed the module from dkms and built it again. But when installing I get already installed on kernel ... dkms status shows the module with WARNING! Diff between built and installed module! Do you have any hint to get it back to work? – mz1000 Oct 15 '16 at 13:06
  • Use the sudo rmmod 8812au to remove the old module currently installed in the kernel, then you can use the entire script, or just the dkms install part of it. Let me know how you do. Cheers, Al – heynnema Oct 15 '16 at 15:36
  • @heyennema No luck so far. It says: rmmod: ERROR: Module 8812au is not currently loaded – mz1000 Oct 15 '16 at 16:22
  • Do modinfo 8812au and make sure the version number displayed in filename equals the version number displayed in vermagic. If so, do sudo modprobe 8812au. Cheers, Al – heynnema Oct 15 '16 at 16:34
  • modinfo 8812au shows filename: /lib/modules/4.4.0-43-generic/updates/dkms/8812au.ko and vermagic: 4.4.0-38-generic SMP mod_unload modversions, so the versions do not match. – mz1000 Oct 15 '16 at 16:41
  • That's wrong. Those two fields should have similar 4.4.0-xx version numbers. Did you execute my script entirely, or do one command at a time? Did you copy/paste, or manually type in the commands? Try the entire script. Check the vermagic field when it's done. Also, check my updated answer for a permanent fix so you won't have to deal with this in the future. Cheers, Al – heynnema Oct 15 '16 at 16:49
  • The first time I copy pasted the commands one by one. To make sure 100% I now ran it as a script (without any modifications). I also modified both conf files according to the description. Unfortunately all results remained the same. – mz1000 Oct 15 '16 at 17:22
  • @heynnema For those of us that don't have the rtl drivers it would have been interesting if you could have shown the MAKE line before it is changed. – WinEunuuchs2Unix Oct 15 '16 at 17:22
  • @WinEunuuchs2Unix your wish is my command :-) Cheers, Al – heynnema Oct 15 '16 at 17:27
  • Are you using sudo with the script? Also, make sure to use @heynnema in your comment replies, otherwise I may not see them. Easiest then to use Synaptic to do a "complete removal" of rtl8812au-dkms, and then reinstall it. You'll have to edit those two files again so that the next kernel update will go without this problem. Let me know how you do. Cheers, Al – heynnema Oct 15 '16 at 17:39
  • @heynnema I did as you suggested without success. And yes, I used sudo with the script. I noticed a few things, maybe it helps somehow: After complete removal with Synaptic dkms status does not show anything related to 8812au, but modinfo 8812au still shows the same as before and sudo rmmod 8812au also still shows the same as before. Another thing I noticed: When the script calls dkms remove ... there is a message displayed saying: rmdir: failed to remove '': No such file or directory. Full script output. – mz1000 Oct 15 '16 at 18:24
  • Manually delete the driver with sudo rm /lib/modules/4.4.0-43-generic/updates/dkms/8812au.ko (change the 4.4.0-43 if you have a different current version). sudo rmmod 8812au should show no such module loaded. dkms status should show no 8812au installed. Now reinstall r8812au-dkms, and at this point your wireless should be working. If not, first do a modinfo 8812au and reverify vermagic. If it's ok, the sudo modprobe 8812au. Then, finally edit the two dkms.conf files. You won't need my script this time, or in the future. Let me know. Cheers, Al – heynnema Oct 15 '16 at 19:23
  • @heynnema That did the trick, after manually removing the file and re-installing everything works again. Super, THX!! – mz1000 Oct 15 '16 at 19:40
0

I preach you should use kernel modules that are fully signed and compiled to the right version... then I sin and force a module in that I can't figure out how to sign (I'm security-challenged). Indeed before learning dkms I think I must have digressed and forced the wrong kernel version in before (but hey it still worked!).

You might find yourself in the same situation. Anyway using modprobe you can install an unsigned kernel module by adding these parameters:

-f, --force                 Force module insertion or removal.
                            implies --force-modversions and
                            --force-vermagic
    --force-modversion      Ignore module's version
    --force-vermagic        Ignore module's version magic

Of course I preach you should never do this, but then again....

  • for shame, giggle. Force loading a bad module. See my comments above about the defective 8812au driver... and learn some dkms... it's not hard, really. Cheers, Al – heynnema Oct 02 '16 at 23:06
  • Haha I clearly stated never force a kernel module before I said how to do it. FTR I learned dkms for EnhanceIO (HDD to SSD disk caching software) 2 years ago in that scenario forcing an incompatible kernel version in would be disastrous, unlike forcing an internet connection in. As it were using Intel RST and EnhanceIO to accelerate the same HDD (two partitions) to the same mSata SSD (two cache volumes) turned out to be a bad idea after 18 months... Hello bricked windows HDD :( – WinEunuuchs2Unix Oct 02 '16 at 23:14
  • Thanks for your answer, but I'll avoid the force for now ;-) – mz1000 Oct 03 '16 at 20:10
  • May the force be with you :) – WinEunuuchs2Unix Oct 03 '16 at 21:40