RealTek Network card not working

Reboot and tap esc or tab to access the Grub Menu if the grub menu does not appear at boot.
From the Grub Menu, select Advanced Options for Zorin and then select to boot Zorin On (Previous kernel. It should be Zorin On 5.15.0-7something)

1 Like

OK, I booted into old kernel and tried installing rtl8821ce-dkms again.
Again an error, but maybe just for kernel 6.2 even though I'm in kernel 5.15. Will reboot and see what happens.

Last half of terminal output
Reading state information... Done
rtl8821ce-dkms is already the newest version (5.5.2.1-0ubuntu4~20.04.5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up rtl8821ce-dkms (5.5.2.1-0ubuntu4~20.04.5) ...
Removing old rtl8821ce-5.5.2.1 DKMS files...

------------------------------
Deleting module version: 5.5.2.1
completely from the DKMS tree.
------------------------------
Done.
Loading new rtl8821ce-5.5.2.1 DKMS files...
Building for 5.15.0-78-generic 6.2.16-060216-generic
Building initial module for 5.15.0-78-generic
Can't load /var/lib/shim-signed/mok/.rnd into RNG
139905098659136:error:2406F079:random number generator:RAND_load_file:Cannot ope
n file:../crypto/rand/randfile.c:98:Filename=/var/lib/shim-signed/mok/.rnd
Generating a RSA private key
................................................................................
........................................................................+++++
....................+++++
writing new private key to '/var/lib/shim-signed/mok/MOK.priv'
-----
Secure Boot not enabled on this system.
Done.

rtl8821ce.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.0-78-generic/updates/

/etc/modprobe.d/dkms.conf: added 'blacklist rtw88_8821ce'
depmod....

DKMS: install completed.
Building initial module for 6.2.16-060216-generic
Error! Bad return status for module build on kernel: 6.2.16-060216-generic (x86_
64)
Consult /var/lib/dkms/rtl8821ce/5.5.2.1/build/make.log for more information.
dpkg: error processing package rtl8821ce-dkms (--configure):
 installed rtl8821ce-dkms package post-installation script subprocess returned e
rror exit status 10
Errors were encountered while processing:
 rtl8821ce-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)

After rebooting (kernel 5.15), it still doesn't see wifi.

lshw -C network output
sudo lshw -C network 
  *-network UNCLAIMED       
       description: Network controller
       product: Realtek Semiconductor Co., Ltd.
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress cap_list
       configuration: latency=0
       resources: ioport:1000(size=256) memory:a1100000-a11fffff
  *-network
       description: Ethernet interface
       physical id: 3
       bus info: usb@1:8
       logical name: usb0
       serial: 46:1a:ed:90:e5:0d
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=rndis_host driverversion=5.15.0-78-generic duplex=half firmware=RNDIS device ip=192.168.0.11 link=yes multicast=yes port=twisted pair

Is Secure Boot enabled in BIOS EFI settings?

it's turned off, and that was confirmed both by a message on startup and by terminal output somewhere today (I think the first time I tried installing rtl8821ce-dkms)
EDIT: Found it in output above:

Secure Boot not enabled on this system.
1 Like

After working out how to do a fresh, clean reinstall of Zorin, I will now attempt the suggestions in this post:

First step:

sudo apt clean && sudo apt autoremove && sudo apt update

OK. Next:

sudo apt install -y git build-essential

OK. Next:

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

OK. This is already better than the first time I tried (which gave an error at this step).
Next:

cd rtw89

OK. Next:

make

OK. Next:

sudo make install

Install rtw89 SUCCESS
That sounds good!

Next:

sudo mkdir /usr/lib/firmware/rtw89

mkdir: cannot create directory 'usr/lib/firmware/rtw89': File exists

This happened before, but I'm not sure what to do (back then the situation complicated by the fact I was using a Live USB, this time it's installed on the SSD).

Just go ahead with the remaining steps? Something else?

Yes. That step seeks to ensure that the directory is present to receive files.

1 Like

Thanks.

Next step:

sudo cp rtw8852a_fw.bin /usr/lib/firmware/rtw89/

gives:

cp: cannot stat 'rtw8852a_fw.bin': No such file or directory

I just downloaded the files and took a look. rtw8852a_fw.bi is not listed in the directories.

-sigh-

Scrolling through, we get to this:

# DKMS packaging for debian and derivatives

DKMS is commonly used on debian and derivatives, like ubuntu, to streamline building extra kernel modules.  
By following the instructions below and installing the resulting package, the rtw89 driver will automatically rebuild on kernel updates. Secure boot signing will happen automatically as well, 
as long as the dkms signing key (usually located at /var/lib/dkms/mok.key) is enrolled. See your distro's secure boot documentation for more details. 

Prerequisites:

-bash-
sudo apt install dh-sequence-dkms debhelper build-essential devscripts


This workflow uses devscripts, which has quite a few perl dependencies.  
You may wish to build inside a chroot to avoid unnecessary clutter on your system. The debian wiki page for [chroot](https://wiki.debian.org/chroot) has simple instructions for debian, which you can adapt to other distros as needed by changing the release codename and mirror url.  
If you do, make sure to install the package on your host system, as it will fail if you try to install inside the chroot. 

Build and installation

-bash-
# If you've already built as above clean up your workspace or check one out specially (otherwise some temp files can end up in your package)
git clean -xfd


git deborig HEAD

dpkg-buildpackage -us -uc

sudo apt install ../rtw89-dkms_1.0.2-3_all.deb

This will install the package, and build the module for your
currently active kernel.  You should then be able to `modprobe` as
above. It will also load automatically on boot.

##### A note regarding firmware

Firmware from userspace is required to use this driver. This package will attempt to pull the firmware in automatically as a Recommends.
However, if your distro does not provide one of firmware-realtek >= 20230117-1 or linux-firmware >= 20220329.git681281e4-0ubuntu3.10, 
the driver will fail to load, and dmesg will show an error about a specific missing firmware file. In this case, you can download the firmware files 
directly from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtw89.

That seems... hard. :grin:

On the off chance that I could avoid all that, I did two steps from an online guide.

Specifically:

cd /lib/firmware/rtw89

sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtw89/rtw8852b_fw.bin

And rebooted, and... wifi detected!!! Password accepted!!!!! Webpages loading!!!!!!!!!!!

Thanks everyone, especially @Aravisian for helping me through this odyssey. Phew! Now I can really get started setting up Zorin on the new machine.

EDIT: Just to make clear, the solution is a combination, the first 90% what Aravisian said and the last two steps from that blogpost.
After a reinstall, I tried only the steps from the blogpost and it failed.

Here's the complete combined list of steps:

sudo apt clean && sudo apt autoremove && sudo apt update

sudo apt install -y git build-essential

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

cd rtw89

make

sudo make install

sudo mkdir /usr/lib/firmware/rtw89

(The above gives me an "File exists" error but I still end up with working wifi, so I include it anyway, just in case. Who am I to question the magic of the command line gods?)

cd /lib/firmware/rtw89

sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtw89/rtw8852b_fw.bin

Then reboot and wifi detected!

NOTE: With this method, if there is any change to the Linux kernel (e.g. through a Zorin Software Update), the wifi card will stop being detected. But you can get it working again with the following steps:

cd ~/rtw89
git pull
make clean
make
sudo make install
;or
sudo make sign-install

Then reboot and wifi will be detected again.

See the driver's GitHub page for more info:

2 Likes

I edited the Solution post to make clear the actual solution is a combination of steps from Aravisian and the blog post, and to add a clear list of all the necessary steps from both sources.

My chip is same as yours, rtw8852be. I opened an issue on the maintainer's page.

https://github.com/lwfinger/rtw89/issues/263

Good news is that Kernel 6.6 might have the fix we need out of the box.

I guess I'm lucky: my Wifi stays on all the time, no disconnections. (I'm not sure but I think the same chip handles Bluetooth, I still need to test that.)

Linux Hardware Probe suggested updating kernel to 6.02, but that made no difference for me, wifi still wasn't detected.

As Zorin is based on Ubuntu LTS releases, I doubt the included kernel will be 6.6 any time soon. But at least now I have some experience of trying different kernels.

Unbelievable! Within minutes of me saying "no disconnections", my wifi is gone!

I ran Zorin Software Updater, installed updates and restarted, and now wifi not detected. :frowning:

I'm tethering now. @anyone: Should I try the above steps again to get wifi working? Or just a select few? Or something else entirely? Roll back the Zorin Update? lshw again?

Here's the output:

sudo lshw -C network
  *-network UNCLAIMED       
       description: Network controller
       product: Realtek Semiconductor Co., Ltd.
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress cap_list
       configuration: latency=0
       resources: ioport:1000(size=256) memory:a1100000-a11fffff
  *-network
       description: Ethernet interface
       physical id: 3
       bus info: usb@1:8
       logical name: usb0
       serial: a2:40:94:28:5d:af
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=rndis_host driverversion=5.15.0-79-generic duplex=half firmware=RNDIS device ip=192.168.0.10 link=yes multicast=yes port=twisted pair

So back to saying it's "unclaimed".

Here's the relevant section from var/log/apt/history.log showing what was updated today, not sure if anyone can spot what might have caused wifi to disappear:

Start-Date: 2023-08-14 14:20:08
Commandline: aptdaemon role='role-commit-packages' sender=':1.79'
Install: linux-hwe-5.15-headers-5.15.0-79:amd64 (5.15.0-79.86~20.04.2, automatic), linux-image-5.15.0-79-generic:amd64 (5.15.0-79.86~20.04.2, automatic), linux-headers-5.15.0-79-generic:amd64 (5.15.0-79.86~20.04.2, automatic), linux-modules-extra-5.15.0-79-generic:amd64 (5.15.0-79.86~20.04.2, automatic), linux-modules-5.15.0-79-generic:amd64 (5.15.0-79.86~20.04.2, automatic)
Upgrade: python3-distro-info:amd64 (0.23ubuntu1, 0.23ubuntu1.1), linux-headers-generic-hwe-20.04:amd64 (5.15.0.78.85~20.04.38, 5.15.0.79.86~20.04.39), poppler-utils:amd64 (0.86.1-0ubuntu1.1, 0.86.1-0ubuntu1.2), intel-microcode:amd64 (3.20230214.0ubuntu0.20.04.1, 3.20230808.0ubuntu0.20.04.1), vim-common:amd64 (2:8.1.2269-1ubuntu5.15, 2:8.1.2269-1ubuntu5.16), gstreamer1.0-plugins-good:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), librsvg2-common:amd64 (2.48.9-1ubuntu0.20.04.1, 2.48.9-1ubuntu0.20.04.4), libgpgme11:amd64 (1.13.1-7ubuntu2, 1.13.1-7ubuntu2.1), gstreamer1.0-plugins-base:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), linux-image-generic-hwe-20.04:amd64 (5.15.0.78.85~20.04.38, 5.15.0.79.86~20.04.39), libgstreamer-plugins-good1.0-0:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), gstreamer1.0-pulseaudio:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), linux-generic-hwe-20.04:amd64 (5.15.0.78.85~20.04.38, 5.15.0.79.86~20.04.39), gstreamer1.0-gtk3:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), zorin-os-upgrader:amd64 (1.1, 1.1.4), librsvg2-2:amd64 (2.48.9-1ubuntu0.20.04.1, 2.48.9-1ubuntu0.20.04.4), libgstreamer-gl1.0-0:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), firefox-locale-en:amd64 (115.0.2+build1-0ubuntu0.20.04.1, 116.0.2+build1-0ubuntu0.20.04.1), ufw:amd64 (0.36-6ubuntu1, 0.36-6ubuntu1.1), libgstreamer-plugins-base1.0-0:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), gstreamer1.0-x:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), gir1.2-gst-plugins-base-1.0:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2), xxd:amd64 (2:8.1.2269-1ubuntu5.15, 2:8.1.2269-1ubuntu5.16), openssh-client:amd64 (1:8.2p1-4ubuntu0.8, 1:8.2p1-4ubuntu0.9), firefox:amd64 (115.0.2+build1-0ubuntu0.20.04.1, 116.0.2+build1-0ubuntu0.20.04.1), vim-tiny:amd64 (2:8.1.2269-1ubuntu5.15, 2:8.1.2269-1ubuntu5.16), libpoppler-cpp0v5:amd64 (0.86.1-0ubuntu1.1, 0.86.1-0ubuntu1.2), libpoppler-glib8:amd64 (0.86.1-0ubuntu1.1, 0.86.1-0ubuntu1.2), libpoppler97:amd64 (0.86.1-0ubuntu1.1, 0.86.1-0ubuntu1.2), gstreamer1.0-gl:amd64 (1.16.3-0ubuntu1.1, 1.16.3-0ubuntu1.2)
End-Date: 2023-08-14 14:22:30

It is because the kernel upgraded - but the wifi driver was not installed with DKMS (Dynamic Kernel Module Support).

Aha, thanks. I see this on the rtw89 page:

When your kernel changes, then you need to do the following:

cd ~/rtw89
git pull
make clean
make
sudo make install
;or
sudo make sign-install

Remember, this MUST be done whenever you get a new kernel - no exceptions.

I will try this and report back.

PS I don't see the word "kernel" anywhere in that log. In future, what should I look out for in order to spot a kernel change? "Headers"? "Image"?

The kernel installs by its Version and in four parts:
Headers
Image
Modules
Modules-extra

1 Like

Thanks for the info.

Re the fix, I did the following:

cd ~/rtw89
git pull
make clean
make
sudo make install

Then I rebooted, and wifi detected! :man_dancing:

I'll add that to the Solution post in case anyone else with the same wifi has the same issue.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.