Tuesday, March 25, 2025

Setting up a FreeBSD WIFI connection for RealTek 8821CE Chipset

 Setting up a FreeBSD WIFI connection for RealTek 8821CE Chipset

To get the Realtek RTL8821CE WiFi card working on FreeBSD, you’ll need to use the rtw88 driver, which supports this chipset, along with the appropriate firmware. Below is a step-by-step guide based on the current state of FreeBSD as of March 22, 2025. Note that this process assumes you’re running FreeBSD 14.0 or later, as support for RTL8821CE has improved in recent releases.   
Freebsd.org/where Get RELEASE 14.2 or newer  Here look for an image file to write to a usb flash device disk drive stick.
 FreeBSD CLI command to see what wifi chipset device you have and network connection
pciconf -lv | grep -A4 network
 Grok  Share link below
https://x.com/i/grok/share/OTZkqixA4P1FI2lMA9j29tYzm 
 
To get the Realtek RTL8821CE WiFi card working on FreeBSD, you’ll need to use the rtw88 driver, which supports this chipset, along with the appropriate firmware. Below is a step-by-step guide based on the current state of FreeBSD as of March 22, 2025. Note that this process assumes you’re running FreeBSD 14.0 or later, as support for RTL8821CE has improved in recent releases.

1. Verify Hardware Detection
First, confirm that FreeBSD detects your RTL8821CE card. Run the following command in a terminal:
pciconf -lv | grep -A4 network
Look for an entry mentioning "Realtek" and "RTL8821CE" (device ID 0xc821). If it’s listed as a network controller but not yet functional, it’s recognized but needs the driver and firmware loaded.
2. Check for the rtw88 Driver
The rtw88 driver, which supports the RTL8821CE, is included in FreeBSD’s kernel as of version 13.1 and later. To see if it’s available, check for the kernel module:
ls /boot/kernel | grep if_rtw88.ko
If the file exists, the driver is part of your system. If not, you may need to update your FreeBSD installation to a version that includes it (e.g., 14.0 or higher).
3. Install the Firmware
The rtw88 driver requires firmware to operate the RTL8821CE. FreeBSD provides this through the wifi-firmware-rtw88-kmod package. Install it with:
sudo pkg install wifi-firmware-rtw88-kmod
This package includes firmware files like rtw88/rtw8821c_fw.bin, which is specific to the RTL8821CE chipset. After installation, the firmware files will be placed in /boot/modules.
4. Load the Driver and Firmware
Load the rtw88 driver manually to test it:
sudo kldload if_rtw88
If your system has more than 4GB of RAM (common on modern machines), you’ll also need to set a loader tunable to ensure proper memory allocation for the driver. Edit /boot/loader.conf (create it if it doesn’t exist) and add:
compat.linuxkpi.skb.mem_limit="1"
Then reboot your system to apply this change:
sudo reboot
After rebooting, the driver should autoload via devmatch (enabled by default in /etc/rc.conf). To confirm it’s loaded, run:
kldstat | grep rtw88
You should see if_rtw88.ko listed.
5. Configure the WiFi Interface
Once the driver and firmware are loaded, a WiFi interface (e.g., rtw880) should appear. Check with:
ifconfig
If you see an interface like rtw880, create a WLAN interface:
sudo ifconfig wlan0 create wlandev rtw880
Connect to your WiFi network by editing /etc/wpa_supplicant.conf with your network details:
network={
    ssid="YourNetworkName"
    psk="YourPassword"
}
Then bring up the interface:
sudo ifconfig wlan0 up
sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &
Obtain an IP address via DHCP:
sudo dhclient wlan0
6. Automate at Boot
To make this persistent, add the following to /etc/rc.conf:
wlans_rtw880="wlan0"
ifconfig_wlan0="WPA DHCP"
This ensures the interface is created and configured automatically on boot.
7. Troubleshooting
  • Driver Not Loading: If kldload if_rtw88 fails, ensure the firmware is installed and the module is present in /boot/kernel.
  • No Firmware Errors: Check dmesg for messages like "failed to load rtw88/rtw8821c_fw.bin". Reinstall the firmware package if needed.
  • Performance Issues: The rtw88 driver is still under development and may not be fully stable. If you encounter stalls or disconnects, try setting these sysctls:
    sudo sysctl compat.linuxkpi.rtw88_pci_disable_aspm=1
    sudo sysctl compat.linuxkpi.rtw88_disable_lps_deep=1
    These disable power-saving features that can cause issues.
Notes
  • The rtw88 driver supports RTL8821CE, but it’s not perfect yet. Some users report intermittent connectivity, especially on systems with more than 4GB of RAM, hence the mem_limit tunable.
  • If this doesn’t work, consider the wifibox project, which runs a Linux WiFi driver in a virtualized environment on FreeBSD. It supports RTL8821CE but requires more setup (see GitHub: pgj/freebsd-wifibox-alpine).
This should get your RTL8821CE working on FreeBSD with the right settings and firmware! Let me know if you hit any snags.

Friday, March 14, 2025

Ntpd Network Time Protocol Dameon setup in GhostBSD 25 install

Ntpd  Network Time Protocol Dameon setup in GhostBSD 25 install

 Kuntal S Kundu 🐧, [3/14/25 10:34 PM]

ntpd service was not enabled on start up, and the timezone (idk) was set to utc! (I selected India during installation!. and after log in into system it was showing correct time too!) so I first enabled ntpd, then run sudo tzsetup and set India from UTC. rebooted and boom
Solution?   ntpd was "yes" in rc.conf but not enabled

 FreeBSD Handbook

32.12.1.2. NTP entries in /etc/rc.conf

 

32.12.1.2. NTP entries in /etc/rc.conf

Set ntpd_enable=YES to start ntpd at boot time. Once ntpd_enable=YES has been added to /etc/rc.conf, ntpd can be started immediately without rebooting the system by typing:

# service ntpd start

Only ntpd_enable must be set to use ntpd. The rc.conf variables listed below may also be set as needed.

Set ntpd_sync_on_start=YES to allow ntpd to step the clock any amount, one time at startup. Normally ntpd will log an error message and exit if the clock is off by more than 1000 seconds. This option is especially useful on systems without a battery-backed realtime clock.

 

Reasons to try and test drive GhostBSD from a USB flash drive stick

Kuntal S Kundu 🐧, [3/14/25 10:34 PM]
ntpd service was not enabled on start up, and the timezone (idk) was set to utc! (I selected India during installation!. and after log in into system it was showing correct time too!) so I first enabled ntpd, then run sudo tzsetup and set India from UTC. rebooted and boom

Kuntal S Kundu 🐧, [3/14/25 10:34 PM]
ntpd was "yes" in rc.conf but not enabled

Kuntal S Kundu 🐧, [3/14/25 10:43 PM]
yesterday I had installed the ghostbsd, but lots of issues like tzsetup, screen tearing, appimage incompatibility made me to take decision of wiping out it and reinstall debian. But later I think again about ghostbsd, and I decided to take the challenge, so I installed it again today
 
Challenge Test Drive GhostBSD  25p2   ghostbsd.org/download 
 

manually  run update clock on system without a realtime clock like the raspberry Pi

NTPD,  NTPDATE   ntpd -q -g       or How to update, when clock is years off kilter, time? 

service ntpd start   #  another method from command line to start ntpd daemon 




 
 Setup NTPD  daemon for GhostBSD in  /etc/rc.conf file
 

Tuesday, March 28, 2023

ZPOOL create ZFS create How to use Disk Partitions in Single DISK ZFS setup

ZPOOL create    ZFS create  How to use Disk Partitions in Single DISK ZFS setup 

URLs to Read. For you to gain understanding.  Takes time to Learn well
:

https://unix.stackexchange.com/questions/672151/create-zfs-partition-on-existing-drive   Create ZFS Partition on existing disk  like  /dev/sda3 

https://docs.oracle.com/cd/E19253-01/819-5461/gaynr/index.html  Create a ZFS root pool  Oracle Docs on ZFS Zettabyte File System
https://github.com/openzfs/zfs  OpenZFS  Readme.md file


  
What I want to do with my ZFS disk system.  I am using UEFI GPT, two partitions one for root /dev/sda5, one larger for home /dev/sda6 .   Boot from the ESP EFI FAT32 /EFI/freebsd/bootx64aa.efi  into the ZFS file system on a Raspberry Pi 4B with 8 gigabytes of dram memory.  I want 50 -80 GB for the root "/"  disk space.   I want 130-180 GB for the home "/home"  "/usr/ports" "/usr/home" "/usr/src"   "/home" is symbolic link to "/usr/home" 

  I am using rEFInd EFI app to select which operating system to boot on the Raspberry Pi.  I would like to boot  PuppyLinux Raspup 32bit, POP!_OS ARM64, Manjaro ARM64,  and other test arm64 OS like Raspberry Pi OS.
 
forums.freebsd.org 


https://lists.freebsd.org/archives/freebsd-arm/  FreeBSD arm mailing list subscribe



Thursday, March 23, 2023

Creating a tiny new GhostBSD package for sharing with others

 Creating a tiny new GhostBSD / FreeBSD package for sharing with others, GURUs Generate_User_Report_for_Upload

 Here is an example of creating a FreeBSD style package, read some URLs

 
Insert this file to start your journey.  Copy and paste into tmp_stage.sh ;  chmod u+x tmp_stage.sh ;  sh ./tmp_stage.sh
 
 
#!/bin/sh

STAGEDIR=/tmp/stage
rm -rf ${STAGEDIR}
mkdir -p ${STAGEDIR}

cat >> ${STAGEDIR}/+PRE_DEINSTALL <<EOF
# careful here, this may clobber your system
echo "Resetting root shell"
pw usermod -n root -s /bin/csh
EOF

cat >> ${STAGEDIR}/+POST_INSTALL <<EOF
# careful here, this may clobber your system
echo "Registering root shell"
pw usermod -n root -s /bin/sh
EOF


https://github.com/freebsd/pkg  Github has some good reading too.
 
https://stackoverflow.com/questions/4602977/freebsd-pkg-create-how-to Kind of Sparse as an example.  May be of future use


https://forums.freebsd.org/threads/where-does-make-package-put-the-pkg-file.73535/  Helpful example of creating a package   "pkg help create"

https://forums.freebsd.org/threads/creating-a-pkg-with-pkg-create.88358/  FreeBSD forum post that I followed and put a link to this blog.



https://docs.freebsd.org/en/books/porters-handbook/plist/#plist-keywords  Yes the learning curve is too damned steep to accomplish a very simple task of creating a binary package from these 7 files:

    ./share/applications/generate_user_report.desktop #Desktop application file
    ./lib/guru/Makefile #Makefile
    ./lib/guru/README.md #Standard Readme file written in MarkDown language
    ./lib/guru/Report_fred-ghostbsd-pc1_2020-04-05_example.txt #Example Report.txt File created from User_Report.sh file
    ./lib/guru/User_Report.py #Python script file to create the GUI interface with a couple buttons
    ./lib/guru/User_Report.sh #Shell Script file
    ./lib/guru/applets-screenshooter.png #Icon file



No creation of these files from a Makefile is needed.  I included a sample Makefile.

Freebsd pkg #manifest
Best simple use of "pkg create" tool Best description on the web
Packaging setup, usage, and explanation
How to make a binary package, using FreeBSD tools
Quick Porting example from Porters Handbook

https://forums.freebsd.org/threads/creating-a-pkg-with-pkg-create.88358/#post-602161 Pat Maddox March 2023 help with pkg creation
Section 3.2..2 porting pkg plist

Monday, February 6, 2023

Rice your PC to a Red Ferrari GhostBSD in 10 minutes flat!

Rice your PC to a Red Ferrari GhostBSD in 10 minutes flat!  



Enhance your PC from a Ford Festiva to a Red Ferrari.  

Test drive Ghostbsd.org/download  "latest" version in 10 minutes flat!    

 

This could be the most fun-to-drive Ferrari ever made

Fun to drive Yellow Ferrari 296 GTB:
Small but beautiful, the $568,300 petrol-electric 296 GTB is a triumph of design, super fast and may become as legendary as the fabled Dino.

Now that you are excited about an expensive car, lets go to the other end of price spectrum to nearly FREE and pull ourselves up out of the PC computer Windows(TM) Hole by our BOOTstraps ,  into a RICED RED gleaming fast GhostBSD operating system test drive in 10 minutes!   You do have 10 minutes to spare, correct?


https://ventoy.net/en/index.html  Here download and create a USB flash drive with Ventoy applications.   https://ventoy.net/en/doc_start.html  Windows and Linux users

Place  GhostBSD.org/download  "latest" February 2, 2023 version and a copy of a puppy linux image, too.   on the Ventoy USB flash drive
 
Now Boot from Ventoy USB Flash drive and select GhostBSD image to boot in your 4GB of dram memory the "live image".   No need to install first.  The GhostBSD.ISO image is copied into dram and run from dram memory.   After booting GhostBSD, pull the USB flash drive out from the computer.  It is not needed anymore.
Use the NetworkMgr  to connect via ethernet or via wifi.
 
pkg install  hw-probe
 
hw-probe -all -uploade    Create an entry to bsd-hardware.info  see an inventory of your computer and what BSD  device drivers exist for your PC hardware.

When you do wish to install to hard drive or ssd,  click on the GBI app icon. GhostBSD Installer and answer some questions.

 


 

Tools to write image or .ISO file to a USB Flash drive:

Here at balena we have thousands of users working through our getting started process and until recently we were embarassed about the steps that involved flashing an SD card. There was a separate track for each Mac/Windows/Linux and several manual and error-prone steps along the way.

To our surprise there was nothing out there that fit our needs. So we built Etcher, an SD card flasher app that is simple for end users, extensible for developers, and works on any platform.


Create bootable USB drives the easy way

Rufus is a utility that helps format and create bootable USB flash drives, such as USB keys/pendrives, memory sticks, etc.

It can be especially useful for cases where:

  • you need to create USB installation media from bootable ISOs (Windows, Linux, UEFI, etc.)
  • you need to work on a system that doesn't have an OS installed
  • you need to flash a BIOS or other firmware from DOS
  • you want to run a low-level utility

Despite its small size, Rufus provides everything you need!



Win32DiskImager open source tool to write .ISO files to USB Flash drive or microSD card

This program is designed to write a raw disk image to a removable device or backup a removable device to a raw image file. It is very useful for embedded development, namely Arm development projects (Android, Ubuntu on Arm, etc). Anyone is free to branch and modify this program. Patches are always welcome.

This release is for Windows 7/8.1/10. It will should also work on Windows Server 2008/2012/2016 (although not tested by the developmers). For Windows XP/Vista, please use v0.9 (in the files archive).

Can't Format USB Drive in Windows 10 BRITEC09 6 minute video