share
Unix & LinuxProblem having 2 wifi interfaces on ubuntu 20.04
[+1] [1] A. Ocannaille
[2020-04-15 16:59:02]
[ ubuntu wifi usb ]
[ https://unix.stackexchange.com/questions/580274/problem-having-2-wifi-interfaces-on-ubuntu-20-04 ]

I bought this USB wifi dongle [1] and I tried to install it on my Kubuntu 20.04 (Kubuntu 18.04 LTS upgraded recently to 20.04)

$lsusb
...
Bus 005 Device 002: ID 0bda:8812 Realtek Semiconductor Corp. RTL8812AU 802.11a/b/g/n/ac 2T2R DB WLAN Adapter
...

I followed this french tutorial [2] that says that everything is in the repositories
So I installed rtl8812au-dkms package, it worked. Then I did sudo modprobe rtl8812au and it also worked.

But, using ifconfig and iwconfig still gives me the same result than before: my ethernet interface, my loopback interface and my PCI wifi interface. The GUI in Kubuntu does not add me any new interface.

So, as advised in the french tutorial, I followed instruction "in case if another method does not work", which is to compile the driver :

sudo apt-get install linux-headers-generic build-essential git
git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git
cd rtl8812AU_8821AU_linux
make
sudo make install
sudo modprobe rtl8812au

Everything again went fine, but still no new interface.

Have I done something wrong? have I missed something? Any help appreciated :-)

Make sure that modprobe doesn't fail and post output of dmesg after running it. - Arkadiusz Drabczyk
modprobe does fail now, saying "ERROR: could not insert 'rtl8812au': Device or resource busy". dmesg confirms that: "Error: Driver 'rtl8812au' is already registered, aborting..." - A. Ocannaille
@ArkadiuszDrabczyk have you got an other idea that may help me ? :-) - A. Ocannaille
I asked you to provide dmesg output when loading the driver for the first time - unload it with rmmod, load again with insmod ./rtl8812au.ko (not modprobe) and post output of dmesg. - Arkadiusz Drabczyk
@ArkadiuszDrabczyk I think you found something. There is a crash somewhere while calling insmod, but insmod still have $?=0. Here is the dmesg output - A. Ocannaille
There are similar problems reported on the Internet when Linux 5.x is used. What does uname -r show on your system? - Arkadiusz Drabczyk
uname -r gives 5.4.0-21-generic - A. Ocannaille
Try cloning this github.com/jskovjyskebankdk/rtl8812AU_8821AU_linux, then git checkout kernel-5.3, unload driver, build it, load it again. - Arkadiusz Drabczyk
Nice! It worked :) I now have my new wlan interface in ifconfig. It does now appear in the GUI for the network identification :-) Thank you a lot! If you want to summarise your answers in an answer, I could accept it :) Thank again. - A. Ocannaille
ok, I'm glad it works but it might not be the end of your problems - some people reported that even though they get wlan interface they cannot connect to the access point. Can you try it? - Arkadiusz Drabczyk
Yes, I did connect to my network without any trouble. The remaining thing can be : should I load/unload the driver mannually or is it saved automatically and will be done at startup ? - A. Ocannaille
It will not be loaded automatically, you have to load it on your own, see askubuntu.com/a/307375/386622. I'll convert my comments into an answer. - Arkadiusz Drabczyk
Thanks again :-) - A. Ocannaille
[+2] [2020-04-16 18:25:55] Arkadiusz Drabczyk [ACCEPTED]

OP is using Linux 5.4 and there are several similar bug reports [1] from Linux 5.x users. The solution is to use code from kernel-5.3 branch from this fork https://github.com/jskovjyskebankdk/rtl8812AU_8821AU_linux:

$ git clone github.com/jskovjyskebankdk/rtl8812AU_8821AU_linux && cd rtl8812AU_8821AU_linux
$ git checkout kernel-5.3

Unload previously loaded non-functioning rtl8812au:

$ sudo rmmod rtl8812au

Build a new driver and load it again:

$ make -j$(nproc)
$ sudo insmod ./rtl8812au.ko
[1] https://github.com/abperiasamy/rtl8812AU_8821AU_linux/issues/317

1