Live data from Hacker News

Running GUI Linux in a virtual machine on a Mac

developer.apple.com

101–110 of 206 posts

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

#102
post #5

UTM works great. Emulate X86, AMD64, or run on Apple Silicon. It's essentially a GUI on top of QEMU. https://mac.getutm.app/

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.

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

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

#103

Earlier quoted context omitted.

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 swear I'm not trying to be facetious, not trying to stir the same old tired "hurrr year of the linux desktop" shit... I have to ask: you accelerate development by 1 day/week, but do your devs lose any time with the accumulation of tiny annoyance such as sorting out bluetooth/audio/hibernation/battery drain?

Yeah I could see maybe going full Linux if everybody were working on custom built towers where maximum compatibility for each component can be assured and sleep won't be a problem, but I wouldn't want to be stuck with supporting a fleet of laptops running Linux. My Tiger Lake ThinkPad which is a couple generations old (no longer cutting edge) and about as standardized/boring as it gets (Intel for most components, no fussy discrete GPU) runs Linux ok but has sleep issues that hamper its usefulness as a laptop.

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

#104

Earlier quoted context omitted.

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 re…

Anything in the logs? It just works for me on xps (fedora since 28 till latest). Fwiw, my mac has issues with sleep, so there seems to be some luck involved either way.

My last Intel MBP had sleep issues (2019 i9), but this M1 Pro has been bulletproof.

I will look in the logs. I am also planning to “upgrade” to Ubuntu 22.10 when it comes out since it will ship with an Ubuntu-patched 5.19 kernel. Failing that, if I don’t find anything in the logs or don’t have time to find a root cause (more likely), I may have to give up and switch to Windows 11 (sigh).

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

#105

Earlier quoted context omitted.

You can, but running Linux with a graphical desktop on VirtualBox under MacOS has become extremely sluggish in my experience. I don't know whether newer releases of MacOS or VirtualBox itself are to blame. It was much snappier 8 years ago even though I had a significantly slower laptop then.

> You can, but running Linux with a graphical desktop on VirtualBox under MacOS has become extremely sluggish in my experience. Huh? It's actually faster than ever, and near native experience. And the post is not about "how to run" a virtual machine as an end user or dev (for that the way the parent describes is still the suggested way). It's about how to program running it under the hood if you're a developer who wa…

I'm only referring to the VirtualBox experience asked about by qwerty456127. Running e.g. Debian with Gnome under MacOS became extremely sluggish for me. The screen re-renders slowly, like running a remote desktop over a slow network link. I did a lot of searching and setting-tweaking when I encountered the problem earlier this year. I never found a satisfactory resolution. I tried this fix:

https://mkyong.com/mac/virtualbox-running-slow-and-lag-on-ma...

as well as others suggested on the VirtualBox forums, but couldn't get it running smoothly. I didn't have any trouble with a similar setup several years ago.

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

#106

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…

https://download.virtualbox.org/virtualbox/7.0.0_BETA3/Virtu...

;)

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

#107
post #102

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.

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/

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

#108

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...

I've tried using this a while back, soon after Apple released Ventura beta to developers.

I can say that documentation (and examples) are quite nice and easy to follow, I managed to start Linux VM with Rosetta support, and SSH, in 1-2 hours.

Geekbench numbers were quite close when running in VM (via Rosetta) and natively, they were only a few percentages slower in VM, so it stands to reason that computation heavy workload would run great.

However, using development tools regularly resulted in segmentation fault or crashing for other reasons (e.g. when doing `npm install`). I didn't dig deeper to figure out what are the reasons for this.

Additionally, real-world (from developer's point-of-view) workloads such as running web servers, building software, or running tests, were quite slow compared to running in an ARM VM.

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

#109

Earlier quoted context omitted.

> 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…

https://download.virtualbox.org/virtualbox/7.0.0_BETA3/Virtu... ;)

For those not in tune with virtualbox, this beta lets you run 32-bit x86 guests on aarch64 macOS

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

#110
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/

That means that the host has to be on Monterey or higher. The guest can be any macOS version.
Post reply on HN