Live data from Hacker News

Running GUI Linux in a virtual machine on a Mac

developer.apple.com

131–140 of 206 posts

Re: Running GUI Linux in a virtual machine on a Mac

#131
post #29

Earlier quoted context omitted.

The opposite would be much more interesting and finally make cross-platform CI bearable without relying on closed source third-parties.

You'd still need a Mac with xcode for the build, no?

Not really, I'm already doing Rust builds with macOS SDK on Linux for M1/M2 which works... Fine I guess, but it's hacky as hell.

It's testing that's the problem really, where you really need the hardware.

Re: Running GUI Linux in a virtual machine on a Mac

#132

Does this have to be this complex? Can't I just fire up a VirualBox as I do on Linux and Windows and go ahead?

This documentation is more for the people who make virtualbox, rather than end users. All this is stuff that VirtualBox, etc already do on intel, you just don’t see it because you’re the end user.

Re: Running GUI Linux in a virtual machine on a Mac

#133
post #53
post #47

Earlier quoted context omitted.

I feel like I pretty much have full control over my Mac laptop. Why would you expect to fully control a machine from inside a VM anyway? Sounds like a massive security risk too.

Security is entirely orthogonal here. It's like saying you're ok with not being able to enter your own house because of security.

If I lose the key, sure, getting inside the house will be more difficult, isn’t that the entire point? Still, I don’t understand the relevance of the analogy. I have access to the entire system and can pretty much tweak things as I want. I also happen to prefer the default macOS security model with the sealed system volume. Where exactly is control taken away from me?

Re: Running GUI Linux in a virtual machine on a Mac

#134
post #112

Earlier quoted context omitted.

It seems overly complicated. Is there any benefit over using Docker?

I'm not sure what you think Docker on a Mac does. Docker is a Linux-specific piece of software, and the only way to use it within macOS is to run a Linux virtual machine, with Docker running inside the Linux VM. If the containers you want to run with Docker are x86 software, that Linux VM either needs to be an x86 Linux distro running in qemu emulation of a full x86 machine, or an ARM Linux distro using the new (not…

Sure, there is a VM in Docker as well. I'm sorry if it wasn't clear, I'm looking for the most straightforward way. With Docker it's a single command, it helps with documenting the steps for other coworkers. It feels slow though. I'm wondering if the new way with Rosetta is going to be better in performance.

Re: Running GUI Linux in a virtual machine on a Mac

#135
post #102

Earlier quoted context omitted.

The comment you replied to was about UTM, which does allow running earlier versions of macOS/OS X on Apple silicon hosts: Virtualizing OpenCore and x86 macOS on Apple Silicon (and even iOS!) https://khronokernel.github.io/apple/silicon/2021/01/17/QEMU... Run Tiger, Leopard, or any Mac OS X PowerPC version on M1 https://tinyapps.org/docs/tiger-on-m1.html

Their website says differently Note that macOS VM support is limited to ARM based Macs running macOS Monterey or higher. https://mac.getutm.app/

> Their website says differently Note that macOS VM support is limited to ARM based Macs running macOS Monterey or higher.

While ARM virtual machines are limited to Monterey and higher on Apple silicon[0], emulation works just fine for x86, PowerPC, etc.

Here's a video I cobbled together of UTM running Tiger on an Apple silicon Big Sur host: https://tinyapps.org/screenshots/tiger-on-m1.mp4

and another of the same host running Windows XP: https://tinyapps.org/screenshots/20210522-utm-xp.mp4

[0] https://kb.parallels.com/125561 "To run a macOS Monterey VM on Mac computers with Apple M1 chips, Parallels Desktop 17 uses new technology introduced in macOS Monterey, that's why it is not possible to run earlier versions of macOS on a Mac with Apple M1 chips."

Re: Running GUI Linux in a virtual machine on a Mac

#136

I can’t help but feel UTM pushed Apple to deliver this polished of a solution? Pulling this 100% out of thin air though.

UTM implements VF and QEMU implements HVF as an accelerator. I don't know why theres so much circling the wagons about them itt, these are complementary technologies. VF and HVF are not competition or a replacement.

Re: Running GUI Linux in a virtual machine on a Mac

#137
post #112
post #56

Earlier quoted context omitted.

You don't run the Linux x64 binary on macOS ARM. You run the Linux x64 binary on Linux ARM inside a VM on macOS ARM.

It seems overly complicated. Is there any benefit over using Docker?

Docker can benefit from it by running 1000x faster if they would be able to leverage Rosetta.

Re: Running GUI Linux in a virtual machine on a Mac

#138

Earlier quoted context omitted.

No. It uses qemu.

Pretty sure I downloaded it and it let me set up a machine with or without qemu. Asked if i want virtualization or emulation.

QEMU can do both virtualization (through Hypervisor.framework) and emulation. When you select "Virtualization" in UTM you have a checkbox "Use Apple Virtualization" which makes UTM use Virtualization.framework instead of QEMU. For "Emulation" it always uses QEMU.

Re: Running GUI Linux in a virtual machine on a Mac

#139

I can’t help but feel UTM pushed Apple to deliver this polished of a solution? Pulling this 100% out of thin air though.

They’ve been providing these APIs for a while for existing VM solutions in order to get rid of the kernel extensions previously needed. They keep evolving to support that use case. I’ve long thought it would be interesting to release Linux native apps in this sort of wrapper to the App Store.

I doubt you could. You need special entitlements to sign a binary using these APIs, I dont think a wrapper would be enough to grant you that entitlement

Re: Running GUI Linux in a virtual machine on a Mac

#140
post #99

Earlier quoted context omitted.

With Apple, it is all about exerting control and crippling softwares that don't align with their goals. Don't be surprised if Apple suddenly forces developers to only use their virtualisation API on macOS, just like they did for application firewalls (that are no longer allowed to have their own custom kernel extensions for "security" and "stability"). They are slowly squeezing macOS to make it more and more like ios…

> are no longer allowed to have their own custom kernel extensions for "security" and "stability" Why the "scare quotes"? Sounds totally justifiable. Third party kernel extensions have always have had issues with both security and stability.

It's not "scare quotes" - it's to convey sarcasm and justified scepticism. Sure, poorly coded third party kernel extensions can have security and / or stability issue. That doesn't mean that Apple is the only one who knows how to write such bug-free or secure system software. In fact, in the past most of the popular application firewalls (and VM softwares) on macOS came with their own kernel extensions and have worked fine without issues, and millions of users have used such applications without any issues. Now that Apple is forcing macOS developers to use their APIs, these software developers are at the mercy of Apple which is exactly what Apple wants - they will now be forced to negotiate with Apple for any changes or new features they want. Apple can now cripple a system developers ability to provide the kind of system software they want to offer to user. End result is that Mac users and developers both lose.
Post reply on HN