Chasing AOSP: My Quest to Build AOSP Setup in Ubuntu 18.04 (and Why I Gave Up)

Context:

Ubuntu 18.04 was the preferred version for AOSP development, as Google recommended. For optimal performance, Google’s recommended system configurations for AOSP are as follows:

RAM: At least 16GB (64GB is recommended)
Storage Capacity (ROM): at least 250GB

The following are my system configurations:

CPU Type: Intel Alder Lake Core i9-12900HK
CPU Brand: Intel
CPU Speed (GHz): Up to 5.0GHz
RAM Capacity: 64GB (Expanded from the original 32GB)
Storage Capacity (ROM): 1TB SSD

For the purpose of learning AOSP, I purchased the GMKtec M3 Plus—an exceptionally affordable device given its impressive specifications. Following Google’s recommendations, I installed Ubuntu 18.04, and that’s where the challenges began…

Upon installing Ubuntu 18.04 on the device, I encountered a No Wi-Fi Adapter Found message, indicating that the driver for my Wi-Fi chipset was either not loaded or not supported out of the box.

Since I was using the GMKtec M3 Plus, it’s likely that the device includes a newer Wi-Fi chipset that isn’t compatible with the older 18.04 kernel. Here’s how I attempted to troubleshoot and eventually gave up:

Step 1: Identify the Wireless Chipset

I booted into Ubuntu and ran there following command in the terminal:

lspci -nnk | grep -A3 Network

This would have told me the exact Wi-Fi chipset (e.g., Realtek RTL8852BE, Intel AX200, etc.)

However…

Realtek RTL8852BE
(Device ID: 10ec:b852)

This chipset was not supported by default in Ubuntu 18.04, but I could get it working by manually installing the driver from source.

Step-by-step Fix: RTL8852BE on Ubuntu 18.04

Get temporary internet access
(USB tethering, Ethernet adapter, or USB Wi-Fi dongle)

Install required packages

    sudo apt update
    sudo apt install build-essential dkms git

    Clone and build the driver

    git clone https://github.com/lwfinger/rtw89.git
    cd rtw89
    make
    sudo make install
    sudo modprobe rtw89pci

    Reboot my system

    sudo reboot

    After rebooting, go to Settings → Wi-Fi — it should have detected my adapter.

    Temporary Wi-Fi connections:

    Alongside Wi-Fi, I also attempted to connect to the internet via Ethernet; however, that too was unsuccessful.

    Since I still needed an internet connection to download and install the necessary software, I quickly connected the machine to my Pixel 7 and enabled USB tethering.

    It’s a small but useful tip: USB tethering is disabled by default and only becomes available once your phone is physically connected to the computer.

    Get the driver:

    Based on my experience with the GMKtec M3 Plus mini PC and the Ubuntu 18.04 installation process, here’s what I’ve observed so far:

    • No Wi-Fi adapter found
    • Ethernet (Intel 8086:125c) also not working
    • The onboard Wi-Fi uses Realtek RTL8852BE (PCI ID 10ec:b852), which isn’t supported by Ubuntu 18.04 out of the box

    The Goal:

    To get either Wi-Fi or Ethernet working so I could install other stuff and not be stuck offline.

    Manually install Wi-Fi Driver from git:

    git clone https://github.com/lwfinger/rtw89.git
    cd rtw89
    sudo apt install build-essential dkms
    make
    sudo make install
    sudo modprobe rtw89pci
    sudo reboot

    git clone https://github.com/lwfinger/rtw89.git
    → This downloads the Realtek Wi-Fi driver files from the internet.

    cd rtw89
    → This moves you into the folder that contains the driver.

    sudo apt install build-essential dkms
    → This installs tools needed to build the driver for your system.

    make
    → This compiles (builds) the driver from the source code.

    sudo make install
    → This installs the driver so your system can use it.

    sudo modprobe rtw89pci
    → This activates the driver right away.

    sudo reboot
    → This restarts your computer so the driver loads automatically next time.

    And I got this error…

    What happened:

    • I was running kernel 5.4.0-84-generic, which was still too old for the rtw89 driver.
    • The build failed with:
    error: ‘struct wiphy’ has no member named ‘tid_config_support’

    That means the driver needs a newer kernel API (from kernel 5.10+) that doesn’t exist in 5.4.

    Step-by-Step: Manual Kernel Install

    So I went to the official Ubuntu kernel archive.

    I chose a version ≥ 5.15. (I recommend 5.15.142 because it’s stable and widely tested.)

    Then download these 4 .deb files for amd64 (64-bit):

    You can scroll down and spot a specific version you’re looking for.

    On my GMKtec Ubuntu machine:

    cd /media/usb/kernel_5.15.142
    sudo dpkg -i *.deb

    This would have installed the new kernel.

    Reboot into New Kernel:

    sudo reboot

    Check the kernel version after boot:

    uname -r

    It should show 5.15.145-...

    And it was almost successful…

    The kernel 5.15.140 image installed successfully (vmlinuz and initrd were set up).

    But I hit an error while processing linux-headers-5.15.140-0515140-generic — likely due to a missing dependency.

    What This Means:

    • I could still boot into kernel 5.15.140 and try if Ethernet or Wi-Fi now works.
    • But if I wanted to build Wi-Fi drivers like rtw89, I would have still needed to fix the headers install too.

    Next Steps:

    Reboot into the new kernel

    sudo reboot

    Then, after booting, check:

    uname -r

    I should have seen:

    5.15.140-0515140-generic

    Then I tested my network:

    ip a

    But… The kernel version was successfully upgraded, and the Wi-Fi icon appeared in the upper-left corner. However, the system still displays “Wi-Fi adapter not found,” indicating that the issue persists.

    I was so close — the kernel is upgraded (5.15.140) and Ethernet interface enp3s0 is active, but no IP address = still not online. Also, Wi-Fi icon appeared but still says “No Wi-Fi Adapter Found”, which means:

    What’s Working:

    • Kernel 5.15 installed and booted successfully — great job!
    • Ethernet interface is detected and UP, but not getting IP (likely DHCP issue)
    • Wi-Fi still not available — probably due to missing or partial rtw89 driver

    Next Move: Get Online via Ethernet

    Let’s fix Ethernet first — that’s the easiest way to get internet and finish Wi-Fi setup.

    Step 1: Force DHCP renewal

    Try this in terminal:

    sudo dhclient enp3s0

    Then test:

    ping -c 3 google.com

    If that works — I should have been online.

    But still, it didn’t work out…

    Here’s what’s happening:

    • My phone created a virtual USB network device (enp0s20f0u9)
    • That interface got an IP and internet
    • dhclient enp3s0 just hangs silently because it’s trying to request an IP on the Ethernet port, but there’s no cable connected, or the router isn’t responding

    What to Do Now:

    • Press Ctrl+C to cancel the stuck dhclient command
    • I already had internet — so I installed the Realtek Wi-Fi driver:
    sudo apt update
    sudo apt install build-essential dkms git
    git clone https://github.com/lwfinger/rtw89.git
    cd rtw89
    make
    sudo make install
    sudo modprobe rtw89pci

    After that, Wi-Fi should finally come alive!

    But again, another error…

    What Went Wrong:

    I was getting this error during the make step:

    vbnetCopyEdit gcc: error: unrecognized command line option ‘-mhard-float’

    And a warning:

    csharpCopyEdit The kernel was built by: gcc 11.4.0

    I was using: gcc 7.5.0

    Why This Happens:

    • My kernel (5.15.140) was compiled with GCC 11.4
    • But I was trying to build the rtw89 driver using GCC 7.5, which is Ubuntu 18.04’s default

    This mismatch causes the compiler to choke on certain options like -mhard-float, which older GCC doesn’t understand.

    Fix: Upgrade GCC to Match the Kernel (v11 or newer)

    I tried to upgrade GCC using my current internet connection:

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt update
    sudo apt install gcc-11 g++-11

    Then temporarily use GCC 11 for compiling:

    export CC=/usr/bin/gcc-11
    export CXX=/usr/bin/g++-11

    Now retry:

    cd ~/rtw89
    make
    sudo make install
    sudo modprobe rtw89pci

    Once that’s done, my Realtek Wi-Fi should have finally come to life.

    This screenshot confirms that my current Ubuntu 18.04 system can’t install GCC 11 because it’s missing newer system libraries (libc6 ≥ 2.34, libssl3, etc.) — which only exist in Ubuntu 22.04+.

    Finally, I gave up:

    It turned out to be a complete waste of time—everything was a mess. The core issue lies in the fact that Google continues to recommend Ubuntu 18.04 for AOSP development, yet most modern devices are no longer compatible with the older kernel and system requirements of that OS. I had purchased this powerful machine specifically to meet Google’s recommended specifications, only to find it incompatible.

    In the end, I opted to install Ubuntu 22.04 on the device and used Docker to run Ubuntu 18.04 in a container, allowing me to adhere to Google’s AOSP development requirements while maintaining compatibility with my hardware.

    Nonetheless, it was a valuable learning experience—trying various approaches to get the older OS up and running taught me a great deal. Linux is incredibly deep, and it’s clear there’s still so much I have yet to understand.

    One Reply to “Chasing AOSP: My Quest to Build AOSP Setup in Ubuntu 18.04 (and Why I Gave Up)”

    Leave a Reply

    Your email address will not be published. Required fields are marked *