FreeBSD on the desktop? Am I crazy?
As you can tell, I've been busy both with work and with things that nerds do for fun. As for the latter, one of my long-term ToDo items was to evaluate whether FreeBSD can serve my needs on the desktop, maybe even on the laptop. I have always had plenty of FreeBSD servers running. But on the desktop, it has only been Linux for me -- for a number of years now.
Well, that has changed! In fact, I am typing this article on my FreeBSD 10.1 desktop. Yes, that's right. It certainly wasn't an easy journey, and I'm tempted to say do not try this at home to anybody who isn't going to leverage any of FreeBSD's strong points. Definitely don't try FreeBSD on the desktop if you haven't used it on servers or virtual machines before. It's got less in common with Linux than you might think.
So, why did I do it?
Let me list a few reasons without any particular order:
- FreeBSD is tidy. You have a base system with everything that is needed for the operating system to function, and you have lots of ports. There's a very clean separation between the two, and in FreeBSD there is never ever going to be a situation where it's unclear which file belongs where or which package has installed it. The file system structure is very clear and consistent.
- FreeBSD gives you choices. You can use the new package manager which is much like yum or apt-get (but in my opinion more straight forward), or you can compile things from scratch! Either way, you can easily clean up things that you no longer require, too. For example, at one point I had 8 different windows managers installed while I was checking out which one might be best suited: KDE, Mate (with compiz), Cinnamon, XFCE to name a few. It's relatively easy to work out dependencies and remove them again. I ended up with XFCE and deleted the other 7, including all of their dependencies which weren't otherwise required.
- Ports are far superior to RPMs or DEBs. It is insanely easy to create new or change existing ports if you want to, and bundle your compiled result into packages that you can install elsewhere using “pkg”.
- Init system. Nothing beats FreeBSD here, least of all the new, rapidly spreading disease called systemd! Why overcomplicate something that can be so neat and simple to use? For 10-15 seconds faster boot time? Get out of here! I boot my desktop in the morning, grab a coffee, and am ready to go. The next time I boot it is probably going to be the next morning (if I didn't leave it running over night). I honestly couldn't care less how long it takes.
- Sound system. Pulseaudio? Come on. It sort of sometimes works on Linux these days, but it is a cancerous piece of software not unlike systemd. Hang on a second, the same author is behind it! FreeBSD's OSS seems to be a lot more solid so far.
- ZFS! This blows ext4, software raid and LVM out of the water, in every respect. (Yes, simply put it combines filesystem, volume management and various raid flavours.) Sure, you can have that on Linux too. But ZFS is not very commonly used there (yet), and last time I checked it was a userland filesystem there (may be out of date now), which is the last place you would want to run a filesystem for anything that really matters.
- Community. Granted, the FreeBSD community is relatively small compared to Linux. But they are generally very friendly and extremely helpful.
- FreeBSD forces you to be hands-on. How is that a good thing? Because other systems mostly conceal what's happening behind the scenes and make it increasingly difficult to understand where to look when things go sideways. FreeBSD on the other hand educates the user. This insight quickly develops in better understanding and as a result in an even bigger level of freedom. (You can't make choices when you don't see what options you've got!)
- Jails. Even though you'd be much more likely to use them on a server to encapsulate services from the host, FreeBSD's jails are also excellent for other purposes, for example if you want to quickly check out a program or tool that you are not likely to use again any time soon. Stick it in a jail, and once you're done, you can just wipe it without littering your main system with dependencies.
- BSD licence is truly open and I could do with it whatever I please. I like the philosophy.
This list isn't complete, not even remotely. Also, it's of course very much my personal opinion. Keep in mind that these are only reasons why I considered moving from Linux to FreeBSD on the desktop. On servers there are a bunch of other reasons, like pf, jails, securelevel etc. That's beyond the scope here, though.
Anyway, there were a lot of reasons for me personally to give it a go. And after a few weeks of not booting up Linux on the desktop any more, I can sincerely say that it was worth going down this path. But easy it was not.
Not an easy job!
Overall, the hardest part to get right was graphics performance, or more precisely really annoying screen tearing when scrolling pages or moving windows around. That's something which really annoyed me, given that my graphics card (GTX 780Ti) is rather powerful, and not too young to not be supported properly. On the other hand, the card is probably more commonly found amongst gaming people (I admit, I am a sucker for flight simulators, which is why I bought the card in the first place).
Anyhow, after updating the kernel (thankfully only takes a fraction of time compared to compiling a Linux kernel) and manipulating the nvidia-driver port to use the very latest beta driver from NVidia, plus some serious amount of time spent messing with compton's parameters and a few sysctl's, I eventually managed to get rid of any tearing. XFCE (with compton) is working beautifully in dual screen mode here now. Another contender, which also worked okay was compiz, but I liked XFCE better (I don't care for wobbly windows and all the effects, and without them XFCE is slicker and more flexible).
Another issue I'm still fighting is my USB headset (Turtle Beach Z300). Sound works just fine on them, but I can't seem to get the mic to cooperate. It doesn't matter that much, because I only ever use it on Skype (which I don't like anyway, but work requires me to use it; more on that in a second). However, it would be nice to get that set up eventually. I haven't given up yet, it's just not priority at the moment, because I've got a wired headset in the meantime.
The last problem remaining are my two wireless adapters (one is some rubbish mini PCI card, the other an ASUS USB dongle). Funny thing is that they can both see various networks, some of them rather distant from here, but they can't see my own router. Tethering to my tablet works, though, which is very curious. It's not a massive deal though as I normally use a wired connection. Update: This is no longer an issue. It was merely a configuration issue on the home network, which was running on a channel outside of more common bounds. All working beautifully now, using link aggregation in failover mode so that my wired (powerline, not super reliable) connection can fall over and wireless picks up while keeping the connection intact.
On the software side, everything which I want to work, works, including virtualisation with VirtualBox. (I haven't tested bhyve yet.) And as expected, everything is fast and robust. On a side note, I'm running FreeBSD with ZFS in mirror mode on two Crucial SSDs. Two ZFS mirrors, more precisely. One of them is fully encrypted with geli, the other unencrypted. (There's no point in running everything encrypted, though the performance impact is minimal.)
Now, Skype... There currently isn't a working Skype client available for FreeBSD. There used to be one (version 4.2, which is now banned on Skype's network), which used Linux compatibility libraries. But for 4.3 there is none. There are several options to work around this. One is using Wine, which is a no-go for me personally. The other option, which works flawlessly for me is to use Linux in a virtual machine with Virtualbox, install the Skype client there, and then run the VM in headless mode and use ssh with X11 forwarding to display only Skype on the FreeBSD desktop. The neat part here is that the Skype taskbar icon and the notifications and sound work in FreeBSD too, so that it integrates seemlessly.
Another piece of software (or can I say piece of crap?) that doesn't work properly, if at all, is Adobe Flash. According to various articles out there, two options are apparently available to make it work: The first is using a terribly outdated flash player plugin (really, given the massive amount of security issues with Flash, who would want that?). The other option is using pipelight, which is apparently some sort of Wine wrapper. Doesn't seem to work very well on 64bit though. I wasn't keen enough on Flash to spend time on making it work. My estimate is that more than 90% of the videos I watch online are hosted by Youtube, and that's html5 anyway. If I want to watch actual films, I use my “smart” telly and sit on the couch rather than at my desk :) (So don't ask me if Netflix works on FreeBSD. Probably not.)
So, to cut a very long story short, is getting FreeBSD to work on the desktop worth the effort? Yes! For me anyway. But to go back to the headline... this is not the crazy part! The truly mad bit is that I am half way there to making it work on my laptop, too! I know already that the hardware of my Lenovo X1 Carbon is supported rather well. What I am currently struggling with is power consumption. There's some serious tweaking required, because currently I fall around an hour short of the battery lifetime I get with Linux. This is also noticeable by the amount of fan activity. The other tricky bit will be suspend/resume, I guess, but I haven't gotten around to dealing with that yet. Watch this space for updates in the next weeks or months!