Live data from Hacker News

Running GUI Linux in a virtual machine on a Mac

developer.apple.com

111–120 of 206 posts

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

#112
post #56
post #42

Earlier quoted context omitted.

Maybe I'm missing something, what are the actual commands for running a Linux x64 binary on macOS ARM?

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?

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

#113
Are there any good, free desktop hypervisor apps for ARM macOS at this point? I always used VirtualBox on Intel but they don't support ARM guests on ARM hosts so I've been stuck using qemu, which is not so great performance-wise. I know I can use the APIs linked here but I would rather not build my own hypervisor client if at all possible haha

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

#114
post #93
post #81

Earlier quoted context omitted.

It takes some work, but you can pass in an XQuartz display to a Docker container and have it render to that.

Link?

The closest thing I’ve seen to a comprehensive write-up is this: https://medium.com/@mreichelt/how-to-show-x11-windows-within... (medium, unfortunately)

We’ve been using it experimentally to run an ephemeral instance of Firefox that we can programmatically inject DNS and CA certs into, for localhost HTTPS development. It’s not documented yet, but the config is here: https://github.com/drifting-in-space/plane/pull/201

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

#115
post #91

Earlier quoted context omitted.

Isn't UTM a frontend for these APIs?

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.

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

#116

It seems there is some confusion of what this page is about or why it might be relevant. This is not about an end-user product to run desktop virtualisation, but it is a page for developers in the Apple ecosystem to programmatically make use of OS-native virtualisation to create virtual machines with graphics output. The value in this is not as much that "it is possible" because there are plenty of implementations of…

> VirtualBox doesn't work on ARM by the way, they only release for x86(_64). Because VirtualBox is not a CPU emulator, unlike QEMU, MAME/MESS, and other emulators. Virtualization software such as Fusion and Parallels run VMs of operating systems that match the architecture of the host OS. Intel VMs like those in VirtualBox will not run on Apple Silicon, and Apple Silicon VMs won't run on Intel. The CPU instruction se…

Just want to point out that QEMU can use your CPU's hardware virtualization extensions for VMs of the same architecture as your host, it's not exclusively an emulator.

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

#117

Earlier quoted context omitted.

GNU Coreutils - https://ports.macports.org/port/coreutils/ - partly helps with this on macOS, but yes, custom distros are much better solutions.

GNU coreutils are essential on macOS, and Apple should just include it by default. \o/

Um… GNU’s license is incompatible with Apple; that’s why Bash 3.2 is the current version for macOS.

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

#118
post #61
post #57

Earlier quoted context omitted.

Has anyone seen a guide to installing OpenBSD on M1 Mac using UTM?

No, but given that UTM is a graphical wrapper around QEMU would this be a worthy substitute? https://codeofconnor.com/running-an-arm64-openbsd-virtual-ma...

Thanks. I’ll give it a go.

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

#119

Earlier quoted context omitted.

The only problem seems to be that it won't allow you to run an earlier OS X that can still run 32-bit programs.

Another problem is that it's not programmatic (e.g., like Vagrant), so it's tiresome to spin up/down a bunch of VMs.

There are several tools to create VMs from the CLI or scripts like QEMU, docker machine, and podman machine.

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

#120
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?

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 yet released in stable macOS) Rosetta for Linux translation.

Post reply on HN