Here are my steps of running and troubleshooting 14.1-RELEASE on RPI4 (Firmware updated for USB boot, tested with external USB-SSD with RTL9210B).
My goal is to duplicate usability to match a linux system which is being used as DNS cache, NAS, and display btop output for other systems.
1. Download compressed image and CHECKSUM file, and test the image is not corrupted.
# shasum -a 512 --ignore-missing -c CHECKSUM.SHA512-FreeBSD-14.1-RELEASE-arm64-aarch64-RPI
2. Load image on SSD by image writer on Ubuntu 22.04.
3. After booting, root:root or freebsd:freebsd is already present and logged in as root. System greets with some suggestions like checking version (uname -a) and updating repo (pkg update). Change default root and freebsd user password.
# passwd
# uname -a
# pkg update
At this point, I had an error 'Certificate verification failed'.. It also says there's no prebuilt pkg available. But portsnap is unavailable too.
The error was showing for every single certificate for a fresh image.
After setting a correct date, it worked.
# date 202406081200
4. Getting some tools
# pkg install sudo vi nano bash
5. Add user and give permission, removed comment from '%wheel' line
# adduser
# nano /usr/local/etc/sudoers
# pw groupmod wheel -m myusername
# cat /etc/group | head
The line containing wheel shows myusername added at the end.
Login as myusername, and test 'sudo ls' works.
6. Get package manager
# pkg install portsnap
# portsnap fetch extract
Complains that directory does not exist.
# mkdir -p /var/db/portsnap
Portsnap is not included in base anymore as git will be used from 14.0 on (https://forums.freebsd.org/threads/portsnap-and-git-getting-ports.82833/).
7. Getting GUI and desktop manager, enable it, start services (Retract or ignore this step for headless system)
# pkg install xorg xfce lightdm lightdm-gtk-greeter
# echo 'dbus_enable="YES"' >> /etc/rc.conf
# echo 'hald_enable="YES"' >> /etc/rc.conf
# echo 'lightdm_enable="YES"' >> /etc/rc.conf
# service dbus start
# service hald start
# service lightdm start
Starting hald gets it to complain: hald does not exist in /etc/rc.d or the local startup directories, or is not executable.
# ls /usr/local/etc/rc.d
Showed that it indeed does not exist. According to this post there is no need to enable hald anymore as devd is used to detect devices in xfce (https://forums.freebsd.org/threads/question-over-etc-rc-conf-and-hald_enable.52967/).
Reboot and logging in as newly created user shows that desktop environment loads okay for root, but not for user when startx was invoked.
# echo "exec startxfce4" > ~/.xinitrc
Reboot and now gui shows up on boot. But the resolution is quite low at this point. I won't be looking for wrapper or prioritary binaries since this RPI will be headless once configuration is complete. For output, I will workaround the terminal output (tmux) and script that into html to check it from other system.
8. Setting up DNS cache
# pkg install unbound
Edit /usr/local/etc/unbound/unbound.conf
server:
interface: 0.0.0.0
access-control: 192.168.9.0/24 allow
verbosity: 1
forward-zone:
name: "."
forward-addr:8.8.8.8
forward-addr:8.8.4.4
Instead of echoing, sysrc can be used to enable unbound on startup.
# sysrc unbound_enable="YES"
# service unbound start
Test whether DNA cache works using dig.
# dig @127.0.0.1 somewebsite.com
Dig was not found (https://forums.freebsd.org/threads/where-is-dig.49265/) use drill instead.
# drill @127.0.0.1 somewebsite.com
Previously, Query time was 3+ms, now it shows 0ms. Set the DNS server to this RPI.
9. Setting up NAS
# pkg search samba
# pkg install samba419
# mkdir -p /srv/samba/share
# chown -R nobody:nogroup /srv/samba/share
# chmod -R 0775 /srv/samba/share
Update configuration file for samba at /usr/local/etc/smb4.conf
An example configuration file is seen here (https://minnie.tuhs.org/Blog/2019_06_27_FreeBSD_NAS.html).
[global]
workgroup = WORKGROUP
server string = FBSD14RPI4SMB
netbios name = rpi4
security = user
map to guest = Bad User
[share]
path = /srv/samba/share
browseable = yes
writable = yes
guest ok = yes
create mask = 0775
directory mask = 0775
Enable samba and add user.
# sysrc samba_server_enable="YES"
# service samba_server start
# pdbedit -a mysambausername
At this point, I was able to access the share from Ubuntu 22.04, but unable to create or read anything.
Updated configuration file and checked attributes (https://forums.freebsd.org/threads/...n-privilege-changed-since-update.90685/page-2) where the issue persist.
Cat works, but no touch to create new files, saying permission denied.
On server side 775 permission is visible, as per config and actual file attributes. On client side, it shows as 700.
On server side nobody:nogroup ownership is visible, but client side shows mysambauser:mysambauser.
Since this NAS is configured locally, dropped all security as per (https://www.server-world.info/en/note?os=FreeBSD_14&p=samba&f=1). and Now rw access is available from other systems.
# create new
[global]
unix charset = UTF-8
workgroup = WORKGROUP
server string = FreeBSD
# network range you allow to access
interfaces = 127.0.0.0/8 10.0.0.0/24
bind interfaces only = yes
map to guest = bad user
# any Share name you like
[Share]
# specify shared directory
path = /home/share
# allow writing
writable = yes
# allow guest user (nobody)
guest ok = yes
# looks all as guest user
guest only = yes
# set permission [777] when file created
force create mode = 777
# set permission [777] when folder created
force directory mode = 777
Thank you for any comments and suggestions!
My goal is to duplicate usability to match a linux system which is being used as DNS cache, NAS, and display btop output for other systems.
1. Download compressed image and CHECKSUM file, and test the image is not corrupted.
# shasum -a 512 --ignore-missing -c CHECKSUM.SHA512-FreeBSD-14.1-RELEASE-arm64-aarch64-RPI
2. Load image on SSD by image writer on Ubuntu 22.04.
3. After booting, root:root or freebsd:freebsd is already present and logged in as root. System greets with some suggestions like checking version (uname -a) and updating repo (pkg update). Change default root and freebsd user password.
# passwd
# uname -a
# pkg update
At this point, I had an error 'Certificate verification failed'.. It also says there's no prebuilt pkg available. But portsnap is unavailable too.
The error was showing for every single certificate for a fresh image.
After setting a correct date, it worked.
# date 202406081200
4. Getting some tools
# pkg install sudo vi nano bash
5. Add user and give permission, removed comment from '%wheel' line
# adduser
# nano /usr/local/etc/sudoers
# pw groupmod wheel -m myusername
# cat /etc/group | head
The line containing wheel shows myusername added at the end.
Login as myusername, and test 'sudo ls' works.
6. Get package manager
# pkg install portsnap
# portsnap fetch extract
Complains that directory does not exist.
# mkdir -p /var/db/portsnap
Portsnap is not included in base anymore as git will be used from 14.0 on (https://forums.freebsd.org/threads/portsnap-and-git-getting-ports.82833/).
7. Getting GUI and desktop manager, enable it, start services (Retract or ignore this step for headless system)
# pkg install xorg xfce lightdm lightdm-gtk-greeter
# echo 'dbus_enable="YES"' >> /etc/rc.conf
# echo 'hald_enable="YES"' >> /etc/rc.conf
# echo 'lightdm_enable="YES"' >> /etc/rc.conf
# service dbus start
# service hald start
# service lightdm start
Starting hald gets it to complain: hald does not exist in /etc/rc.d or the local startup directories, or is not executable.
# ls /usr/local/etc/rc.d
Showed that it indeed does not exist. According to this post there is no need to enable hald anymore as devd is used to detect devices in xfce (https://forums.freebsd.org/threads/question-over-etc-rc-conf-and-hald_enable.52967/).
Reboot and logging in as newly created user shows that desktop environment loads okay for root, but not for user when startx was invoked.
# echo "exec startxfce4" > ~/.xinitrc
Reboot and now gui shows up on boot. But the resolution is quite low at this point. I won't be looking for wrapper or prioritary binaries since this RPI will be headless once configuration is complete. For output, I will workaround the terminal output (tmux) and script that into html to check it from other system.
8. Setting up DNS cache
# pkg install unbound
Edit /usr/local/etc/unbound/unbound.conf
server:
interface: 0.0.0.0
access-control: 192.168.9.0/24 allow
verbosity: 1
forward-zone:
name: "."
forward-addr:8.8.8.8
forward-addr:8.8.4.4
Instead of echoing, sysrc can be used to enable unbound on startup.
# sysrc unbound_enable="YES"
# service unbound start
Test whether DNA cache works using dig.
# dig @127.0.0.1 somewebsite.com
Dig was not found (https://forums.freebsd.org/threads/where-is-dig.49265/) use drill instead.
# drill @127.0.0.1 somewebsite.com
Previously, Query time was 3+ms, now it shows 0ms. Set the DNS server to this RPI.
9. Setting up NAS
# pkg search samba
# pkg install samba419
# mkdir -p /srv/samba/share
# chown -R nobody:nogroup /srv/samba/share
# chmod -R 0775 /srv/samba/share
Update configuration file for samba at /usr/local/etc/smb4.conf
An example configuration file is seen here (https://minnie.tuhs.org/Blog/2019_06_27_FreeBSD_NAS.html).
[global]
workgroup = WORKGROUP
server string = FBSD14RPI4SMB
netbios name = rpi4
security = user
map to guest = Bad User
[share]
path = /srv/samba/share
browseable = yes
writable = yes
guest ok = yes
create mask = 0775
directory mask = 0775
Enable samba and add user.
# sysrc samba_server_enable="YES"
# service samba_server start
# pdbedit -a mysambausername
At this point, I was able to access the share from Ubuntu 22.04, but unable to create or read anything.
Updated configuration file and checked attributes (https://forums.freebsd.org/threads/...n-privilege-changed-since-update.90685/page-2) where the issue persist.
Cat works, but no touch to create new files, saying permission denied.
On server side 775 permission is visible, as per config and actual file attributes. On client side, it shows as 700.
On server side nobody:nogroup ownership is visible, but client side shows mysambauser:mysambauser.
Since this NAS is configured locally, dropped all security as per (https://www.server-world.info/en/note?os=FreeBSD_14&p=samba&f=1). and Now rw access is available from other systems.
# create new
[global]
unix charset = UTF-8
workgroup = WORKGROUP
server string = FreeBSD
# network range you allow to access
interfaces = 127.0.0.0/8 10.0.0.0/24
bind interfaces only = yes
map to guest = bad user
# any Share name you like
[Share]
# specify shared directory
path = /home/share
# allow writing
writable = yes
# allow guest user (nobody)
guest ok = yes
# looks all as guest user
guest only = yes
# set permission [777] when file created
force create mode = 777
# set permission [777] when folder created
force directory mode = 777
Thank you for any comments and suggestions!