Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not everything will work. Once upon time I tried to make CTF with M2 Pro, and I seriously wished that I had x86_64 Linux instead.

Many of the penetration testing tools are not mainstream and they include pre-build x86_64 binaries, or are configured just to not compile with ARM, for reason unknown. And there is no time to figure out what is wrong.

I know this might be a niche scenario, but still...



That seems like a wonderful opportunity to use QEMU since it's not all that performance-sensitive (I think?) and you're not running random pre-built binaries directly on your computer.


I ran all my stuff inside non-root non-volume container so prebuilt binary it is not really a problem.

I used QEMU through Podman machine in the end, but the performance is terrible. Even on MacOS side QEMU does not support Rosetta 2. Docker for Desktop supports and gives significant boost, but I don’t want to use it.


This stuff makes me super nervous. I've just gotten an M1 MacBook Pro at work because my old touchbar Mac was showing signs of impending battery death (and I only got that because IT didn't want to support Linux and I didn't want Windows). I've already had a few battles with some python libraries and today I've found that the Oracle container image doesn't run.

I love the battery life and the keyboard is much better than the old one. It feels snappy running native code but I just know it's going to cause me more issues than it's worth.


It will cause issues, yes. But personally I’d rather spend two hundred hours fiddling with arm64 issues that going back. The performance and silence is wonderful.


Did you try Lima on Mac? I never did compare apples to apples, ran an x86 Podman VM and then switched to an arm64 Lima VM and had drastically improved performance.


Lima uses QEMU as well. Performance is not an issue from ARM-to-ARM virtualisation.


Starting from 0.14 lima support vz framework on macos and allows you to use rosetta2 for x64 linux binaries :)


Thanks! Need to test it.


The newest release of colima / lima runs Rosetta2 by default when running cross arch. The file system and networking are flaky but it’s fast.


> Even on MacOS side QEMU does not support Rosetta 2.

Is Rosetta 2 that much faster than QEMU's own translation? Why?


>Is Rosetta 2 that much faster than QEMU's own translation

Oh yes. Based on the benchmarks I've seen it's a good 30-40% faster on compute workloads. I assume that the pre-transpilation of the binaries is advantageous relative to having to virtualize the CPU.


Anecdata: on my workloads it's near-native† vs ~10x slower for QEMU

† actually not measured, but compared to the order of magnitude on the other side it's about that, eyeballed against the same code on aarch64.


QEMU makes translation in Just-in-Time. Rosetta ”pre-builds” binaries to match different architecture, and binaries eventually run ”natively”, with the cost of delayed start.


It's not obvious that QEMU's JIT has to be a lot slower, but it is. It may be that Rosetta 2 is just more thoroughly engineered and tuned for Apple Silicon.

Among other things, Rosetta 2 is able to use the CPU's special TSO memory ordering mode, which I think QEMU's TCG cannot use so has to use barrier instructions instead (MTTCG), or run all the virtualised CPU threads on a single host core (obviously slower for parallel workloads).


“Once upon a time I tried to make CTF with M2 Pro”

Wasn’t the M2 Pro released like a month ago?

Am I that old that a few weeks now counts as once upon a time?


World changes fast these days!

But yeah, it was like week after the release I took that laptop to CTF.


I don't mean to cast aspersions, but that sounds a lot like something a time traveller would say if they'd been rumbled.

I'm just saying.


I cannot imagine a worse idea than downloading a binary artifact promulgated by someone in the competitive infosec community.


Not much different than installing any random pip package. They include pre-build binaries too. Infosec tools might be even safer.


That’s exactly what I’m always telling people about pip.


They’re inviting you to tear it apart, so




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: