Mastering the Realtek RTL8723AU on Linux Mint 18.1: A Definitive Guide to Restoring Your Wi-Fi

Welcome to revWhiteShadow, your dedicated resource for navigating the complexities of Linux hardware compatibility. We understand the frustration that arises when essential components, such as your Wi-Fi adapter, fail to perform after a fresh operating system installation. For users of Linux Mint 18.1 (Xfce) on devices like the Lenovo Yoga 13, encountering issues with the Realtek RTL8723AU Wi-Fi card is a common predicament. While previous versions of Linux Mint might have recognized this adapter out-of-the-box or with simple driver installations, Linux Mint 18.1 presents new challenges. This comprehensive guide is meticulously crafted to not only address the problem but to provide a robust, detailed solution that aims to outrank existing resources by offering unparalleled depth and clarity. We will walk you through every step, ensuring you can get your Realtek RTL8723AU working efficiently and reliably.

Understanding the Challenge: Realtek RTL8723AU and Linux Mint 18.1 Integration

The Realtek RTL8723AU is a popular wireless and Bluetooth combo chip found in many laptops. However, its integration with Linux distributions, particularly newer ones, can be a hurdle. The core of the issue often lies in the kernel’s support for the specific firmware or driver needed by this particular hardware revision. While the open-source community works diligently to provide drivers, there are instances where specific versions or configurations are required, especially when dealing with kernel updates or changes in driver management within a distribution like Linux Mint 18.1.

In prior Linux Mint versions, a straightforward compilation and installation of a known working driver from repositories like GitHub was often sufficient. However, with Linux Mint 18.1, subtle kernel changes or updated default driver blacklisting can interfere with this process. The symptoms you’ve described – the Wi-Fi connecting for a brief period and then disconnecting, or failing to detect any networks at all – are classic indicators of a driver that is not fully compatible or is being intermittently dropped by the system.

Initial Diagnosis and Essential Pre-requisites for Driver Installation

Before we dive into the driver compilation and installation, it’s crucial to ensure your system is up-to-date and has the necessary tools for building kernel modules. This initial step is vital for the success of any driver installation process.

System Updates: Ensuring a Clean Slate

An updated system is more likely to have the necessary build tools and kernel headers, which are critical for compiling drivers.

  1. Update Package Lists: This command fetches the latest information about available packages from your configured repositories.
    sudo apt-get update
    
  2. Upgrade Existing Packages: This command installs newer versions of packages that are already installed, ensuring your system is running the latest stable software.
    sudo apt-get upgrade
    

Installing Essential Build Tools and Kernel Headers

Kernel modules are compiled against specific kernel versions. Installing the correct linux-headers package is paramount. build-essential provides the foundational tools needed for compilation, such as gcc, make, and other development utilities.

  1. Install build-essential: This package group includes a compiler, make, and other essential tools for building software from source.
    sudo apt-get install build-essential
    
  2. Install Generic Kernel Headers: This installs headers for the generic Linux kernel, which is typically what Linux Mint uses.
    sudo apt-get install linux-headers-generic
    
  3. Install Specific Kernel Headers: This command dynamically installs the headers that match your currently running kernel version. This is absolutely critical for a successful compilation. The uname -r command outputs your current kernel version.
    sudo apt-get install linux-headers-$(uname -r)
    

Important Note: If any of these apt-get commands fail, it might indicate an issue with your repository sources. Ensure /etc/apt/sources.list and files in /etc/apt/sources.list.d/ are correctly configured and accessible.

Verifying Hardware Detection: lsusb and rfkill

Your provided lsusb output confirms the presence of the Realtek Semiconductor Corp. RTL8723AU 802.11n WLAN Adapter on Bus 001 Device 004. This is good, as it means the hardware is at least being recognized by the USB subsystem.

The rfkill list all output shows:

  • 0: ideapad_wlan: Wireless LAN Soft blocked: no Hard blocked: no
  • 3: phy0: Wireless LAN Soft blocked: no Hard blocked: no

This indicates that your wireless card is neither soft blocked (meaning the operating system is not intentionally disabling it via software) nor hard blocked (meaning there’s no physical switch or BIOS setting disabling it). This is also a positive sign, suggesting the issue is indeed with the driver or firmware.

Compiling and Installing the RTL8723AU Driver: A Step-by-Step Approach

The method you’ve attempted – cloning a driver from GitHub and compiling it – is the standard and most effective way to tackle this on Linux. However, the fact that it worked previously but not now suggests that either the GitHub repository has been updated with a less compatible version, or there are other system-level changes in Linux Mint 18.1 that are preventing it from loading correctly or staying loaded.

We will refine this process with additional considerations and troubleshooting steps.

Step 1: Prepare the Build Environment

First, ensure you have git installed to download the driver source code.

  1. Install Git: If you don’t have Git installed, use this command.
    sudo apt-get install git
    

Step 2: Download the RTL8723AU Driver Source Code

We will use the same GitHub repository you mentioned, which is a well-maintained source for Realtek drivers.

  1. Navigate to a Temporary Directory: It’s good practice to download and build source code in a temporary location.

    cd /tmp
    
  2. Create a Directory for the Driver:

    mkdir rtl8723au_driver
    cd rtl8723au_driver
    
  3. Clone the Repository:

    git clone https://github.com/lwfinger/rtl8723au.git
    

    This command will download the driver source code into a new directory named rtl8723au within your current location (/tmp/rtl8723au_driver/).

  4. Navigate into the Driver Directory:

    cd rtl8723au
    

Step 3: Compile the Driver

This is where the compilation process takes place. The make command invokes the build system, and make install installs the compiled module into the kernel’s module directory.

  1. Clean Previous Builds (if any): It’s often a good idea to start with a clean slate.
    make clean
    
  2. Compile the Driver:
    make
    
  3. Install the Driver:
    sudo make install
    

Step 4: Load the New Driver Module

After installation, the kernel needs to be made aware of the new module.

  1. Insert the Module: This command loads the 8723au.ko module into the running kernel.
    sudo modprobe 8723au
    
  2. Check if the Module is Loaded:
    lsmod | grep 8723au
    
    If you see 8723au listed, the module has been loaded successfully.

Step 5: Blacklisting Potentially Conflicting Drivers

Sometimes, the kernel might attempt to load a different, incompatible driver for the RTL8723AU, or a generic driver might interfere. Blacklisting prevents these drivers from loading automatically. Common culprits include rtl8xxxu or other Realtek-specific modules.

  1. Identify Potential Conflicting Modules: You can check which drivers are currently loaded for your Wi-Fi adapter using lspci -knn | grep -iA3 net or by observing output from dmesg after attempting to load the module. However, since your rfkill shows phy0, it’s likely the system is trying to use a generic Wi-Fi driver.

  2. Create a Blacklist File: We’ll create a file in /etc/modprobe.d/ to blacklist conflicting modules. You might need to experiment here if the primary driver doesn’t work.

    • Let’s start by blacklisting a common generic driver that might interfere with Realtek chips.
      echo "blacklist rtl8xxxu" | sudo tee /etc/modprobe.d/rtl8xxxu.conf
      
    • If you find other modules loaded that appear related to your Wi-Fi (check dmesg output for messages related to “rtl” or “wlan” after trying modprobe 8723au), you can add them similarly:
      echo "blacklist <conflicting_module_name>" | sudo tee /etc/modprobe.d/<conflicting_module_name>.conf
      
  3. Update the Initial Ramdisk: After changing modprobe configurations, it’s essential to update the initramfs so these changes are applied early in the boot process.

    sudo update-initramfs -u
    
  4. Reboot Your System:

    sudo reboot
    

Step 6: Re-testing and Verification

After rebooting, check if your Wi-Fi is now working.

  1. Check Network Manager: Look for available Wi-Fi networks in your network applet.
  2. Check Loaded Modules Again:
    lsmod | grep 8723au
    
  3. Check Kernel Messages for Errors:
    dmesg | grep 8723au
    dmesg | grep rtl
    
    Look for any error messages that might indicate problems loading the module or the device itself.

Troubleshooting Persistent Issues: Advanced Steps

If the above steps didn’t resolve the problem, we need to delve deeper into potential causes and solutions. The intermittent connectivity you described is a key clue.

1. Firmware Issues: A Common Bottleneck

The Realtek RTL8723AU often requires specific firmware files to operate correctly. Even with the right driver, missing or incorrect firmware can lead to instability.

  1. Install firmware-realtek: While this package might not contain the exact firmware for your specific RTL8723AU revision, it’s a good starting point.

    sudo apt-get install firmware-realtek
    
  2. Manually Add Firmware (If Necessary): If dmesg output suggests missing firmware files (often filenames containing rtlwifi or specific Realtek chip identifiers), you might need to manually download and place them in /lib/firmware/rtlwifi/.

    • You can find firmware files on repositories like the Debian firmware-linux or firmware-linux-nonfree packages, or sometimes directly from the driver’s GitHub page. The rtl8723au driver repository sometimes includes instructions or links to necessary firmware. The specific firmware file often needed is named something like rtl_nic/rtl8723aufw.bin.
    • Where to find it: If you have a working installation of this Wi-Fi card on another Linux distribution or even Windows, you can often extract the .fw file from there. Alternatively, search for “rtl8723au firmware github” or similar terms. One reliable source is often included within the driver repository itself or linked from its README. For instance, the rtl8723au repository by lwfinger historically included instructions on obtaining the firmware. Let’s assume you found the correct firmware file, named rtl8723aufw.bin.
    • Place the Firmware:
      sudo cp /path/to/your/downloaded/rtl8723aufw.bin /lib/firmware/rtlwifi/
      
      Ensure the permissions are correct:
      sudo chmod 644 /lib/firmware/rtlwifi/rtl8723aufw.bin
      
    • Reload Driver and Reboot:
      sudo modprobe -r 8723au
      sudo modprobe 8723au
      sudo reboot
      

2. Kernel Parameter Tuning for Power Management

Power management settings can sometimes cause Wi-Fi adapters to disconnect or behave erratically. The rtl8723au driver can be sensitive to these.

  1. Identify the Module Options: The 8723au module might have parameters that can be adjusted. A common parameter for Realtek Wi-Fi cards is related to power saving.
  2. Create a .conf File for Module Options:
    echo "options 8723au rtw_power_mgnt=0" | sudo tee /etc/modprobe.d/8723au.conf
    
    Setting rtw_power_mgnt=0 disables power management for the adapter. This is a very common fix for unstable Wi-Fi connections.
  3. Update Initramfs and Reboot:
    sudo update-initramfs -u
    sudo reboot
    
  4. Test: After rebooting, check if the Wi-Fi connection is stable. If this works, you have found a crucial fix. You might want to explore other power management options if this doesn’t fully resolve it, but disabling it is often the most effective.

3. Driver Version Compatibility and Specific Forks

While the lwfinger/rtl8723au repository is generally reliable, specific hardware revisions might benefit from forks or slightly older/newer versions of the driver. The intermittent connection issue could point to a race condition or a bug in the current driver version that’s exposed by newer kernel behaviors.

  • Checking dmesg for Specific Errors: Carefully examine dmesg output. Look for lines immediately preceding the disconnection. Error messages containing “firmware error”, “timeout”, “resetting device”, or specific USB error codes can pinpoint the problem.
  • Trying Alternative Forks: Search GitHub for other popular forks of the rtl8723au driver. Some users maintain versions that are specifically patched for certain kernel versions or hardware quirks. For example, searching for “rtl8723au linux mint 18” might reveal community-contributed fixes. However, always be cautious about the source and reputation of alternative driver repositories.

4. Using DKMS for Automatic Recompilation

A more robust solution for kernel-related drivers is to use Dynamic Kernel Module Support (DKMS). DKMS automatically recompiles and installs modules when your kernel is updated, preventing the driver from breaking after a system upgrade.

  1. Install DKMS:

    sudo apt-get install dkms
    
  2. Prepare Driver Source for DKMS:

    • Copy the driver source to /usr/src/rtl8723au-$(date +%Y.%m.%d). You’ll need to create a dkms.conf file within the driver’s source directory.
    • Create dkms.conf: Navigate into the /tmp/rtl8723au_driver/rtl8723au directory. Create a file named dkms.conf with the following content:
      PACKAGE_NAME="rtl8723au"
      PACKAGE_VERSION="1.0" # You can use a date or a specific version number
      CLEAN="make clean"
      BUILT_MODULE_NAME="8723au"
      BUILT_MODULE_TARGET[0]="8723au.ko"
      DEST_MODULE_LOCATION[0]="/updates/dkms"
      AUTOINSTALL="yes"
      
      Note: Adjust PACKAGE_VERSION as needed. The DEST_MODULE_LOCATION is where DKMS will place the compiled module.
    • Add the Module to DKMS:
      sudo dkms add -m rtl8723au -v 1.0
      
    • Build and Install the Module:
      sudo dkms build -m rtl8723au -v 1.0
      sudo dkms install -m rtl8723au -v 1.0
      
    • Load the Module:
      sudo modprobe 8723au
      
    • Verify DKMS Status:
      dkms status
      
      This should show your rtl8723au module as installed.

    Now, whenever your kernel updates, DKMS should automatically rebuild and install the 8723au module. This is the most resilient solution for long-term stability.

5. Checking journalctl for Deeper Insight

For more detailed error reporting than dmesg, you can use journalctl.

  1. View Kernel Messages:
    journalctl -k
    
  2. Filter by rtl8723au or wlan:
    journalctl -k | grep -i "rtl8723au"
    journalctl -k | grep -i "wlan"
    journalctl -k | grep -i "firmware"
    
    This can reveal subtle errors that might not be immediately obvious in dmesg.

Ensuring Long-Term Stability and Performance

Successfully installing and loading the Realtek RTL8723AU driver is the first step. To ensure continuous operation and optimal performance, consider these points:

  • Disable Automatic Updates for Kernel Modules: If you are manually managing drivers, be cautious about automatic kernel updates that might revert your changes or cause conflicts. You might want to “hold” the kernel package if you’re in a critical environment, but this is generally not recommended for security reasons. Using DKMS is the preferred method.
  • Monitor System Logs: Periodically check dmesg and journalctl -k for any new errors related to your Wi-Fi adapter, especially after system updates.
  • Optimize Network Settings: Ensure your Wi-Fi adapter’s power saving is correctly managed. If disabling it (rtw_power_mgnt=0) provided stability, stick with that. If it caused higher battery drain, you might try re-enabling it with a different driver version or a modified kernel parameter if available.
  • Consider a Different Wi-Fi Card: In cases where compatibility remains elusive despite extensive troubleshooting, sometimes the most practical solution is to replace the Wi-Fi card with one known for excellent Linux support (e.g., Intel Wi-Fi cards). However, based on the information provided and the success of similar fixes in the past, we believe a working solution for your Realtek RTL8723AU on Linux Mint 18.1 is achievable.

Conclusion: Reclaiming Your Wireless Connectivity

The journey to getting the Realtek RTL8723AU working on Linux Mint 18.1 can be intricate, but by systematically following these detailed steps, you are well-equipped to overcome the challenges. We have covered everything from initial system preparation and driver compilation to advanced troubleshooting techniques like firmware management, kernel parameter tuning, and the robust implementation of DKMS.

The key to success often lies in the precise combination of the correct driver source, necessary build tools, appropriate firmware, and sometimes, specific kernel module options to manage power settings. The Realtek RTL8723AU is a capable adapter, and with the right configuration, it will serve you reliably on your Lenovo Yoga 13 with Linux Mint 18.1.

We are confident that this comprehensive guide provides the depth and actionable advice required to not only fix your Wi-Fi but also to understand the underlying mechanisms, empowering you to tackle similar hardware compatibility issues in the future. At revWhiteShadow, our mission is to provide you with the knowledge and solutions to make your Linux experience seamless and productive. Your wireless freedom is now within reach.