Installing FreeBSD 15 on my old MSI laptop
Ever since I found out about FreeBSD, I’ve wanted to try it on one of my old laptops that I keep around for testing operating systems. Why? Because it’s an Unix system and it’s not Linux. Actually, I might be wrong but, I think FreeBSD has more in common with modern macOS than most Linux distributions.
So since I really like working with Unix systems, FreeBSD has been on my list for a long time, but I never had time to get around installing it. Today is the day! FreeBSD 15 was just recently released, and in theory it should run just fine on the old MSI laptop I have at home (with an Intel processor and Intel integrated graphics).
Creating a bootable USB stick with Mac OS
First step will be to create a bootable stick on my Mac. This part is easy and you don’t need any extra software, but you have to be careful to format the right drive (the USB stick), and not your system drive.
First find your USB stick:
diskutil list
It will have the words (external, physical) right next to it. On my end it looks like this:
/dev/disk4 (external, physical)
Subsequently, unmount the disk, so it’s “inactive” before we write to it (make sure you replace /dev/disk4 with the correct number):
diskutil unmountDisk /dev/disk4
Then, you can finally write the iso image to the USB stick by using the dd command:
sudo dd bs=4m if=FreeBSD-15.0-RELEASE-amd64-dvd1.iso of=/dev/disk4 status=progress
A few notes:
- You’ll need sudo to run this.
- bs sets the block size to 4 megabytes per write.
- status=progress shows how much data has been copied, which makes it easier to see what’s happening.
Installing FreeBSD
Actually in the past I installed FreeBSD 14 once, but I gave up because I couldn’t get a desktop environment working. I got stuck on the nVidia driver setup. FreeBSD 15 feels a bit different right from the start. The installer now shows a mouse cursor!
First you will be asked by the installer the keyboard settings - I just leave the defaults and usually change those after installing the system. For the hostname you can enter something simple like “freebsd” (once in the past when I left it empty, by wifi card couldn’t establish a connection with the network).
One new step compared to 14 is when the installer asks whether you want to use the traditional distribution sets or the new package based method (still marked as a tech preview). This change was mentioned on the release page. FreeBSD 15 introduces a new way to install and manage the base system through pkg. In older releases the base system wasn’t handled like normal packages, but now it can be. The old method is expected to be removed in FreeBSD 16, so I decided to try the new one (please see the screeshot below).
After that, you will get asked to configure WiFi so the installer can fetch and install packages.
Next comes partitioning - I choose ZFS (Stripe).
Then, the installer will ask if we want to install any additional packages - I choose only “base”.
After the installation, the installer will ask what services to run on start, I choose to run the sshd service on start. I do so because after installation, I want to ssh into my FreeBSD from my Mac so I can configure drivers and the desktop environment.
Finally once that is completed, you can create a user for yoursulf and add it to the wheel group. This is similar to giving your user sudo rights. Then reboot.
Configuring KDE Plasma on FreeBSD
I start by logging into my FreeBSD as root and installing vim:
pkg install vim
Then, I am going to enable root login over SSH in the sshd_config:
vim /etc/ssh/sshd_config
Find this line, remove the comment and change to “Yes”:
# PermitRootLogin no
BTW. Allowing root login isn’t something you would do on a machine exposed to the internet - we are going to connect over WiFi only. Now, after changing that file, you’ll need to restart sshd:
service sshd restart
Now, considering that FreeBSD is connected to the same Wifi as your other computer, you can get its local IP address with:
ifconfig
The look for something like
wlan0: inet 192.168.x.x
Then connect from your other computer:
ssh [email protected]
From here we can follow the FreeBSD Handbook (which is absolutely great BTW).
We will be installing 3 things:
- Drivers
- The X Window System
- Plasma Desktop environment
First, find out what GPU you have:
pciconf -lv | grep -B3 display
Then you can use this command to install the GPU drivers:
pkg install drm-kmod
This is a FreeBSD command that covers drivers for AMD/Intel graphics.
Then, add the right kernel modules to the /etc/rc.conf file:
sysrc kld_list+=i915kms
This example is for Intel. Check the Handbook if you have other hardware.
Now we can finally install the X Window System:
pkg install xorg
Next, we will add our user to the group “video”, and install sudo, so we can run sudo commands as our user
pw groupmod video -m username
pkg install sudo
Since we’ve already added our user to the wheel group (the wheel group is a special user group in FreeBSD that is a little bit like sudo in Linux), we will now also allow users from that group to use the sudo command without a password: So run:
visudo
and then uncomment this part:
# %wheel ALL=(ALL:ALL) NOPASSWD: ALL
OK, now we are finally going to install the desktop environment, so go ahead and run this command:
pkg install kde
Next, enable D-BUS service in /etc/rc.conf to start at system boot:
sysrc dbus_enable="YES"
KDE Plasma needs larger message sizes to run properly:
sysctl net.local.stream.recvspace=65536
sysctl net.local.stream.sendspace=65536
Starting KDE Plasma
This part is also covered in the FreeBSD handbook. KDE Plasma uses SDDM as its display manager. It handles the login screen and starts your desktop session, so you don’t have to type startx every time.
pkg install sddm
Then enable the service so it starts automatically on boot:
sysrc sddm_enable="YES"
Et voilà! Now after the reboot you should see the KDE Plasma login screen.
First impressions
First of all I am surprised by how smoothly everything went and how well the FreeBSD Handbook walks you through the process - I not even once had to search for help on forums. And it’s fast! I feel like websites in Firefox open very quick, maybe because of lack of all the unnecessary bloat running in the background, which takes me to my second point: FreeBSD feels very simple. Perhaps the lack of extra apps and AI features can actually help you stay focused and get your work done.
My next step is to start using FreeBSD for work and learn Jails. Stay tuned for future updates.