Live data from Hacker News

Running GUI Linux in a virtual machine on a Mac

developer.apple.com

41–50 of 206 posts

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

#41
post #13

So we can finally have docker for Mac that doesn't run egregiously slow?

Our solution was to run Linux native on all dev machines. Docker really is a Linux tool and it works much better under Linux. We were running JetBrains IDEs and doing mostly Go, Python and JS development, so the switch was pretty easy and painless.

The switch also dramatically reduced developer time spent solving Mac/Linux incompatibilities in tooling, and let us focus more on our product. Overall we accelerated development by about one day, per developer, per week. I was kind of surprised it was that much time, but looking back, there really are quite a few differences between the GNU userspace and MacOS.

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

#42

Wow, you can use Rosetta to run x86 Linux binaries inside the VM on ARM? That seems pretty awesome. https://developer.apple.com/documentation/virtualization/run...

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

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

#43
post #15

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.

I'm still waiting for a Wine-equivalent where iOS takes the place of Windows.

Not IOS yet but macOs middle-ware like WINE. https://www.darlinghq.org/

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

#44
post #37
post #17

Earlier quoted context omitted.

The only problem: becoming root doesn't mean you now control the device (you paid for).

We've sort of been at this point for a long time, though, the abstraction bar is just being shifted up. Previously, the bar was at the firmware level, where you will never fully control the black boxes governing the security chips, DRM implementations and real time OSes running on the microcontrollers inside the CPU. Now the OS (especially on Apple devices) is almost becoming like the firmware layer itself, so deeply…

I was sort of OK with the firmware being inaccessible when it couldn't talk to the internet. But times changed.

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

#45
post #42

Wow, you can use Rosetta to run x86 Linux binaries inside the VM on ARM? That seems pretty awesome. https://developer.apple.com/documentation/virtualization/run...

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

You just run them after you/your distro registers a handler for them. It uses binfmt behind the scenes.

https://en.wikipedia.org/wiki/Binfmt_misc

(To be clear, this is for running Linux x86 inside Linux arm64 VMs on an Apple Silicon host)

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

#46
post #13

So we can finally have docker for Mac that doesn't run egregiously slow?

Our solution was to run Linux native on all dev machines. Docker really is a Linux tool and it works much better under Linux. We were running JetBrains IDEs and doing mostly Go, Python and JS development, so the switch was pretty easy and painless. The switch also dramatically reduced developer time spent solving Mac/Linux incompatibilities in tooling, and let us focus more on our product. Overall we accelerated deve…

I'm seeing many more folks with Docker centric workflows take the same approach.

It's been mostly painless for me, minus the usual audio/Bluetooth snafu. Even those don't happen enough for me to be too concerned.

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

#47
post #17
post #12

The year of desktop Linux has arrived, where all major desktop platforms run Linux distributions inside virtual machines.

The only problem: becoming root doesn't mean you now control the device (you paid for).

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.

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

#49
post #42

Wow, you can use Rosetta to run x86 Linux binaries inside the VM on ARM? That seems pretty awesome. https://developer.apple.com/documentation/virtualization/run...

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

You can do this in UTM, it's a GUI that wraps QEMU.

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

#50
post #13

So we can finally have docker for Mac that doesn't run egregiously slow?

Our solution was to run Linux native on all dev machines. Docker really is a Linux tool and it works much better under Linux. We were running JetBrains IDEs and doing mostly Go, Python and JS development, so the switch was pretty easy and painless. The switch also dramatically reduced developer time spent solving Mac/Linux incompatibilities in tooling, and let us focus more on our product. Overall we accelerated deve…

What hardware and distro+kernel version are you using? I am trying to do this on a 12th gen. Intel Dell XPS, and to be honest the hardware support isn’t great. I had to install an upstream 5.19 kernel (rather than 5.15 that ships on Ubuntu 22.04). Sill, at least 2-3 times per week the machine fails to wake from sleep and has to be hard rebooted. Meanwhile my M1 Pro Mac 14” MBP routinely goes 3-4 weeks uptime, with reboots only for OS update. What am I missing?
Post reply on HN