Hacker News new | comments | show | ask | jobs | submit login
FreeBSD on a MacBook Pro (github.com)
245 points by gunnarde 55 days ago | hide | past | web | 94 comments | favorite

> Six years later, it less and less "Just Works", started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system.... GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years.

So... it's not just me. Somewhere between Snow Leopard and Mavericks I started finding building various things from source that never were a problem became an exercise in figuring out what library had been removed or moved or what Apple had done with lib/header paths or something else.

If people aren't going over to another unix, what are they doing? Homebrew? Container-ing or virtualizing another unix? Or just suffering?

The problem for me is OSX still takes less maintenance than Linux and provides a higher quality experience than Linux.

I have complaints about the UI changes in OS X sometimes but it's still not as bad as half the Linux applications I'd use in place of OS X ones like Tower

And every time I try Linux i still have issues like the "sleep of death" and NVIDIA Optimus support being in poorly documented limbo (your dedicated GPU is both in use and out of use until you run a graphical benchmark and measure the current draw of your laptop)

And I prefer Homebrew to apt. I've never had Homebrew fail to install other packages because I had a package install break previously, which is always something that drove me nuts about apt.

I'm surprised git UIs have lock-in power. Of all my development constraints, git is the last place I would have expected to find resistance switching OSs.

But then again, I could never do things in tower as fast as I could on the command line, so I dropped it fairly fast. It's not super useful replacement without an interactive rebase. Nice for viewing history, though.

Who said Git UIs have lock in power?

Are you intentionally ignoring the context in which I mentioned Tower?

Not to my reading!

The alternative app to tower on FreeBSD would be git itself, which had a superset of features, would it not?

No, OS X has Git, that's the equivalent. I actually don't know Free BSD well enough to say for BSD, but for Linux for example I'd say it's Sourcetree or SmartGit.

Your getting hung up on the Tower example, Tower is far from the only example of OS X applications having a smoother UI than nix. I always felt it comes down to a culture issue, nix users don't mind the lack of polished GUIs if there's a command line tool (which you're so continently demonstrating)

I had always assumed that SourceTree was a portable Qt app (it looks like it, doesn't it?), but it's only available on macOS and Windows.

Tower and GitUp are a huge lock-in into macOS for me. Tower for line-by-line staging/discarding, GitUp for minor history fix-ups (editing a commit message without remembering the CLI command, etc.).

For what it's worth, git add, git checkout, and git reset all take the -p (or --patch) option, which allows selection of sub-sections of files to stage, discard, or unstage, respectively.

Homebrew and a Vagrant managed Linux VM depending on the situation. I'm seriously considering moving to Linux next time I'm switching my work laptop.

Did this at work, haven't looked back since. Having first class package management support is something I never want to live without again. I still use a lot of virtual machines, but mostly to keep different projects separated.

By the way, is it just me or have the vms better disk performance but slower graphics in Linux?

Any particular software you host your VM in? How easy/hard is it to get the VM networking with the host machine?

Some months ago I got FreeBSD running in a Macbook Air, and surprisingly the UEFI boot worked out of the box. I say surprisingly because when I tried, the Linux efiboot didn't work, the only way to boot linux was through GRUB.

I had almost everything working (Audio, suspend on close, i3 or gnome) but never got the wifi to work, I even tethered from my android phone to the Macbook and it worked very good. But in the end it was to annoying to do often. If only FreeBSD supported that wireless chip, I'd be writing this on FreeBSD. When the wayland and updated intel drivers come to FreeBSD maybe i'll try it again, but wifi is a deal breaker.

I always wondered why there isn't wifi drivers for this macbook in FreeBSD if Fedora had them (and AFAIK Fedora only ships open drivers)

No one ported the broadcom wifi drivers. New Intel cards (7260, 8260) are supported.

Also, you can build the updated graphics drivers from https://github.com/FreeBSDDesktop/freebsd-base-graphics

Which FreeBSD version did you try? I'm just skimming things, but it looks like Adrian Chadd might have updated the relevant driver back in May/June, in time for FreeBSD 11.

If its for the broadcom cards that's probably still a negative. I was running 11-CURRENT up until the release freeze and it never started working. That being said, it wouldn't surprise me if Adrian has it working by now.

Adrian has done a lot of recent work on 11ac in -HEAD, but not anything on BRCM of late.

ever considered using a supported wifi usb?

I didn't like the idea of permanently losing 1 of the only 2 usb ports, although when connecting android tethering I lost one still. I wanted a solution that would allow me to have internet and also be able to connect a mouse and a usb drive.

That's what I ended up doing for a lot of my laptops as well. These things have become so small you barely see them taking up a USB port.

I believe audio over hdmi is also unfinished for recent MacBook pros, which is a deal breaker for me.

I use an oldish (maybe last years or the one before?) retina mbp to drive the two screens in my home office which I run FreeBSD on (still 10.x, not had time to upgrade it) -- and I run the audio via one of the monitors no prob:

$ cat /dev/sndstat | grep default pcm2: <NVIDIA (0x0042) (HDMI/DP 8ch)> (play) default

I almost never turn it off as I have to do some weird kind of dance to close the lid and type startx blind so that I don't end up with three screens in X, but I don't really care enough to fix it when I only have to do it every few weeks/months...

I use a thunderbolt Ethernet dongle thingy which does 1gbit since it doesn't ever leave the desk I've not really tried the wifi..

I use a USB DAC when I've got the cans on though because they sound much better (also works, an audioquest thing)...

I won't buy another macbook tho, XPS+Linux is going to replace my luggable very soon.

Mac/OSX stayed out of my way for a few years and was my justification for using it; who's got time to have to deal with the usual linux desktop problems when you just need a machine to do email ssh and a browser, right? I'm not sure really when, but Mac+OSX stopped being the best solution some while ago (for me at least). It's just a constant source of annoyance now (honestly, let an email password expire and see how many times it grabs focus from your editor, I get at least two full on kernel panics a week, distnoted randomly eats a core all day, I have an alias called something like "fsckoff" which does a kill on coreaudiod for when airplay stops working, I'm increasingly nervous about running prop stuff, yadda yadda). The macbook is a pretty cute little machine though, super skinny.

As for BSD? I don't think I'd bother using a BSD on a lappy that you are actually planning on lugging around, makes a nice workhorse in the home office though if you don't want to have to mess with it too much!

at least for Ubuntu on a 2013 MBP I had to install non-free wifi, everything else Just Worked (tm)

How much battery life do you get from this configuration? macOS is optimized for power. FreeBSD not so much, I believe.

I don’t think I ever had my laptop battery run out on me. To me it’s just not an issue. I’m plugged in 85% of the time.

How do people use their laptops? For me it's almost always at a desk and if not there is always a plug nearby.

I sit on my sofa. Not the best thing for my back, but that's what I do.

FreeBSD battery life is generally good, especially with https://github.com/lonkamikaze/powerdxx

Never got to try how much this Macbook did in macOS (I bought it used just to tinker with Linux/FreeBSD, but the time I used it, battery on FreeBSD was on par with Linux, if not slightly better.

A few hours less than OS X I think. I haven't done exhaustive testing (that year of Macs were a massive improvement in terms of battery life)

I’m author of that gist (just noticed I have some comments there I need to reply to), still running the setup, now with FreeBSD 12-CURRENT. Tl;dr it generally works, still no wi-fi support. X works fine (running with drm-next-4.7 patches to get external thunderbolt display to work; vanilla kernel works fine with built-in and DVI display, gets confused by Thunderbolt display only). Gave up on pkg because I want to control my build flags, I’m using portmaster now and thinking about setting up poudriere on a bigger server. Feel free to ask if you have any particular questions.

Looks nice, thanks!

So to be clear, no Thunderbolt display working yet?

Not in HEAD, but https://github.com/FreeBSDDesktop/freebsd-base-graphics/tree... is stable in my experience

I'm running two external screens (one thunderbolt, one via the hdmi port) on unpatched 10.3 without any issue on my mbp... I can use the laptop display at the same time also (usually don't -- but I have to close the lid before I start X otherwise it'll stay on) ....?

Is it just your model? It;s behind my desk but it's some cheapo thunderbolt->hdmi dongle made by "neeto" apparently, works well enough..

[ 131.865] (--) NVIDIA(0): BenQ GL2450H (DFP-2): connected

[ 131.865] (--) NVIDIA(0): BenQ GL2450H (DFP-2): Internal TMDS

[ 131.865] (--) NVIDIA(0): BenQ GL2450H (DFP-2): 340.0 MHz maximum pixel clock

[ 131.802] (--) NVIDIA(0): BenQ GL2450H (DFP-0): connected

[ 131.802] (--) NVIDIA(0): BenQ GL2450H (DFP-0): Internal TMDS

[ 131.802] (--) NVIDIA(0): BenQ GL2450H (DFP-0): 165.0 MHz maximum pixel clock

[ 131.865] (--) NVIDIA(0): Apple Color LCD (DFP-3): connected

[ 131.865] (--) NVIDIA(0): Apple Color LCD (DFP-3): Internal DisplayPort

[ 131.865] (--) NVIDIA(0): Apple Color LCD (DFP-3): 480.0 MHz maximum pixel clock

I think 10.3 has an older version of i915, this has worked on vanilla, but 11 has already Linux 3.7 or 3.8 DRM imported which breaks with thunderbolt display, and it was fixed in drm-next-4.7 patch (which is going to land on HEAD someday, but it might not be backported to 11).

This tutorial is about FreeBSD 11-CURRENT snapshot 20150111 (pre-release version), so it deals in act II with hybrid UFS/ZFS setup, but FreeBSD 11.0-RELEASE supports root-on-ZFS-in-UEFI-mode via standard installer. Release version of boot1.efi loader fully supports ZFS, so small UFS boot partition is no longer needed, and things are much simpler now.

It doesn't work yet with GELI as far as I know, so for encrypted root /boot still needs to be on a separate partition. There was some work to support encrypted /boot, I'm not sure where it stands now, but I'd be very surprised if it supported encrypted ZFS.

Yeah, I've not tried going to 11x yet as I'm not sure I can be bothered trying to deal with replacing the non-geli 'bootpool' I have on 10.x.. Sounds like a tricky process.

I'll probably just rebuild it instead of trying to upgrade.

I really want to try this out. I was a heavy FreeBSD user for many years in the 2000s, and I drifted back into Linux. One thing I will say for FreeBSD, it's harder to get dialed in but once it is, it's very solid. I think with enough tinkering FreeBSD would run really well on a MBP, I just wonder if it would provide a lot of advantages over OSX to make it worth the time.

Random question for you, how does the shell experience on FreeBSD compare to MacOS? Linux?

Why would you care at all about something like that? No matter if I am on Linux, BSD or OSX, I am installing the shell I like&want to use and don't spend more time in default bash/tcsh/whatever else of the OS than it takes to perform install and run `chsh`. It's like literally one of the last things that'd weight on my OS choice.

A shell is a shell for the most part. The details can be a bit different (like your $PATH), but otherwise its largely the same.

Yep. Mostly the same. Hence the reason I question why FreeBSD might be worth it. The overlap of OSX and FreeBSD at the shell is quite great, but you can't run a lot of OSX apps on FreeBSD. I'd venture to guess you could run a lot more FreeBSD apps on OSX.


   rm -rf somedir/

   rm somedir/ -rf
Linux (the former) allows me to be lazy while MacOS (the latter) forces me to hit crtl-a and insert -rf.

GNU rm (coreutils) vs BSD rm.

I will never get used to the trailing slash on source arguments in BSD cp (that copies directory contents rather than the directory itself)! The first thing I do on an OS X machine is install GNU coreutils.

Me either. I've also got a habit of adding '-rf' as the last argument to 'rm' so I can safely tab complete things in my home directory without a mistaken "enter" press nuking everything.

I'm used to that from rsync. I find it quite handy.

This may be why I never found rsync comfortable.

Major correction, the former is MacOS and the latter is Linux allowed (options can be before positional arguments).

I usually install a GNU shell and use that - I don't use FreeBSD out of idealism but because it works better. Things like ctrl-T make it a little nicer than Linux, but on the whole it's pretty similar.

OS X userland was forked from FreeBSD 15 years back.

It's not that far removed even now, although config is standard /etc

I'm using FreeBSD on Lenovo X220, and while it's obviously no MacBook, everything important to me (wifi, suspend-to-ram, graphic support, long battery usage, HDMI out) just worked out of the box (apart from the initial install, which wasn't FreeBSD's but Lenovo's fault and is since being worked around in recent FreeBSD installers). I can really recommend it if you want to give FreeBSD a try on a Laptop.

ps: make sure you get a wifi card that is supported by FreeBSD. While you can put in a supported one, the X220 won't boot because Lenovo put a Wifi card whitelist into the BIOS and you need to install a patched BIOS from a dubious source.

Why in Richard Stallman's name would you buy a Lenovo?

"using a custom [FreeBSD] kernel seems tricky in a VMWare/VirtualBox VM"

This flipped a set-once bit, making the rest of the article essentially unreadable due to zero confidence in the writer's technical skill. Also, the lack of "late 2011" in the title makes it pretty misleading.

I thought the exact same thing. It's trivially simple to run custom kernels. Further, with currentish versions of OSX, you don't even need VMware/VB. The built-in hypervisor works good enough without crash prone kexts like in the alternative in my experience.

Not sure if you read the rest of the article, but it didn't do much to instill technical competence after that point either.

Not claiming to be knowledgeable about OS X internals, but... it ships with a hypervisor now?

Is it at all similar to BSD jails?

Jails aren't a hypervisor. A jail is just a number in the process table. That's what the hipsters call "containers" these days :-)

FreeBSD's hypervisor is called bhyve (and it uses vmm.ko), and xhyve is a port of bhyve to macOS (uses Apple's Hypervisor.framework). There are other things that use Hypervisor.framework too.

Yeah, my bad, I was just short on sleep when I wrote that :P

Still nice to know about Hypervisor.framework. If I ever get back to OS X I'll have to check it out!

> There are other things that use Hypervisor.framework too.

Docker's macOS installer uses it rather than VirtualBox now if memory serves.

No, but there is a port of bhyve using the MacOS hypervisor.framework


Or, if you want something with a GUI, there is Veertu:


Couldn't you just have said, "this guy doesn't know what he's talking about", like a normal person?

That was hard to parse.

This is what I think whenever anyone says "an order of magnitude" instead of "very".


and 2 sentences after describing themselves as someone "whose definition of "fun" includes spending 6 hours in the middle of the night figuring how to get dual boot working with UEFI."

So the author really enjoys debugging boot problems, but a custom kernel in a VM is just too tricky? Is there something I'm missing that makes that way harder than debugging dual boot?

Author here. Debugging dual boot is interesting, debugging virtualbox is not. And I was curious if I can get it running. I just was too lazy to figure it out, I found a more interesting problem to work on. In the end, I stayed in the native FreeBSD install, so there was no motivation to figure out the custom kernel in virtualbox (it is quite simple in bhyve, though)

I'm periodically installing FreeBSD on my ThinkPad T400 to see how it's performing with Chromium. It's the only application I use extensively, and the only one that performs really bad with FreeBSD (and OpenBSD also), which prevents me from switching from Fedora.

Is there any magic I'm missing, aside from the shared memory support?

It performs fine on my X240 without doing anything.

FWIW- Chromium was realllly unstable until the recent 52 -> 54 update that took place on the 22nd. Since then, it seems to be a lot more stable and performs better (on my crap hardware). I would definitely give it another shot.

My experience with FreeBSD is limited to a fugacious week with apparent quixotism and my noble Raspberry-Pi2, which ended inimically. All seemed rigorously dandy until presumably, Chuck Norris imposed thereafter some wicked temporal augmentation between all moments between any character typed or program otherwise compiled, offering only a typographic respite or scintillating scroll of never-ending techno-glossolalia in his wake whilst I sat there hour after hour (or character after character) awaiting something that made sense. Having no visible recourse, I capitulated and returned to Rasbpian.

With my compulsive - but hitherto compromised - aversion to running Linux within the virtual-machine of Systemd, I have ever-since intended to try again, maybe with a Pi3 and/or laptop, or even Mac. I've wangled Debian on a Macbook, but would, considering circumstances, prefer FreeBSD. I hope there is promise here. I praise all efforts.

That's odd. Are you using HDMI or the serial console?

My Raspberry Pi 2 runs FreeBSD very well. Currently running OpenNTPD + Monit + Postgres + Node-RED + go-carbon + graphite-api + Grafana + Syncthing + Transmission — all of this with only 249 MB of RAM used. FreeBSD's memory management is excellent.

RPi 3 (native AArch64 mode) support is in progress https://wiki.freebsd.org/arm64/rpi3 for now it runs only on one CPU core, SMP is "actively being worked on".

>Are you using HDMI

I was using HDMI. As mentioned, I've since returned to Raspbian, where I continue to use HDMI and all works generally well. I was initially thrilled after installing FreeBSD, but for whatever reason, things changed. I remember compiling vim for a whole day before cancelling it. I could type an entire sentence or paragraph before any input would show. Bad luck perhaps. My primary use for the Pi is a surveillance camera, so I temporarily abandoned BSD for what I know works. I intend to make my next main system a BSD system. Presently I am running Debian Testing, which has been quite excellent, but as also mentioned, I am bothered by Systemd and aspire to be free of it.

HDMI works fine for me, it's really, really weird that it didn't for you.

Compiling anything on ARM is horribly slow, cross-compiling from amd64 is a much better idea.

But you don't need to compile vim, there are binary packages for ARM! http://pkg.freebsd.org/FreeBSD:12:armv6/latest/ pkg should just work.

Pardon my ignorance; but what would HDMI have to do with the issues I've noted? In Raspbian, the Pi is a champion, minus some USB issues. Why would HDMI be any different in BSD? Why would HDMI cause lag or infinite compiling? Also, thanks for your replies. Amidst the onslaught of downvotes, I nearly committed YC-Seppuku in shame. Also-also, with a bit of irony, after I'd expressed my satisfaction with Debian Testing (after two happy years), this very night "apt-get dist-upgrade" wanted to remove everything "X", e.g. xorg, xserver, etc., and iptables too. These are the less pleasant moments of Testing. Pretty much annihilated my laptop, removing synaptic input drivers and every other useful thing it could sabotage. Nothing single-user mode can't surmount, but man, what timing. Happens about once/twice per year.

i can imagine building everything from sources must be painful on such a puny machine. why didn't you use binary packages? pkg install vim ?

All I knew of were ports. However, as noted above, there was the issue of input delay, which was very discouraging. Maybe I will try pkg next time.

> back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001)

The snark was really unnecessary.

I agree, I've been running Arch Linux on my MBP Retina for 2+ years now almost without problems. I bet if the OP tried Linux, they'd be absolutely fine.

I've been running Arch linux on my MacBook Air for the past week. Motivated by a strong desire to run StumpWM, I couldn't be happier with the results.

Unfortunately linux doesn't seem to play well with the 'macbook' models keyboard(s) -- I guess that probably applies to the new pros too.


Sure, but then they'd have to deal with Linux.


Linux was the only OS on my desktop in 1994...

how is battery life?

does close-lid-to-sleep and open-lid-to-wake work?

I've been running Arch on a Dell Chromebook and battery life and sleep/wake are essentially the same as with ChromeOS from what I've seen so far. Awesome experience.

Yup, works great out of the box.

it was good

plz keep posting and upvoting these kinds of stories (foss on hardware), great read.

That was anticlimactic

so far so good, pretty detailed too

some might care images / screenshot, not me tho :D

stunts for stunts' sake

That's how a lot of great projects got started.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact