My Experience Switching from Slackware Linux to FreeBSD reddit / BSD ---------------------------------------------------------------------- ewood87 · 2014-08-19 21:29 I've used both FreeBSD and NetBSD professionally on servers for about three years now in addition to the Linux servers I've managed for about 10 years. I have never, until now, considered FreeBSD much in terms of a desktop, let alone mobile, operating system. I've had Slackware Linux running on my IBM Thinkpad X61 for two years now but I always wondered what it would be like to have a real UNIX on a laptop. I've now had FreeBSD ~~8.4~~ 9.3 on my personal laptop exclusively for the last few months and have been, overall, very impressed. The issues I encountered were fewer than I had expected. The primary issues I encountered were around power management and wireless configuration, though not in the ways I expected. FreeBSD recognized my wireless card out of the box but. It took me some time to figure out how to actually use it, though. Once I learned how to alias "wlan0" to "iwn0" and learned the networking tools, I wrote a small script to automate everything a little and I have been using it with little to no issue since. I still have issues every now and again with the wireless interface not finding any networks within range. I do not know enough about the networking tools to know why but it seems to mimic a "count by 0" error I experienced with iwlist.c under slackware (fixed in a version which has been in an non-stable release for many years that Slackware developers will not include until it's marked stable upstream) where iwlist returns no results in areas congested with too many wireless networks. FreeBSD's power management seems to be the weakest spot from my experience. I was able to get it to work with intermittent success. The hardest part was configuring PolicyKit to permit my user access to the power management functions. Once configured, though, things seemed to work. I still have strange issues, which I've yet to fully diagnose, related to permissions in this area, however. I will frequently find my user does not have permission to suspend, hibernate or perform any other functions normally found under the xfce4-power- manage utility. Sometimes this corrects itself after a reboot and sometimes it randomly comes back after I restart X, it does not seem consistent but I suspect it has something to do with a misconfiguration still present with my PolicyKit setup. The previously mentioned items aside, however, I found FreeBSD to be just the same, if not easier in many respects, to use than Slackware. I may ultimately end up switching back in my Slackware hard disk but I felt that this experience was very valuable and definitely helped me learn more about FreeBSD. All that said, if anyone has suggestions on fixes for the aforementioned issues, I would love to hear from you. If I can overcome the shortcomings I've experienced I feel I'd be perfectly happy remaining in the BSD camp full time. **IBM Thinkpad X61** * Core2Duo * 2GB RAM * 500GB HDD * Intel wireless 3945 ---------------------------------------------------------------------- icantthinkofone · 2014-08-19 22:04 Why did you install version 8.4? We'll soon be on version 11 so that's pretty old and your experience would have been even better if you installed version 10. ---------------------------------------------------------------------- [deleted] · 2014-08-19 23:58 [deleted] ---------------------------------------------------------------------- icantthinkofone · 2014-08-20 01:20 Installing it now is not something most of us would want to do but [here it is](https://www.freebsd.org/relnotes/CURRENT/relnotes/article.html). In any case, I've had 9.3 on my current desktop since late last year (?) and I couldn't tell you how long since I've had 8.x so that's why I asked. ---------------------------------------------------------------------- ewood87 · 2014-08-20 01:33 Admittedly I was not not writing this from said laptop and I misspoke. I am actually running v.9.3, not v.8.4. I will correct the post. Regarding the decision not to install v.10. I wanted to but I tried and it kept failing to boot the install media. I tried re-burning the disk, I tried two different download mirrors and I tried booting from a flash drive as well as alternate boot options and it kept hanging. I do not now recall the exact error, though would be willing to give it a try if problems with known workarounds exist. ---------------------------------------------------------------------- [deleted] · 2014-08-20 01:50 [deleted] ---------------------------------------------------------------------- icantthinkofone · 2014-08-20 02:22 iirc, it had just missed the cut off for making it into 10. ---------------------------------------------------------------------- earlof711 · 2014-08-20 03:19 Well now that you're online, you can upgrade to 10.0 with freebsd- update. ---------------------------------------------------------------------- [deleted] · 2014-08-20 11:25 Although you look like an advanced user who likes to get his hands dirty, PC-BSD could save you a lot of trouble with your laptop ---------------------------------------------------------------------- crest_ · 2014-08-20 12:38 Their are no scripts required. FreeBSD already includes the required rc.d scripts to handle everyday 801.11 requirements. sysrc wlans_iwn="wlan0" # Create a wlan0 interface from iwn0 sysrc ifconfig_wlan0="DHCP WPA" # Start wpa_supplicant and dhclient on wlan0 vi /etc/wpa_supplicant.conf # Define settings per ssid Now run (or reboot): ifconfig wlan0 create wlandev iwn0 # devd starts dhclient and wpa_supplicant automatically. Here are some basic power management tips: sysrc -f /boot/loader.conf hint.p4tcc.0.disabled=1 # disable Pentium 4 throttling sysrc -f /boot/loader.conf hint.p4tcc.1.disabled=1 # on both cores sysrc -f /boot/loader.conf hint.acpi_throttle.0.disabled=1 # disable ACPI throttling sysrc -f /boot/loader.conf hint.acpi_throttle.1.disabled=1 # on both cores sysrc -f /boot/loader.conf hw.snd.latency=7 # Decrease wake ups from sound cards sysrc -f /boot/loader.conf hint.pcm.0.buffersize=65536 # Increase audio buffer size sysrc -f /boot/loader.conf hint.ahcich.X.pm_level=1 # For every used AHCI channel see grep ahcich /var/run/dmesg.boot You have to reboot for changes in loader.conf to take effect. Use powerd to throttle the CPU. You may want to raise the minimum frequency or limit the max frequency (on battery power). You can also tweak the scheduler for lower latency at the cost of some throughput: sysrc -f /etc/sysctl.conf kern.sched.preempt_thresh=224 service sysctl start # reload sysctl.conf It is also a good idea to use gsched on your HDD for responsive behavior under mixed I/O loads e.g. dd + tar -x. echo gsched insert ada0 >>/etc/rc.local # their is no nice rc.d script for this And finally do yourself a favor and upgrade to 10.0 it includes lots of nice new stuff and some bugfixes. ---------------------------------------------------------------------- ewood87 · 2014-08-20 13:03 Thank you so much for all of this great information! I'm going to try the frebsd-update tool to get up to 10.0 today and I'll look into the power management tweaks you listed. They sound like they'll help a good bit! Do you have any ideas about the PolicyKit troubles I mentioned? I find it weird that it seems to work randomly. I would think it's either a "you have permission or you don't" kind of thing. ---------------------------------------------------------------------- ddp · 2014-08-20 16:20 > sysrc -f /boot/loader.conf hint.acpi_throttle.0.disabled=1 # on both cores I think you mean '.acpi_throttle.1.disabled=1' here. ---------------------------------------------------------------------- ewood87 · 2014-08-20 20:40 As a result of the awesome suggestions from the comments here I have fixed, in less than two hours, the problems I was fighting with for the last few months. I've updated to v.10.0 using freebsd-update. I have done away with the need for my wireless script thanks to suggestions from /u/crest_ and I have pushed forward in trying to resolve my issues with PolicyKit and figured out what was required to get xfce4-power-manager to reliably show suspend/hibernate as options. I've outlined the changes below: Make a file "/usr/local/etc/polkit-1/localauthority/50- local.d/org.freedesktop.upower.pkla" containing the following: [Local Users] Identity=unix-group:power Action=org.freedesktop.upower.* ResultAny=yes ResultInactive=no ResultActive=yes Create a file "/usr/local/etc/polkit-1/localauthority/50- local.d/org.freedesktop.consolekit.pkla" containing: [Local restart] Identity=unix-group:power Action=org.freedesktop.consolekit.system.restart ResultAny=yes ResultInactive=no ResultActive=yes [Local shutdown] Identity=unix-group:power Action=org.freedesktop.consolekit.system.stop ResultAny=yes ResultInactive=no ResultActive=yes [Local restart - multiple] Identity=unix-group:power Action=org.freedesktop.consolekit.system.restart-multiple-users ResultAny=yes ResultInactive=no ResultActive=yes [Local shutdown - multiple] Identity=unix-group:power Action=org.freedesktop.consolekit.system.stop-multiple-users ResultAny=yes ResultInactive=no ResultActive=yes I then had to modify my .xinitrc slightly. Originally it looked like this: exec /usr/local/bin/startxfce4 --with-ck-launch I changed it to: exec ck-launch-session dbus-launch xfce4-session I hope this helps someone in the future. ---------------------------------------------------------------------- crest_ · 2014-08-21 00:09 I simply avoid using PolicyKit. Both PolicyKit and ConsoleKit are broken by design. Their is not fix for the troubles they cause other than going back to the drawing board in search for a clean and reliable design. My preferred setup is to start xdm from /etc/ttys on ttyv8 and do whatever I want in ~/.xsession .e.g. configure caps lock as second escape key. ---------------------------------------------------------------------- crest_ · 2014-08-21 00:10 Yes I made a copy & paste error. ---------------------------------------------------------------------- BasementTrix · 2014-08-21 10:23 If you find that you don't have sysrc, it's in ports; sysutils/sysrc. ---------------------------------------------------------------------- ewood87 · 2014-08-21 15:50 I do have sysrc installed. What is the difference between using sysrc to add sysrc wlans_iwn="wlan0" and just adding it in to /etc/rc.conf? ---------------------------------------------------------------------- BasementTrix · 2014-08-21 20:40 I doubt there's any difference. I've never used it, though. I, like you, just edit the file. i would guess the advantage of sysutils/sysrc would be that it's scriptable. ---------------------------------------------------------------------- ewood87 · 2014-08-21 20:58 I guess sysrc still modifies the file? I was under the impression it was setting the options in a binary file, such as /boot/loader.conf. ---------------------------------------------------------------------- BasementTrix · 2014-08-22 03:23 FreeBSD doesn't have binary config files, that I know of. /boot/loader.conf is a text file. ---------------------------------------------------------------------- ewood87 · 2014-08-22 13:57 HAHA! You're right, I was looking at /boot/loader, not loader.conf :D Cheers ---------------------------------------------------------------------- onelycyclist · 2014-08-23 13:43 One thing I rarely see is people trying out and comparing the experience with different BSDs on the same system. Now that you've written about what impression FreeBSD has left you with, I'd love to hear how, say, OpenBSD and NetBSD compare. I get the feeling that going from one to the next BSD can be as big of a change as going from Linux to BSD. ---------------------------------------------------------------------- ewood87 · 2014-08-23 13:53 I tried NetBSD briefly before going to FreeBSD. I have more experience with it so I felt it would be a good first shot. I have up when I couldn't get the lid trigger working to suspend the laptop. If I spent a little more time, now having gotten everything working in FreeBSD, I may have better luck. I'll do a write up on it if I decide to give it another go. ---------------------------------------------------------------------- onelycyclist · 2014-08-23 14:18 Cool. It would be nice if you did.. Try OpenBSD too. From what I've heard, thinkpads are quite common among the developers. And they've put quite a bit of effort into suspend & resume in the past few releases. machdep.lidsuspend is a sysctl you might want to remember. ---------------------------------------------------------------------- pentag0 · 2014-08-24 06:28 Just being curious, why erotic someone decide to use NetBSD on a server and which kind of server exactly? What are its main advantages compared to using FreeBSD apart from supporting some ancient hardware? ---------------------------------------------------------------------- ewood87 · 2014-08-24 17:25 ...supporting ancient hardware. At least that's why I have more experience with it.