Hotspot on Ubuntu Core using Intel WiFi 6 device

I’m trying to set up a hotspot on Ubuntu Core 22.04.

While this command

nmcli d wifi hotspot ifname wlp5s0 ssid "no-hotspot" password "no-party"

is enough for setting up a working hotspot on a device with an Intel Dual Band Wireless 9462NGW on board, when I try to do the same on a different device which has an Intel WiFi 6 card on board, I cannot get the hotspot working.

Looking on the web I bumped into this: https://askubuntu.com/questions/1460453/wifi-6e-ubuntu-20-04-not-able-to-connect

The 5.15 Linux kernel doesn’t natively support the latest Intel firmware. Intel’s core72 firmware only works with natively with 5.18 and above.

So I tried to upgrade the kernel of my Ubuntu Core installation through this command:

sudo snap install pc-kernel --channel=23.10/stable

but still I cannot make the hotspot working.

I know that @ogra has experimented a bit with WiFi in order to build this snap https://snapcraft.io/nm-wifi-hotspot I used it and it works fine, but as soon as I switch to a WiFi 6 device this doesn’t work either.

Ok, after further investigation on my Ubuntu Core installation, I found out that Linux kernel 5.15 nor 6.5 have on board the required firmware for my wireless card Intel® Wi-Fi 6 AX201 160MHz. Here is the Intel official page for WiFi card driver: https://www.intel.com/content/www/us/en/support/articles/000005511/wireless.html

Now, thanks to this post Need to install RealTek RTL8812AU driver for Ubuntu Core 16 I understand I need to build my own custom pc-kernel snap. Here I ask to @ogra a little help because it’s my first time building a custom kernel snap. Is there any more exhaustive documentation than this https://ubuntu.com/core/docs/kernel-building which explain how to handle it?

Believing the right way is building up a custom kernel snap, I’m in the process of doing it. Unfortunately, I bumped into some errors while snapcrafting. I was able to fix some of those installing in the VM the missing packages

apt install build-essential flex bison

However, I am stuck with this compilation error which I cannot figure out

Failed to run 'make -j2 bzImage modules' for 'kernel': Exited with code 2.
Verify that the part is using the correct parameters and try again.

I get to this situation snapcrafting using both, multipass and lxd.

I am using this modified snapcraft.yaml

name: pc-kernel
version: '1'
version-script: |
    . debian/debian.env
    dpkg-parsechangelog -l $DEBIAN/changelog -S version
summary: The Ubuntu generic Linux kernel
description: This Ubuntu generic Linux kernel
grade: stable
confinement: strict
type: kernel
build-base: core18

parts:
  kernel:
    plugin: kernel
    source: .
    source-type: git
    kconfigflavour: generic
    kconfigs:
      - CONFIG_DEBUG_INFO=n
    override-build: |
      cp debian/scripts/retpoline-extract-one \
        $SNAPCRAFT_PART_BUILD/scripts/ubuntu-retpoline-extract-one
      snapcraftctl build
    kernel-with-firmware: false
  firmware:
    plugin: nil
    stage-packages:
      - linux-firmware
    organize:
      lib/firmware: firmware
    prime:
      - -usr
      - -lib
    build-packages:
      - cpio
      - libssl-dev
  custom-firmware:
    plugin: dump
    source: iwlwifi-qu-48.13675109.0.tgz
    organize:
      iwlwifi-qu-48.13675109.0: lib/firmware

I’m using the master branch of git://kernel.ubuntu.com/ubuntu/ubuntu-focal.git

Does anybody have a clue about what I am doing wrong?

Unfortunately it seems there is a bug somewhere in the Make file of the Ubuntu Focal master branch. I tried to build a custom kernel snap using a different branch (Ubuntu-5.4.0-65.73) and the compiling process runs smoothly.

1 Like