Hacker News new | ask | show | jobs
by tbenst 901 days ago
Does anyone know the state of running Windows / Linux x86-64 virtualization on Apple Silicon? This article is super interesting but dances around the most important application for VMs on Mac.
14 comments

For Linux, and if you only need to run CLI tools, I've been very happy with Lima [0]. It runs x86-64 and ARM VMs using QEMU, but can also run ARM VMs using vz [1] (Apple virtualization framework[2]) that is very performant. Also, along with the project colima [3] you can easily start Docker/Podman/Kubernetes instances, totally substituting Docker Desktop for me.

For desktop environments (Linux/Windows) I've used UTM [4] with mixed success. Although it's been almost a year since last time I used it, so maybe it runs better now

There's also Parallels, and people say it's a good product, but it's around USD/EUR 100, and I haven't tested it as I don't have that need.

And there's VMWare Fusion but... who likes VMWare? ;)

  [0] - https://lima-vm.io
  [1] - https://lima-vm.io/docs/config/vmtype/#vz
  [2] - https://developer.apple.com/documentation/virtualization?language=objc
  [3] - https://lima-vm.io/docs/faq/colima/
  [4] - https://mac.getutm.app/
  [5] - https://www.parallels.com/products/desktop/
A correct solution is to remote into instances on dedicated (bare metal) servers (use ECC memory and SSH with a good cipher for your transport, even across your local or VPN/WireGuard.. network!), perhaps using KVM/QEMU for macOS VMs (yep, requires a MacPro to be legal) and KVM/Firecracker for Linux VMs. You could do Windows VMs in KVM/QEMU, but will have less friction remoting into an alternate (HyperV) box for that (using Windows-specific security products). RDP-over SSH for Windows, MPEG-VNC-over-SSH for macOS (and Wayland).

Why? Did you checkout the Privacy Policy for Parallels? The last time I checked, it allowed them to remotely take anything from your systems that they want. If I wanted that, I would just use a VPS running on someone else's machine in a cage somewhere.

VMware, by the way, is now Broadcom, as in they reportedly replaced the staff and ripped up the perpetual licensing model (subscription only now)... Even before that, the Fusion product development had been shifted overseas, presumably to avoid paying higher wage software engineers in Silicon Valley (what a brilliant way for a software company to innovate) --now a company in Singapore is wearing their skin and the C-suite are out of jobs too.

Parallels has a bad desktop user experience using Linux because of poor support for continuous scrolling. Lots of users have complained on their forums for years, but they refuse to do anything about it. I bought it for one year, and regretted the experience. It works well with Windows though.

Generally, the experience with MacOS is mediocre thanks to Apple and their Virtualization Framework, with many basic features missing for years.

This is ironic, considering Parallels was originally an Apple first product designed specifically for virtualizing Windows and running it's apps "seamlessly" alongside native Mac ones.
Why is it ironic? The parent says that it works well with Windows, which you say is the original use case. Linux has nothing to do with this.
Ah, I may have misread it. I thought they were saying Parallels on Windows runs Linux fine.

But, re-reading it again, your interpretation is probably correct.

Can you elaborate on the continuous scrolling? I've actually never noticed anything off about the scrolling.
> who likes VMWare?

I do!

I abandoned Parallels when they crippled the perpetually licensed version. "Pro" is only available via subscription for a few years now. Even before then, their store was disgusting with forced bundling of additional hostile products, and later they became optional but were still added to your cart by default.

My personal experience is that Windows 11 for ARM runs extremely well on Parallels. It includes an emulation layer for x86 apps that's completely invisible and just works. I can even still run Cakewalk, a program originally from the 90s, on my M1 Mac to edit midi files.

With that being said, this is just my view as someone who uses simple consumer oriented programs, and I'm not sure how well it'll work for more serious purposes.

Have you tried any Windows games on Apple Silicon? What kinds of Windows apps do you tend to run? I've used the macOS version of World of Warcraft on my '20 Mac Mini (16GB RAM) and even with utilities that adjust the mouse acceleration curve, I still find game play clunky. I was hoping I could run WoW under a VM and have it be somewhat performant.
For gaming, you want to use Crossover or the FOSS Whisky app. Parallels only runs Arm Windows which then emulates x86. This is much much slower than using Wine to translate system calls and Apple's Game Porting Toolkit to handle the Vulkan or DirectX graphics. Crossover and Whisky take care of the internals of those for you. Give those a shot, I think you'll find it much better than a full VM. In my experience some games do run better this way than the MacOS versions, though that's usually because the Mac client wasn't compiled for Apple Silicon and so Rosetta is emulating. Unfortunately, I'm pretty sure WOW is already Apple Silicon native, so you probably won't get better performance this way.

Crossover is paid but has better compatibility: https://www.codeweavers.com/crossover/ (or see https://www.codeweavers.com/compatibility for compatible games)

Whisky is free, and will work just as well for games it supports, but has compatibility with fewer games (no official list, so you just have to download it and try yourself): https://github.com/Whisky-App/Whisky

For the mouse stuff, try a USB mouse if you're not already using one, combined with https://github.com/ther0n/UnnaturalScrollWheels to disable acceleration and fix the scroll wheel.

That works really well for me to get a Windows-like mouse curve.

TLDR skip the emulation and go for translation layers via Crossover, Whisky, and GPT. It'll be much faster. The mouse thing is separate and has nothing to do with the graphics layer.

------

Personally though, I'd just pay $20 a month for Geforce Now. It is much much faster than even the highest end Mac. I don't think WOW is on there, but for supported games, it's a phenomenal experience... sold my 3080 desktop and replaced it with GFN on my Macbook. It's fantastic.

Supported games: https://www.nvidia.com/en-us/geforce-now/games/

Thank you for your detailed reply. :)

I will give USW a try. I hadn't heard of that project before.

Also, I'm happy to have read that MS will be making all ActiBlizz titles available once again on GeForce Now once its acquisition is complete.

What is the bandwidth requirement I wonder. Seems too cheap to be true … must have some other catch. Latency as well?
For GeForce Now? Not much:

From https://www.nvidia.com/en-us/geforce-now/system-reqs/:

- 15 Mbps for 720p @ 60FPS

- 25 Mbps for 1080p

- Up to 35 Mbps for 4k/120 FPS

Input latency is there, yes, but it's not too bad especially if you turn on Nvidia Reflex and use the hardware cursor. Totally unnoticeable in many games. For first-person shooters it's definitely noticeable, but IMO still playable as long as you're not doing it competitively. I play shooters on it from time to time... and put it this way, I would much rather do that (on max graphics) and deal with the minor input lag, than to try to get them running on my Mac, all to get super low graphics with low draw distance, etc.

It's never going to beat a 4090 on your desk, but for $20/mo...? It's an incredible value.

I don't know that there really is a "catch" beyond basic network principles/limitations. Game streaming has been developed for more than a decade now... when OnLive first came out, the technology (home internet and hardware encoding) wasn't quite there. Now 35Mbps is commonplace, Nvidia has hardware encoding in all their cards, AND they control the entire stack of their data center like no one else can. Stadia's failure was IMO a Google management problem more than any technical limitation. GeForce Now is a much much better service, both using your existing Steam library and supporting way more games.

The pricing does seem really good, especially compared to Shadow.tech (where you rent a whole gaming VM with a 3070 Ti for $50/mo, but can run anything you want) or AirGPU (similar service). But the games-as-a-service platforms like Amazon Luna, Xbox Cloud Streaming, and PS Plus are all comparably priced ($10-$20/mo). There are other third party services like Boosteroid too. Cloud gaming is a maturing technology that's largely already "there", in my experience (have tried nearly all of them over the last 10+ years).

I think Nvidia is uniquely positioned as the only company in this space who can provide the graphics cards first-party instead of needing to buy them from, well, Nvidia. It's possible that the current pricing is a loss leader, but they've already raised the prices from the Founders pricing they had a few years ago, and it's still not too bad. It's not like Nvidia is hurting for cash anyway. My main fear is not that there's a "catch", but that they'll gradually move out of the gaming segment and focus on AI.

In the meantime, while it lasts, GeForce Now really is wonderfully, uh, game-changing :)

----------

Edit: PS they have a free tier, and you can even use it in a browser tab, no client download needed. That's enough to give you a taste for free, no commitment. If you decide you like it, the Ultimate plan is very much worth it, and the desktop (or mobile) clients offer slightly better UX than the browser tab and higher resolutions.

When I first got it I tested a few games on my 2022 M1 Max 64GB 16" MBP both natively and in Windows ARM.

The only one that I remember is Crusader Kings II. It has a native MacOS version which I tried and it ran pretty rough. Very, very choppy on the map. I didn't tweak any graphics settings from the defaults and put no effort into making it run better, FWIW.

Next, I ran it via Windows ARM in Parallels. Now that I'm writing this I have no idea what I did to test it. I feel like it just ran but I don't think I did anything specific to make an x86 process run on ARM. Maybe Windows ARM does that for you, I forget.

Anyway, it ran really well. Absolutely much, much better than the native app. It felt completely smooth navigating the map, etc. I did NOT play it in a big game that lasted hundreds of years. I probably did 5 turns, mostly checking to see how smooth scrolling the map and the UI/UX stuff was.

I have a 4090'd gaming desktop so it wasn't a big deal to me to be able to game on the mac which is why I put as much effort into this as you can see. lmao.

It's amazing at everything else!

> I feel like it just ran but I don't think I did anything specific to make an x86 process run on ARM. Maybe Windows ARM does that for you, I forget.

Yeah, Microsoft doesn't get nearly enough credit for this, but Windows for Arm just automagically emulates x86 for you! Kinda like Rosetta, but for Windows.

https://learn.microsoft.com/en-us/windows/arm/apps-on-arm-x8...

Not OP, but I use Parallels on M2 and gaming is a bit hit-or-miss. I'd say maybe 80% of games work flawlessly, and 20% have some sort of issue ranging from the annoying to the unplayable.

For non-gaming, Parallels is extremely solid. I use Visual Studio and various productivity apps and they all work perfectly -- although Parallels is enshittified scumware that pops up ads at every available opportunity, so if that kind of thing bothers you, it's worth considering it before buying.

Ads about what? Upgrading to a more expensive tier or like third party ads?
Upgrades and extras, yeah. No third-party ads.
YMMV, but from my own experiments, on an M1 Macbook Air, it did not work well for me. I was trying to compile an Elixir codebase on x86-64 Alpine Linux. Elixir does not have cross-compiling. I tried it in a Docker container, and in a Linux VM using OrbStack. Both approaches fail, as it just segfaults, even on the first `mix compile` of a blank project.

This problem does not exist in ARM containers or VMs, as the same project compiles perfectly in an ARM Alpine Linux container/VM.

It's definitely not plug-and-play for all scenarios. If anyone knows workarounds, let me know.

That’s an underlying QEMU bug, which is used by Lima [1]. Add `ENV ERL_FLAGS="+JPperf true"` to your Dockerfile and it will build just fine cross platform. The flag just changes some things during build time and won’t affect runtime performance.

[1] https://gitlab.com/qemu-project/qemu/-/issues/1034

Thanks. I can confirm that this works. Compiling a new project no longer segfaults, and `Mix.install()` works in `iex` too.
HN just turned into Stack Overflow. :)
In that case can this whole thread be deleted and replaced by a link to an almost completely unrelated issue that used some of the same English words in the description? Just trying to get the full effect here.
What are you really trying to compile? This seems like an X vs Y problem. You should throw out the whole Internet and try again.
For anything that doesn't need a UI, you're FAR better off having some remote server than trying to emulate, it's far to slow for ARM64<>x86-64 in both directions..

Many things are just so much easier with a remote server/workstation somewhere than trying to deal with VM shenanigans.

ARM64 visualised on the otherhand (Linux works great, macos seems good(?), haven't tried Windows) with UTM is pretty great.

I absolutely agree! I finally went in that direction. The only reason I was trying this whole ordeal was because I was trying to get some private dependencies included in the build without going through the whole hassle of git submodules. Now I just include those deps as a path include in mix.exs. Not a great solution I know...
I’ve been able to do this (build x86/ubuntu targeted elixir) with UTM on my M1 Mac. It ain’t fast, that’s for sure. But it works. Which is interesting because sibling responses to your Lima experience claim it’s because of a qemu “bug”, but utm runs qemu as well.
The bug is triggered by the JIT - maybe you didn’t have it enabled?
> Elixir does not have cross-compiling.

Elixir compiles to beam files, like Erlang, right?

I was pretty sure beam files are bytecode and not platform specific?

You're right that Elixir source code compiles to BEAM bytecode, however, if you run `mix release`, you need to ensure that the release runs on the same target OS and OpenSSL version. My aim was to build a `mix release` on my M1 Mac to run it on an x86-64 server.

From the docs [0]:

> Once a release is assembled, it can be packaged and deployed to a target, as long as the target runs on the same operating system (OS) distribution and version as the machine running the mix release command.

The `mix release` command outputs a directory containing your compiled Elixir bytecode files, along with the ERTS (Erlang Runtime System). The ERTS it bundles is only for your host machine's architecture. Another point to remember is that some dependencies use native NIFs, which means they need to be cross-compiled too. Hence it's not as easy as replacing the ERTS folder with one for another architecture in most circumstances.

There's a project that aims to alleviate these issues called Burrito [1], but when I tried it, I had mixed success with it, and decided not to use it for my deployment approach. It looks like Burrito has matured since then, so it would be worth taking a look into if you need to cross-compile.

The gist is, while possible, its significantly harder to get an Elixir release running on another architecture than say is the case for Go.

[0] https://hexdocs.pm/mix/1.16.0/Mix.Tasks.Release.html [1] https://github.com/burrito-elixir/burrito

I regularly use Orbstack to develop for x64 Linux (including kernel development). It works transparently as an x64 linux command line that uses Rosetta under the hood, so performance is reasonably good.

It can also run docker containers, apparently faster than the normal docker client, although I haven't used that feature much so I'm not sure.

You can use Rosetta to run x86 Linux binaries with good performance under a virtualised ARM Linux [0], but if you want to run fully x86 Windows or Linux you’ll need to emulate, not virtualise. It’s possible, but there’s a big performance hit as you might expect.

[0] https://developer.apple.com/documentation/virtualization/run...

I'm not sure how OrbStack does it, but it can run a fully x64 Linux using Rosetta with quite good performance.
IIRC that runs a x86_64 userland (using Rosetta) on a arm64 kernel.
Interesting. uname -a reports x86_64, and lscpu also reports x86_64, although perhaps that's just the kernel being patched to lie about the architecture.
Not the kernel, but yes: the runtime lies about its architecture.
I do my work on Apple Silicon laptops since the first M1 came out.

I use Docker Desktop that can run for me amd64 images as well.

I do run Splunk in it (which is a very enterprise product, written mostly in C++), I was so shocked to see that I was able to run it on Rosetta pretty much from day 1. Splunk worked on macOS with Rosetta from day 1, but had some issues in Docker running under QEMU, now Docker uses Rosetta for Linux, which allows me to run Splunk for Linux in Docker as well.

I use RedHat CodeReady Containers (local OpenShift), which works great as well.

And I use Parallels to run mostly headless Linux to run Kubernetes. And sometimes Windows just to look at it.

In a first two years of Apple Silicon architecture I definitely had to find some workaround to make things work. Right now I am 100% rely only on Apple Silicon, and deliver my software to large enterprise companies who use it on amd64/arm64 architectures.

Your mileage may vary, but I've been quite happy running x86-64 software in an ARM build of Windows 11 in UTM.

Nothing graphical or all that intensive though, just some productivity tools I can't live without.

What hardware are you running this on out of curiosity?
M1 Macbook Pro
I run full AMD64 containers using Docker Desktop, which uses Rosetta under the hood. On my M1 Pro they were a bit slow (maybe 25% slower than my work laptop, which is a 12th gen. i9), but good enough in general. I have since upgraded to an M3 Max and AMD64 VMs seem to be a lot faster, maybe even faster than my 12th gen. i9. I really hope Apple doesn’t get rid of Rosetta support in VMs, ever. It’s just too useful.
Very slow using qemu. You can run arm64 Linux and run x86_x64 apps inside using Rosetta, if your virtual machine uses Virtualization.Framework (does not work with qemu, AFAIK). I suppose you can do the same with arm64 Windows and Microsoft x86_64 translation technology, but not really sure.
You can use qemu -accel hvf.
I wish there was a good GUI-based solution for Windows emulation via Rosetta. My use case isn’t development - it’s running software with an x64-only proprietary driver! (The Oculus remote link drivers, FWIW.) Fusion and Parallels don’t have that feature, so I’m wondering whether there are technical difficulties/blockers there.
The article is about virtualization, not emulating x86-64, so I'd disagree it's dancing around that. (Also, Windows and Linux have their own x86 emulations - if you boot virtualized Windows/ARM or Linux/ARM, you can get to the native emulation functionalities)
I'm a big windows guy, pretty much windows only. Recently bought a macbook. I love windows so much that I set up my shell on the mac to be powershell and use Windows Terminal to SSH into the mac.

I'm REALLY happy with parallel desktop. It runs any productivity or programming app I've needed. It also makes it as if it's running natively on the mac, you can just open up some windows app and it pops up like a mac one. It works amazingly fast, and I can develop both x64, x32, ARM apps in visual studio on my VM. Games don't work because of DRM, but I just use Parsec to stream my desktop if I want to game anyways, so it doesn't affect my workflow. And any game I would actually play while traveling is on the mac natively.

For linux I only emulate Kali, and it works good, I love how the VM's pop up as a "Virtual desktop" so I can side swipe it, but linux vm's don't have the native integration like Windows. Once nested virtualization is enabled, i'll probably stick it in WSL, I personally don't use Linux that much since I think it's shit.

The only downside is some asshole at Apple won't put in nested virtualization for the VM's, even though M2 and M3 have support for it on linux.

If you don't mind me asking, why did you buy a macbook?
It's my first Mac, and I bought it because the actual machine is magical. It's so well built and has so many little things that make it great. I thought it was dumb and overhyped until my girlfriend got a M2. I then looked up the virtualization and played around with it a bit, and bar games, it's the best laptop for running Windows apps. And even then, it runs every game I would play on the road.

I also really liked the memory layout they have. I have been messing around a ton with ML/AI, it's able to do local models faster than chatgpt and get like 70% the accuracy. I have a pretty beastly desktop setup, and it's a joy to use such a solid machine in bed while i'm watching TV.

I was able to get a fully functional Windows 11 install using UTM on my M1 MBP. This really helped with some Windows-only android tools with USB passthrough.

I've not tried Linux.

Note: I am not associated with UTM in any way, just a satisfied user.

[1] https://mac.getutm.app/

I've always wondered what the security posture is of UTM, QEMU, etc. Is an escape trivial or is there thought put into security?
There's at least a bit of work put into security, yes.
Probably ARM Win 11 though right?
ARM Windows runs well with Parallels. And it can run x86 apps.
Yes, this is the best way to do it if possible in my experience. I use some fairly heavy x86_64 apps in the Arm for Windows in Parallels, using Windows’ translation system (rosetta 2 equivalent), and it’s been quite good.

Trying to emulate the whole x86_64 version of an OS (I tried some Docker images that only came in x86 before finding instructions to rebuild them on the ARM base OS) has been super slow on the other hand. This is on a quite decent M2 Pro.

Some x86 apps refuse to run on ARM, having platform detection built-in to their installer.
If it's an MSI-based installer, it's pretty easy to edit the MSI with Orca to remove the check. This is similar to how you'd get client software installs unblocked on Windows Server. In other cases, there are often ways to trick it, but it's contextual.