box.matto.nl
Enjoying Open Source Software

FreeBSD 11 on Raspberry Pi

You will need a USB-keyboard, HDMI-cable and a monitor or TV to be able to show HDMI signal to make ssh connection possible on your FreeBSD running Raspberry Pi.

Install FreeBSD 11 on a Raspberry Pi

It seems a nice project to try out FreeBSD on a Raspberry Pi.

There are ready made images available from FreeBSD.org, so this is not very hard to accomplish. Both for FreeBSD 10 as well as for FreeBSD 11. Feeling wild, I choose for FreeBSD 11 :)

The image can be downloaded from the FreeBSD ftp-servers.

Bunzip your image and dd it to a SD-card

I got the FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20140811-r269824.img.bz2 but perhaps when you read this there are already newer images available.

On a Debian GNU/Linux laptop I ran the command:

bunzip2 FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20140811-r269824.img.bz2 

Followed by:

dd if=FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20140811-r269824.img of=/dev/mmcblk0 bs=1M

Be careful when you issue this last command, when you got the of= part wrong, you might irreversible destroy things!

Now you have a 1Gb big image on your SD card.

Put the SD card in the Raspberry Pi and power up.

The very first time you boot FreeBSD on your Raspberry Pi it seems to take ages before you get a prompt. This is because FreeBSD is expanding the partition to fill your whole SD card. In my case it was a 8 Gb SD card. I rebooted the thing and now it did not take that long to give you a prompt.

When you have a prompt, press enter and log on as root, with an empty password (just hit Enter on the password prompt).

Now you first need to add a user, make that part of the group "wheel" and give this user a password. This is needed in order to log on to your FreeBSD Raspberry Pi over ssh.

Set fixed address

Default your FreeBSD Raspberry Pi will get its network configuration over DHCP. This is great if you want that, but I like my servers to have fixed addresses.

In /etc/rc.conf you can set the fixed address of the board and add a line with the default router:

ifconfig_ue0="inet 192.168.0.123 netmask 255.255.255.0"
defaultrouter="192.168.0.1"

Do not forget to check /etc/resolv.conf to see if this has the right nameserver(s).

Set timezone

Become root.

Make a symbolic link for your timezone to /etc:

ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

Update the time on your board;

ntpdate -v -b in.pool.ntp.org

And edit /etc/rc.conf, add the following line:

ntpdate_enable="YES"
ntpd_enable="YES"

Configure sshd

When your Raspberry Pi is connected to the internet, it is important to harden your sshd_config. The best is to disable password login, only allow public key authentication and only for restricted users. Something like "Match Group wheel" is a good start.

No pkg install

Unfortunately, installing pre-compiled binary packages with the new pkg will not work on your Raspberry Pi.

Hardware stability is an issue

I own several Raspberry Pies and not all of them are stable. Also the Raspberry Pi is notorious picky about the powersupply cable (USB cable) as well as the power supply. Problems with the power supply cable and the power supply are hard to diagnose.

If you run into problems, the USB cable and the power supply are the first things to check. I have seen Raspberries that, when powered on, only show a single, red, LED burning, with all the other LEDs are off. This often is the result of a USB-cable or power supply not playing nice with the Raspberry - even if the same combination have run without problems for weeks.

On the other hand, there are also a couple Raspberries running in my network with high uptimes and never have shown any problem ...

Tags:

⇽ Jails with nullfs mount of base system on FreeBSD 10 without buildworld $HOME in ramdisk on FreeBSD ⇾