42

I'm trying to install drivers for my Wifi on my HP All-in-one desktop. I've been told to show the output of the command "sudo lshw -C network" so here it is:

*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd
physical id: 0
bus info: pci@0000:01:00.0
logical name: enp1s0
version: 15
serial: 48:ba:4e:5c:06:5f
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 ip=192.168.1.21 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: ire:31 import:e000(size=256) memory: fea04000-fea04fff memory:fea00000-fea03fff

*-network UNCLAIMED
description: Network controller
product: Realtek Semiconductor Co., Ltd.
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
version: 00
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress cap_list
configuration: latency=0
resources: import:d000(size=256) memory:fe900000-fe90ffff

Output from "lspci -nnk | grep -A2 0280":

02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter [10ec:c821]
Subsystem: Hewlett-Packard Company RTL8821CE 802.11ac PCIe Wireless Network Adapter [103c:831a]
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader [10ec:5229] (rev 01)
pHeLiOn
  • 1,778
Haz
  • 521
  • @pHeLiOn Oh thanks, but yeah that question was posted 12 days ago and still has no answer so I'm really hoping someone here can help because I'm at a loss of what to do next. – Haz Sep 02 '18 at 07:41
  • 1
    Let's see if we can find the specific name of the wireless card and then search for solutions - please run lspci -nnk | grep -A2 0280 and show that output in your question. – pHeLiOn Sep 02 '18 at 07:48
  • Someone elsewhere also suggested going into BIOS settings and making sure Secure Boot is Disabled. Easy to try, so worth a shot. – pHeLiOn Sep 02 '18 at 07:52
  • @pHeLiOn Updated question – Haz Sep 02 '18 at 07:54
  • @pHeLiOn Yes I already had Secure Boot disabled. – Haz Sep 02 '18 at 07:56
  • @pHeLiOn I actually tried that solution while I was waiting and I got to the point where you have to type the "make" command but after running it I get a bunch of errors that say "recipe for target failed". Does that mean there's something wrong with the makefile or the downloaded packages? – Haz Sep 02 '18 at 08:39
  • If you've already tried that I'd take a look here at post #4 from praseodym: https://ubuntuforums.org/showthread.php?t=2398917 the first line seems to install all the tools you'll need and it's from a week ago so it's probably the most up to date solution. – pHeLiOn Sep 02 '18 at 08:47
  • (You can just copy and paste each line into the terminal) – pHeLiOn Sep 02 '18 at 08:48
  • @pHeLiOn Holy cow, I've been trying to get this working for 3 days. That post fixed it. Thank you so much. Now I can just use the wifi but I still have to get the graphics drivers working. Any ideas? – Haz Sep 02 '18 at 09:10
  • What Graphics card? Nvidia? – pHeLiOn Sep 02 '18 at 09:15
  • @pHeLiOn I added the output from "lspci" command to my question. I'm not sure if that shows what you are looking for. Otherwise just tell me what I should type to find it. – Haz Sep 02 '18 at 09:23
  • (We are going to be told off for using the comments for chat & I should know better but...) try sudo lshw -c video then you want to look up AskUbuntu for solutions to that - it could be AMD or nVidia - probably not Intel 'cause they don't tend to cause the 'freezing' issue you had before. – pHeLiOn Sep 02 '18 at 09:33
  • @pHeLiOn Added the output from lshw – Haz Sep 02 '18 at 09:38
  • Okay, AMD - please remove that from your question - the AskUbuntu rules are for one question at a time. We've looked at Wifi and am pleased we sorted it out finally! Graphics will need to be a separate question but please have a look for AMD questions and answers first to see if that type of question has been asked already. Use Windows to get more information on what type of graphics card it is - (Radeon HD 4550 or whatever) or look here: https://help.ubuntu.com/community/AMDGPU-Driver – pHeLiOn Sep 02 '18 at 09:48

3 Answers3

57

(This question is a duplicate of Wi-Fi not working on Lenovo ThinkPad E570 (Realtek RTL8821CE) but I was pleased that we eventually found a solution so will write up what worked for Haz.)

As far as I can tell, at the time of writing this, there is not yet a Wifi Driver for the Realtek RTL8821CE in the official Ubuntu Repositories.

Over on github there is a repository with an RTL8821CE driver aimed at kernels 4.14 and above and specifically for Arch Linux with no support provided for other Linux Distros: https://github.com/tomaspinho/rtl8821ce

(Minor note: as of February 2019 tomaspinho is sadly no longer able to maintain the driver as he no longer has access to a computer with this chipset, and so a new maintainer may be needed, but the driver still works with Ubuntu 18.04 as at that time.)

It has, however, been reported to work just fine with Ubuntu 18.04.

The solution is taken directly from post #4 by Praseodym: https://ubuntuforums.org/showthread.php?t=2398917 and will install a number of packages for building the wifi driver module (git, dkms, build-essential & linux-headers) and clone the git repository from tomaspinho.

DKMS is used because it's "a system which will automatically recompile and install a kernel module when a new kernel gets installed or updated."


Open up a terminal and type the following lines (You can cut and paste if you prefer):

sudo apt-get install --reinstall git dkms build-essential linux-headers-$(uname -r)
git clone https://github.com/tomaspinho/rtl8821ce
cd rtl8821ce
chmod +x dkms-install.sh
chmod +x dkms-remove.sh
sudo ./dkms-install.sh

After this is completed successfully, you should reboot and find that your Wifi is working.

You also want to make sure SecureBoot is Disabled in the BIOS settings or it won't let you load the unsigned self-complied kernel module.

OR

Sign the 8821ce.ko file yourself as per command given here

kmodsign sha512 \
    /var/lib/shim-signed/mok/MOK.priv \
    /var/lib/shim-signed/mok/MOK.der \
    /usr/lib/modules/$(uname -r)/kernel/drivers/net/wireless/8821ce.ko
pHeLiOn
  • 1,778
  • 3
    Hi you absolutely don't need to disable secure boot or EFI AFAIK https://blog.ubuntu.com/2017/08/11/how-to-sign-things-for-secure-boot – MrMesees Oct 18 '18 at 16:06
  • I can confirm that this works on a hp convertible x360 11 inch – Niel de Wet Dec 01 '18 at 12:30
  • 5
    Confirm that your system uses the RTL8821CE chip using lspci -nnk – Niel de Wet Dec 01 '18 at 12:32
  • 5
    make sure SecureBoot is Disabled essential! Thanks – Duncanmoo Apr 03 '19 at 14:24
  • 1
    Thanks so much @tomaspinho and all! Works for hp 255 G7/ubuntu 18.04.2 lts – Asalle May 01 '19 at 13:21
  • Confirmed working on Desktop HP All-in-One 24-f0341ns, Ubuntu 18.04 64 bits. Thanks a lot. My dmesg shows some 8821ce: module verification failed: signature and/or required key missing - tainting kernel message, but it works. SecureBoot is disabled at BIOS. – Sopalajo de Arrierez May 20 '19 at 22:17
  • Got it working on Ubuntu 16.04.6. –  Dec 22 '19 at 23:00
  • 1
    Please excuse my ignorance but how am I going to run the sudo apt-get install ... command on a machine with one wifi chipset for which I want to install the drivers? My HP laptop has one network card and it doesn't work. –  Jan 06 '20 at 21:48
  • 1
    Still works on Ubuntu 20.04, thanks a lot. Secure boot needs to be disabled indeed, I haven't tried the suggested link ( but hopefully make time someday) to sign the module. Concrete examples appreciated! – Vincent Gerris Mar 21 '20 at 01:15
  • I installed this driver 6 months ago but two times (including today) it mysteriously just stopped working (on ubuntu 18). A clean install + disable secure boot got it working again. Is there STILL no official fix for this driver? – Johan Jul 08 '20 at 08:29
  • Works great. I simply plugged my Android phone into my laptop and turned on Settings > More > Tethering > USB tethering to share internet so I could run the commands. I didn't have to manually sign just enter a password on DKMS install then reboot and "Enroll MOK" and enter the password. – dw1 Aug 17 '21 at 06:12
19

@pHeLiOn's answer helped me out, but it wasn't enough. So here is exactly what I did to get it working on my HP.

Make sure to remove the driver if you have previously unsuccessfully installed it via sudo ./dkms-install.sh and then the directory rm -rf rtl8821ce. It may be located in cd /var/lib/dkms/, delete it there too.

  1. I disabled secure boot (you need to reboot after this command and enter the password chars on the blue screen):

    sudo mokutil --disable-validation
  2. I upgraded the Kernel from 4.15 to 4.18, cuz for some reason it wouldn't work with 4.15. Use uname -a to check your kernel version.

    sudo apt install linux-generic-hwe-18.04
    sudo apt update && sudo apt upgrade -y
  3. Then I reinstalled the dkms headers:

    sudo apt-get install --reinstall git dkms build-essential linux-headers-$(uname -r)
  4. I pulled the github respiratory:

    git clone https://github.com/tomaspinho/rtl8821ce
  5. Entered the new directory:

    cd rtl8821ce
  6. I changed the the file permissions:

    chmod +x dkms-install.sh
    chmod +x dkms-remove.sh
  7. I synced the driver to the correct kernel version:

    make
    sudo make install
  8. I installed the driver:

    sudo ./dkms-install.sh
  9. Finally I rebooted, and to my amazement it worked.

Additionally I changed my PCIe Activate State Power Management as suggested in the github respiratory.

  • 2
    many thanks for posting this. From all the fixes I tried, this is the only one which worked perfect with very clear explanations.!! I should have put 10 ups! – gusv2000 Aug 28 '19 at 02:49
  • 1
    amazing answer the same thing happens to me and thanks to this i fixed it thanks – Alex Rivas Dec 08 '19 at 06:04
  • I created an account just to thank you for this. This is my first experience with Linux, and... well, you can imagine. Thanks for the awesome help! – Ender Dec 29 '19 at 00:43
3

The commands in the post just before this were correct except for the git pull. There is a username and password authentication requirement so you have to just go to the webpage -- https://github.com/tomaspinho/rtl8821ce -- and download the .zip file. I then tried following through with changing the shell files to executable as suggested but when they ran there was a discrepency as to where the files needed to be located. (Im definitely not complaining, it can just be a bit confusing if you didn't really know what you were doing) The files need to be extracted to /usr/src/rtl8821ce-1.0.0 (make a new directory "rtl8821ce-1.0.0" inside /usr/src) and THEN chmod +x dkms-install.sh, everything should work out like gravy from there. Thank you so much whoever wrote this script. I dumped about 600 dollars into this badass machine and was thinking the wifi wouldn't work. Cheers.

To be specific, the machine is a new HP Pavilion x360 2-in-1 with windows 10 and ubuntu studio 18.04.