Ubuntu 19.04 Disco Dingo Driver Drama

April 19th, 2019

If you want, you can skip the background and debugging steps and jump to installing the Realtek 8812au driver or installing with DKMS.

Background

When I built this desktop, I made the mistake of buying a motherboard that didn't come with onboard Wi-Fi or Bluetooth. After a few days of using my phone as a Wi-Fi tether, I bought a cheap "EDUP" Wi-Fi dongle that has been, to put it nicely, inconsistent and occasionally a pain. It was not plug and play on Ubuntu and I had to download and build the Realtek driver to get it to work. Once I got it working with Ubuntu 18.04, it would sometimes fail to connect to the Internet on startup. On Ubuntu 18.10, I didn't notice that problem nearly as much and everything seemed to work nearly seamlessly.

However, with an update to Ubuntu 19.04, Disco Dingo, there is a kernel update, and upon rebooting my computer, I noticed that I had no Internet access at all.

After a bit of poking and prodding, I discovered that my old Realtek driver wasn't working on Linux 5.0. Luckily, someone much smarter than me did the hard work of updating the driver to work on the 5.0 kernel.

Debugging steps

First, I opened up the system settings to see that there was no mention of my Wi-Fi adapter anywhere.

No Wi-Fi adapter

My first debugging step was to make sure that my Wi-Fi dongle was being recognized by my computer, and then to make sure that the driver was still installed with DKMS, which should have installed an updated version of the driver automatically.

lsusb and dkms

Luckily, lsusb returned good news, and showed that my "Realtek Semiconductor Corp." dongle was indeed recognized.

However, dkms status was showing something strange that maybe I wouldn't have caught if it wasn't for the Nvidia drivers. There's a version of the Realtek driver available for the 4.18.0 kernel, but not for 5.0.0.

So, throwing things at this problem hoping that it sticks, I cd /usr/src into where the dkms modules live and attempt to rebuild the driver.

dkms bad build

The next step was to find the same driver that has been updated to work with this new Linux kernel. I had originally used the git repo at https://github.com/gnab/rtl8812au to install the driver the first time around, but unfortunately it had only been updated to kernel 4.15.

My next thought was to go poking around in the open issues to see if anyone else was having the same problem, and there I found it, a link to an updated fork at https://github.com/AstroDrabb/rtl8812au.

Installing the driver

This is the method for installing the driver without using DKMS. While I should've just used the DKMS process I ended up mistakenly doing this first.

git clone https://github.com/AstroDrabb/rtl8812au.git
cd rtl8812au/
make
sudo insmod 8812au.ko
sudo cp 8812au.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
sudo depmod

Cloning and making the driver

insmod and depmod

After running all of those commands, Wi-Fi devices appeared in my system settings and my computer automatically connected to the Internet.

Wi-Fi settings

Installing with DKMS

After installing and running dkms status again, I realized that I should've used DKMS to install the driver in the first place, so it would attempt to update as I continue to update my Ubuntu versions in the future.

I did a fresh clone of the repo and did the following:

git clone https://github.com/AstroDrabb/rtl8812au.git
# The below version number should actually be 4.2.3
sudo cp -r rtl8812au /usr/src/rtl8812au-4.2.2
sudo dkms add -m rtl8812au -v 4.2.2
sudo dkms build -m rtl8812au -v 4.2.2
sudo dkms install -m rtl8812au -v 4.2.2

DKMS setup steps

As the install notes show, my earlier installed version of the driver matches what I was trying to install with DKMS, and the driver was not replaced. However, if I run dkms status:

New DKMS status

The driver for 5.0.0 is now installed with a warning that the non-DKMS version is being used. Hopefully this won't cause problems with updates in the future.