Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. OpenJev(openjev.com ↗)
    109comments
  2. ZCode, the GLM coding agent, silently uploads your Git history(tokenstead.ai ↗)
    17comments
  3. Bend 2 and the Vibe-Coding Trap(liampwll.com ↗)
    discuss
  4. Jemalloc 5.4.0(github.com/jemalloc ↗)
    54comments
  5. Microsoft exec called AI scraping 'the largest theft of labor in human history'(techcrunch.com ↗)
    226comments
  6. The scourge of x86 emulation(fex-emu.com ↗)
    36comments
  7. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  8. Astra for Law(openai.com ↗)
    603comments
  9. Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint(prismml.com ↗)
    145comments
  10. Replacing Pull Requests with Delta(zed.dev ↗)
    18comments
  11. Subnormal floating-point numbers are expensive on Intel processors(lemire.me ↗)
    3comments
  12. Warren Buffett Steps Down as Berkshire Chairman, Names Son to Replace Him(nytimes.com ↗)
    16comments
  13. Bend – A language that blocks AI mistakes via proof, on CPU and GPU(bend-lang.com ↗)
    238comments
  14. Qwen 3.8 Omni Flash(qwen.ai ↗)
    90comments
  15. Hister: A private search engine for the pages you visit and the files you keep(github.com/asciimoo ↗)
    172comments
  16. Wax motor(wikipedia.org ↗)
    75comments
  17. When the fractional part of a float fixes your shader(crocidb.com ↗)
    8comments
  18. Fujitsu launches made-in-Japan next-generation CPU FUJITSU-MONAKA(global.fujitsu ↗)
    236comments
  19. Pre-Greek: The lost language hidden within Ancient Greek(linguisticdiscovery.com ↗)
    44comments
  20. Dr Julius Neubronner's Miniature Pigeon Camera(publicdomainreview.org ↗)
    discuss
  21. How to Write with an LLM(sockpuppet.org ↗)
    131comments
  22. A heap overflow and SSO misconfiguration to compromise OpenAI internal repos(hacktron.ai ↗)
    161comments
  23. Shapelearn Qwen 3.8 27B (13.1 GB VRAM)(byteshape.com ↗)
    17comments
  24. Ask A Monk – A digital wilderness for thoughts with no immediate answer(askamonk.online ↗)
    27comments
  25. Flet 1.0 – Build cross-platform apps in Python(flet.dev ↗)
    69comments
  26. Telstra outage: The night a network decided the year was 2006(netnod.se ↗)
    29comments
  27. Diplodocus, Long Thought Exclusively American, Turns Up in Spain(sci.news ↗)
    45comments
  28. Speeding up gearhash on ARM64(sam.dev ↗)
    discuss
  29. Why I didn’t sign the Fields medallists’ letter(gowers.wordpress.com ↗)
    375comments
  30. The most important product decision is what you don't build(liamnugent.me ↗)
    41comments

How to run FreeBSD 13 in QEMU on Apple Silicon Mac

95 pointsby 5y agogist.github.com
39 comments
5y agoHN ↗

Remember to star the gist if it is helpful to you ;)

5y agoHN ↗

I’m not asking for upvotes. I am saying to star it on GitHub if it is useful.

GitHub stars and HN upvotes are two different unrelated things.

5y agoHN ↗

What I have come to realize is that the default action for people online, including myself, is often to read/watch and move on. A gentle reminder to give a signal back will push some people to take the time to do so.

5y agoHN ↗

Beware a slow burning Time of Check to Time of Use attack.

What you like/star today may change tomorrow, but your public association with it will remain.

5y agoHN ↗

Maybe something like this:

- I star a FreeBSD project on GitHub.

- The author changes the project to something racist.

- My GitHub profile now shows that I've starred a racist project.

5y agoHN ↗

I would love the origin person of that phrase because it is almost universal with YouTubers.

5y agoHN ↗

Now, I am really curious why would it be of any value (putting aside the HN policy discouraging it) to anyone. I understand that GH repo stars help project visibility and may be good on CV but gists?

5y agoHN ↗

I use the number of stars as a measure for how much the guide is of use to people.

If it’s not useful to anyone then I know not to spend time on that. Short though as the guide is, and even though it is based on much hard work of others, it still took time to make, much in part because when I write stuff like this I spend a lot of time actually redoing steps to ensure to the best of my ability that what I am writing will work for others too. So I like to know that people find it useful.

5y agoHN ↗

So you wrote it just for GitHub stars? Not because it was useful to yourself?

5y agoHN ↗

The motivation to run FreeBSD in a VM on my M1 MBP comes from being an active user of FreeBSD for a long time. For example my mail, web and VPN server runs FreeBSD. And I have been running FreeBSD both on desktops and laptops for a long time as well.

The motivation to make a guide for others to follow is that it should be useful for others too.

What I am saying is, when it’s useful for others it’s worth spending the time on writing up how to do it and share it with others.

5y agoHN ↗

Does setting CPU to cortex-a72 mean that it runs natively on the m1 or with minimal translation?

5y agoHN ↗

The command line argument that means 'run natively' is the "-accel hvf" one, which makes QEMU use the Hypervisor.framework macOS APIs. (This is why you have to use an out-of-tree patchset at the moment -- mainline QEMU only supports hvf on x86 CPUs right now.) The hvf support patches don't make any attempt to make the guest CPU report different ID values or features, so regardless of what actual cpu type you ask for with -cpu the guest sees whatever the host CPU is.

5y agoHN ↗

I've spent way too long getting VMs to work on various platforms. I hate paying for software but does vmware make it a lot easier? It sucks to use free OSs, but then pay to virtualize.

5y agoHN ↗

yes certainly would suck to pay, because in the end VMWare isn't issue free either.

5y agoHN ↗

Next thing: run FreeBSD 13 natively on M1. It would be really nice, because even on this X230 this OS is really damn fast and snappy. Wayland and sway are super nice.

5y agoHN ↗

Oh yes, that would be so good. I hope to see the Linux on M1 project work out, and that the learnings from those people could enable running FreeBSD natively on M1 too!

5y agoHN ↗

There's 5 open PRs. Two seem to be boot related, which probably wouldn't apply to the M1. The Xorg one and the drm one are related to an Intel integrated GPU.

That leaves just the firewire one as possibly an issue.

Though I get the general point that hardware drivers could be an issue. Perhaps, though, the upside of the M1 is sufficient incentive for people to figure it out.

5y agoHN ↗

Maybe Apple does a favor for us and releases docs for their hardware, so it would be easier to write drivers for the open source operating systems. That would be the best news for 2021.

5y agoHN ↗

I would have been surprised if they did that before, and I certainly can’t see it happening now as they pull things out of the open source releases…

5y agoHN ↗

Can you describe your desktop setup? What login manager do you use? Does Zoom work? Does usb 3 work?

5y agoHN ↗

I installed it to my fun and games laptop I carry with me when I travel. It's the ThinkPad X230 that is small enough and has hardware that Just Works with almost all the open source operating systems. I'm not planning to work with this, so I'm not really thinking about installing Zoom or any other closed source software. I have other computers for work business. I'm considering trying on jails and iocage to see if I can get something similar to docker, but it's not my biggest priority: I kind of like having a computer that I'm not doing work with all the time.

What I now have is just a boot to console. I haven't decided on a login manager yet, so I just run `sway` to get to the desktop. I run sway window manager on wayland. I installed rust, emacs, vim, a music player ncmpcpp and firefox. It feels like this old laptop got lots of energy from this new setup.

5y agoHN ↗

I am running an ARM Ubuntu server in QEMU. SSH'ing to that gives me a complete dev environment that so far seems to work flawlessly. I guess it's slower than if I was running things natively but on the other hand, I get seamless Docker support and it's still significantly snappier than my semi-beefy PC (and this is the Air).

[link redacted]

5y agoHN ↗

I needed a FreeBSD/arm64 box, and so I did something similar a few weeks ago based on instructions for running Windows ARM64 on M1. The issue that I have is that the VM burns tons of battery even when idle.

It was explained to me that there are 2 different instructions on ARM to say "i'm idle, wake me up if something happens" (like x86 mwait), and Apple M1 uses one, while everybody else uses the other. Is this fixed in either FreeBSD or Qemu at this point?

BTW, I'm super impressed that a 4-core VM on my M1 13" MBP can build world in about 130% of the time of a 32-core Ampere EMAG.

5y agoHN ↗

Thanks, mine is indeed more than 2 weeks old..

5y agoHN ↗

Yeah, it looks like the WFI handler was removed in the v3 patch series, then put back in for v6. WFI appears to be one of the cpu sleep related instructions that don't work well on the M1 (or maybe just don't work in QEMU?).

5y agoHN ↗

can build world in about 130% of the time of a 32-core Ampere EMAG

This says more about the eMAG than the M1, to be honest :D The APM X-Gene derived cores in the eMAG are far behind current cores from everyone else. The new Ampere Altra is using stock Arm Neoverse cores. (Which makes me wonder if all they got out of the APM acquisition was just one dead-end generation of product…)

Is this fixed in either FreeBSD or Qemu at this point?

Not in FreeBSD for sure, as an obsessive commit watcher I can say I haven't seen any M1 quirks land.

2 different instructions on ARM to say "i'm idle, wake me up if something happens" (like x86 mwait), and Apple M1 uses one, while everybody else uses the other

Everybody should use both in different circumstances: https://community.arm.com/developer/ip-products/processors/f...

But according to Corellium's Linux work "the CPU tends to lose state" when using WFI for system idle: https://github.com/corellium/linux-m1/commit/b8ecd5924678f1c...

Not sure why this would have an impact on VM idling… (upd: yeah it's QEMU-side stuff, see other comments)

5y agoHN ↗

When I went on my quest to run FreeBSD on my M1, I was originally looking at tools like the one you link.

As far as I could tell, the Virtualization framework is Linux specific(?)

https://developer.apple.com/documentation/virtualization

And in the guide in the OP, we are using some patches that someone wrote so that QEMU uses the Hypervisor framework.

https://developer.apple.com/documentation/hypervisor

And from what I understand but please correct me if I am wrong, the Virtualization framework is actually a layer on top of the Hypervisor framework. So if I am correct in my understanding the way that the QEMU patches do it should in theory be comparable in performance to the way that the Virtualization framework does it.

I would like to do some benchmarking of Linux on the Virtualization framework versus Linux on QEMU to see if there is a difference. However, good benchmarking is no easy feat. So ideally someone else who is really good at benchmarking Linux would do this and write about it.

5y agoHN ↗

Yes, Virtualization.framework's XPC service (because VM is out-of-process there) is implemented on top of Hypervisor.framework.