Hacker News new | ask | show | jobs
by sdfjkl 1401 days ago
> wifibox essentially spins up an Alpine Linux VM using FreeBSD's bhyve virtualization technology, and allows you to passthrough your machine's wireless card

Jesus christ.

6 comments

That is my initial reaction, but ... a minimal linux VM in a minimal hypervisor, might not be that bad, for a network adapter. Perhaps -40MB- 128MB of memory? Double the context switching? Sounds kinda like a micro-kernel driver.

Have you ever tried to install a minimal driver for a printer in windows, and then watched in horror as it automatically started downloading 600MB of HP junk?

> Have you ever tried to install a minimal driver for a printer in windows, and then watched in horror as it automatically started downloading 600MB of HP junk?

Never have I changed my opinion on something (a VM for a fricking driver) so quickly. Good job.

Yeah, obviously it's not ideal but I don't really see any problem with passing the card to what is, indeed, effectively a userspace driver (that happens to internally contain a virtual machine and Linux). Some upfront setup effort and lower performance beats not having a way to use the card at all!
I just stay away from HP junk. Life is too short.
It's easier than writing a driver for FreeBSD yourself, I suppose, although I'd probably just get a USB Wi-Fi dongle instead of worry about walking into a meeting and my Wi-Fi driver VM crashing :)

(or, just run Linux and run FreeBSD in a VM, but that's no way to support a niche operating system...)

You don't need a dongle, just purchase a supported wifi card. I put a supported atheros card in my framework laptop and the wifi works flawlessly, natively. The framework laptop is designed to be opened and have the parts replaced, so its the perfect laptop for doing hardware changes like this.
Does this actually support operating on 5GHz, or is it still stuck in the 2.4GHz era? I'm not aware of any FreeBSD-compatible wifi cards that actually do this.

(I would love to be proven wrong, but I'm super tired of people saying "wifi cards work fine on FreeBSD" when the reality is that the speeds are sub-optimal without a way to improve it currently)

Yep! Its both 2.4ghz and 5ghz, but only 802.11n which is fine. Certainly not the newest wifi standard, but 802.11n is plenty fast.

dmesg | grep ath:

    [ath_dfs] loaded
    [ath_rate] loaded
    [ath] loaded
    ath0: <Atheros AR946x/AR948x> mem 0x7a200000-0x7a27ffff at device 0.0 on pci2
    ath0: [HT] enabling HT modes
    ath0: [HT] enabling short-GI in 20MHz mode
    ath0: [HT] 1 stream STBC receive enabled
    ath0: [HT] 1 stream STBC transmit enabled
    ath0: [HT] LDPC transmit/receive enabled
    ath0: [HT] 2 RX streams; 2 TX streams
    ath0: AR9460 mac 640.3 RF5110 phy 0.0
    ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000
    ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
    ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
I confirmed by checking wpa_cli scan_results and I saw my 5ghz-only ssid (not listing the output here for privacy)

Its an AR9462 which I purchased off thinkpenguin

Appreciate it! This is helpful and the kind of info I like seeing. :)
On the other hands 2.4GHz is perfectly fine for a lot of people. Actually I often select 2.4GHz on purpose at home because 5GHz works really bad with thick walls and I barely get any network in my kitchen and rooftop.

People will say it is easy, setup a mesh network or some powerline adapters but: 1. It is much more expensive 2. It is not practical in an old flat with very few power outlets, especially when you are not the owner.

And I don't really run into use case where running 2.4GHz limits me.

I think the problem is that there aren’t many modern wireless cards with official FreeBSD support, so you’re stuck using a specialized dongle or Ethernet if you want to use FreeBSD on a laptop.
It’s also way better from a security point of view - there have been WiFi driver bugs, so there are going to be more of them.
> Jesus christ.

exactly.

this is the kind of bs i like to call out when i see the usual freebsd desktop thread.

it's going to work mostly okay-ish, as long as you don't mine some abominations like that running on your systems in the background.

this really reminds me my linux experiences circa 2005-2006 (ndiswrapper for wifi cards, do people remember that?).

Totally agree. Wonder the use case why they don’t run Linux and put FreeBSD in a VM where everything would work perfectly.
Good point, actually. These days everything pretty much runs on VMs anyway…
Sounds sub-optimal, I'm thinkng back to linux wifi support on random laptops 10+ years ago and it was also quite bad.
I think it mostly depended on the vendor, like today, where Broadcom and Realtek suck a lot, Mediatek and Qualcomm a little and Intel/Atheros work just fine. I remember using Ubuntu 6.10 or so with an Intel card out of the box.
I’m sure it is but the status I see shows that there isn’t much support for anything newer than 802.11n cards period, so if you’re using anything from the last 5 or 6 years, you may have a problem.

That’s a it different from the various Broadcom or whatever issues the Linux kernel was dealing with in the early Ubuntu eras (where Ubuntu also I think accepted some blobs/drivers that weren’t in the kernel at the time).

The problem here seems to be no support for certain stuff, regardless of chipset maker, rather than having to pick a certain one, unless you’re able to go really far back (which may have issues on some networks at this point).

As always, the best option for less-mainstream operating systems is to use Ethernet when possible.

Not that different from a Linux user using NDISwrapper to run a Windows wireless driver on Linux.
NDISwrapper was more like wine, it implements APIs but doesn't run any sort of virtual CPU.
Spiritually it was the same concept though... if you can't get a driver for your Linux OS, use the driver from another OS. This just seems to take that to be extreme -- don't just use the driver from another OS, actually use the driver FROM the other OS!
It's basically a microkernel ;-) (although with a very "fat" WiFi driver)