It is always interesting to me, how few WiFi devices seem to work with Ubuntu out of the box, yet so many are supposedly supported. Don’t get me wrong, I’m not knocking Ubuntu, it is just that I typically purchase WiFi cards or USB sticks that are listed as supported, only to find that they don’t work when you plug them in. Today was no exception. The interesting part is that I didn’t specifically purchase this WiFi USB stick, but that it came with another device from Cerevo.
I actually bought a new Cerevo LiveShell X to help out at the church I attend. We plan to use it for live streaming, and the unit can take Ethernet, or this WiFi dongle. We are using the Ethernet, so I decided to use the USB WiFi stick on something else. As it turns out, this WiFi USB stick is available for sale independently (Not an affiliate link) :
But, back to the problem at hand. When I decided to repurpose it, I checked to see if it would work with Linux, and if not, there are some other Windows machines that it could be put in. It was supported in Ubuntu, through the repository, so it looked like a good candidate for a Ubuntu Linux machine we use.
Of course, it should just be as easy as downloading the right repository. When I pulled up lsusb, here’s what I saw:
Bus 002 Device 025: ID 0bda:0811 Realtek Semiconductor Corp.
A quick search revealed that I could simply install the drivers from the Ubuntu repository, like this:
sudo apt-get install rtl8812au-dkms
But unfortunately, it didn’t work when I tried it. It didn’t recognize it as a supported device, and so I had to do a little more research. A quick perusal of AskUbuntu lead me to a great post where yuikleb pointed out the git repositories you should download when using the 5.x kernels with this device.
alaskalinuxuser@alaskalinuxuser-X9DBL-3F-X9DBL-iF:~/installed$ git clone https://github.com/gnab/rtl8812au.git
Cloning into 'rtl8812au'...
remote: Enumerating objects: 851, done.
remote: Counting objects: 100% (42/42), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 851 (delta 15), reused 13 (delta 6), pack-reused 809
Receiving objects: 100% (851/851), 1.98 MiB | 2.27 MiB/s, done.
Resolving deltas: 100% (374/374), done.
Then it was just a matter of entering the directory and building from the source material:
alaskalinuxuser@alaskalinuxuser-X9DBL-3F-X9DBL-iF:~/installed/rtl8812au$ make
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/5.4.0-67-generic/build M=/home/alaskalinuxuser/installed/rtl8812au modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-67-generic'
CC [M] /home/alaskalinuxuser/installed/rtl8812au/core/rtw_cmd.o
<<<EDITED FOR SPACE>>>
LD [M] /home/alaskalinuxuser/installed/rtl8812au/8812au.o
Building modules, stage 2.
MODPOST 1 modules
CC [M] /home/alaskalinuxuser/installed/rtl8812au/8812au.mod.o
LD [M] /home/alaskalinuxuser/installed/rtl8812au/8812au.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-67-generic'
And a quick test, as he suggested proved it worked great, so I installed it:
alaskalinuxuser@alaskalinuxuser-X9DBL-3F-X9DBL-iF:~/installed/rtl8812au$ sudo insmod 8812au.ko
alaskalinuxuser@alaskalinuxuser-X9DBL-3F-X9DBL-iF:~/installed/rtl8812au$ sudo cp 8812au.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
alaskalinuxuser@alaskalinuxuser-X9DBL-3F-X9DBL-iF:~/installed/rtl8812au$ sudo depmod
The only problem with his answer was that it would not be automatically built if you ever upgrade the kernel. So, I took a look at the makefile, and it specified that you could run make dkms_install under sudo to make that heppen, like this:
alaskalinuxuser@alaskalinuxuser-X9DBL-3F-X9DBL-iF:~/installed/rtl8812au$ sudo make dkms_install
[sudo] password for alaskalinuxuser:
mkdir -p /usr/src/8812au-4.2.3
cp -r * /usr/src/8812au-4.2.3
dkms add -m 8812au -v 4.2.3
Creating symlink /var/lib/dkms/8812au/4.2.3/source ->
/usr/src/8812au-4.2.3
DKMS: add completed.
dkms build -m 8812au -v 4.2.3
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
'make' all KVER=5.4.0-67-generic......................
cleaning build area...
DKMS: build completed.
dkms install -m 8812au -v 4.2.3
8812au:
Running module version sanity check.
Good news! Module version v4.2.3 for 8812au.ko
exactly matches what is already found in kernel 5.4.0-67-generic.
DKMS will not replace this module.
You may override by specifying --force.
depmod...
DKMS: install completed.
dkms status
8812au, 4.2.3, 5.4.0-67-generic, x86_64: installed (WARNING! Diff between built and installed module!)
virtualbox, 5.2.42, 5.4.0-67-generic, x86_64: installed
virtualbox, 5.2.42, 5.4.0-71-generic, x86_64: installed
virtualbox, 5.2.42, 5.4.0-72-generic, x86_64: installed
Of course if you already built it you will get the warning about not replacing a module unless you specify to –force it, and that there is a difference between the built and installed module. So I recommend you remove the old module if you are going to install it with dkms.
Overall, it wasn’t that hard to do, and the Linux support for this chip seems good. It just is cumbersome for the end user when a WiFi USB device doesn’t just work out of the box.
Linux – keep it simple.