Linux Driver for USB WiFi Adapters that are based on the RTL8811AU and RTL8821AU Chipsets - v5.12.5.2
Linux Driver for USB WiFi Adapters that are based on the RTL8811AU and RTL8821AU Chipsets - v5.12.5.2
Notice: An updated standards compliant (mac80211), in-kernel driver for rtl8821/11au chipset based adapters and modules is available and as of kernel 6.14 is of good quality. If your distro uses kernel 6.14 or later, there is no need to install this driver. The in-kernel driver is part of the rtw88 series of drivers. The in-kernel driver is Linux Standards compliant (mac80211) and is a much better driver than this one. This driver will no longer get API related updates beyond kernel 6.14 (unless provided by a user). If you use a kernel prior to 6.14, it is possible to use the new standards compliant driver by going to the following repo:
https://github.com/lwfinger/rtw88
If you decide to use the in-kernel driver, remember to first remove the driver in this repo. You can run the following to remove the driver in this repo:
$ sudo sh remove-driver.sh
It has been my pleasure to maintain this driver for the last several years. Thanks to all of those who helped.
Remember: Ask not what your operating system can do for you, but what you can do for your operating system.
Regards,
@morrownr
Note: Please read the file "supported-device-IDs" for information about how to confirm that this is the correct driver for your adapter.
Note: Posting this driver is not a recommendation for Linux users to buy USB WiFi adapters based on the Realtek chipsets supported by this driver. Realtek out-of-kernel WiFi drivers, such as this one, are not Linux Wireless Standards compliant and appear to be designed to be used by skilled programmers producing products such as embedded systems. Users of desktop and server distros such as Ubuntu, Debian, Manjaro, Fedora, Raspberry Pi OS and other mainline desktop and server distros will likely find adapters that use in-kernel drivers (Linux Wireless Standards compliant) to be more stable and much more trouble-free. The following links will provide more information:
USB WiFi adapters that are supported with Linux in-kernel drivers
USB WiFi adapter information for Linux
FAQ.md8821au.confNote: Additional CPU architectures may work but I currently only have the hardware to test the above.
Note: Kernels earlier than 5.4 may work but are not tested or supported.
Note: The information in this section depends largely on user reports which can be provided via PR or message in Issues.
Arch Linux (kernels 5.4, 5.11 and 6.6)
Debian (kernels 5.10, 5.15, 6.1 and 6.6)
Fedora Fedora 38, 41 (kernel 6.11)
Manjaro (kernel 5.15)
openSUSE Tumbleweed (rolling) (kernel 5.15)
Raspberry Pi OS (2023-12-05)(ARM 32 bit and 64 bit)
Raspberry Pi Desktop (2022-07-01) (x86 32 bit) (kernel 5.10)
Ubuntu 22.04 (kernel 5.15), 22.10 (kernel 5.19) (kernel 6.5), 24.10 (kernel 6.11) and 26.04 (kernel 7.0)
EL10-based (ELRepo kernel-ml 7.2.2)
Note: Red Hat Enterprise Linux (RHEL) and distros based on RHEL are supported by Red Hat devs due to the way kernel patches are handled in Red Hat. I support knowledgable RHEL developers if they want to merge the required support and keep it current. I reserve the right to delete this support without notice if it causes any problems.
Current RHEL maintainer: none
Note: Android is supported in the driver according to Realtek. I will support knowledgable Android developers if they want to merge and keep current the required support (most likely just instructions about how to compile and maybe a modification or two to the Makefile).
Current Android maintainer: none
Note: OpenWRT is not supported. OpenWRT provides drivers for USB WiFi adapters. OpenWRT provided drivers include support for the MT7921au (AXE3000), MT7612u (AC1200), MT7610u (AC600) chipsets. It is a challenge to use Realtek based adapters that use out-of-kernel drivers with OpenWRT so it is strongly advised to use the already supported chipsets.
Warning: It is recommended that you follow the installation instructions in the Installation Steps section. Avoid installation by downloading the zip file if at all possible. Support can only be provided, on a best effort basis, if the instructions in the Installation Steps section are followed.
Warning: Installing multiple out-of-kernel drivers for the same hardware
usually does not end well. The install-driver.sh script has the
capability to detect and remove most conflicting drivers but not all. If
this driver does not work well after installation and you have
previously installed a driver that you did not remove, it is suggested
that you run the following command in an effort to determine if you need
to take action to manually remove conflicting drivers:
sudo dkms statusWarning: If you decide to do a distro upgrade, which will likely install a new version of kernel such as 5.15 to 6.1, you need to update this driver with the newest available code and then reinstall it before performing the disto upgrade. Use the following commands in the driver directory:
git pullsudo sh install-driver.shInternet access is required for initial installation. There are numerous ways to enable temporary internet access depending on your hardware and situation. One method is to use tethering from a phone.. Another method is to keep a WiFi adapter that uses an in-kernel driver in your toolkit.
You will need to use the terminal interface. The quick way to open a terminal: Ctrl+Alt+T (hold down on the Ctrl and Alt keys then press the T key).
An alternative terminal is to use SSH (Secure Shell) from the same or from another computer, in which case you will be in a suitable terminal after logging in, but this step requires that an SSH daemon/server has already been configured. (There are lots of SSH guides available, e.g., for the Raspberry Pi and for Ubuntu. Do not forget to secure the SSH server.)
You will need to have sufficient access rights to use sudo so that commands
can be executed as the root user. (If the command sudo echo Yes returns
"Yes", with or without having to enter your password, you do have sufficient
access rights.)
DKMS is used for the installation, if available. DKMS is a system utility which will automatically recompile and reinstall this driver when a new kernel is installed. DKMS is provided by and maintained by Dell.
It is recommended that you do not delete the driver directory after installation as the directory contains information and scripts that you may need in the future.
Secure Boot: see FAQ.
Note: The installation instructions are for the novice user. Experienced users are welcome to alter the installation to meet their needs. Support will be provided, on a best effort basis, based on the steps below. Another way to word this paragraph is that if you do not follow the below steps for installation, you are your own tech support.
Note: If your Linux distro does not fall into one of options listed
below, you will need to research how to update and upgrade your
system packages.
sudo apt update && sudo apt upgradesudo pacman -Syusudo dnf upgradesudo zypper updatesudo xbps-install -SyuNote: It is recommended that you reboot your system at this point. The rest of the installation will appreciate having a fully up-to-date system to work with. The installation can then be continued with Step 3.
sudo rebootNote: If your Linux distro does not fall into one of options listed below, you will need to research how to properly setup up the development environment for your system. General guidance follows.
Development Environment Requirements: (package names may vary by distro)
gcc make bc kernel-headers build-essential gitdkms rfkill iw ipopenssl sign-file mokutilNote: The below options should take care of the mandatory and highly recommended requirements. If Secure Boot is active on your system, please also install the mandatory packages for Secure Boot as shown above.
sudo apt install -y build-essentialsudo apt install -y raspberrypi-kernel-headers build-essential bc dkms gitsudo apt install -y linux-headers-$(uname -r) build-essential bc dkms git libelf-dev rfkill iwsudo apt install -y build-essential dkms git iwNote: Fedora users should also install openssl if secure boot is
active.
sudo dnf -y install git dkms kernel-develsudo zypper install -t pattern devel_kernel dkmssudo apk add linux-lts-dev makeNo open issues yet, or sync has not completed.