Live data from Hacker News

macOS in QEMU in Docker

github.com

131–140 of 190 posts

Re: macOS in QEMU in Docker

#131

Can macOS virtual machines ever be performant enough to use as a workstation? So far I have only tried setting it up in VMWare and VirtualBox, the performance wasn't there but I haven't dedicated a GPU or drive to it yet. It would be so convenient to decouple macOS from Mac hardware.

I run macOS (currently Mojave) on a 8 core, 16GB KVM on top of Debian on a 16 core 64GB Ryzen. It's faster than the (older) Mac Mini I used to use for everything I've tried on it. I don't know how it compares to current apple hardware, but for my purposes (doing the bits of macOS-specific code development in a large native cross-platform application), it's about as perfect as it gets.

Re: macOS in QEMU in Docker

#132

Does it have to be a Linux host? Can it be a Mac OS X host?

Not sure why you getting downvoted.

Here is another solution posted 12 days ago that works on macOS: https://news.ycombinator.com/item?id=23284987

I didn't try it yet but I plan to use it to test Ansible playbooks targeting macOS.

Re: macOS in QEMU in Docker

#133
post #51

Earlier quoted context omitted.

Luckily, a lot of the things are nails. The number of applications you can keep neat and tidy with a fleet of containers is so great. Even a relative novice can get some great things working by poking about a few guides. And when it all breaks you can start again without too much collateral damage.

I'd argue that I was able to do the exact same thing 20 years ago using VMWare Workstation - download a VHD image with OS and app(s) pre-installed and configured, optionally map to a drive on the host OS and get started instantly... Maybe I'm too old to get the appeal of "a fleet of containers" in place of a single (and potentially throw-away) VM image along with maybe even a vagrant-script to make it easily reproduc…

Running multiple containers is faster and more efficient than multiple VMs. Running a container on the same kernel as the host is faster and more efficient than a VM. If you're trying to run an app across different OS kernels, you still have to use a VM unless you can compile your app on that kernel natively. This project really doesn't do much beyond what a VM gets you, and you still have to configure the host outside the container to enable virtualization.

Re: macOS in QEMU in Docker

#134
post #110

So this is pretty misleading. It's really a full system emulator (qemu) running inside Docker, using root privileges on the container that make the isolation very weak (--privileged). It also uses hardware assisted virtualization (KVM) which is not going to be available most of the time Docker is. You can think of the Docker platform itself as subset of the Linux platform. With many common features removed by default…

(Darling requires a kernel module, which also isn't a thing you are able to do in the context of Docker as you are often just working with the host kernel.)

Wow! This is highly surprising and is totally unusual! They're embedding parts of the XNU kernel in Linux. I can imagine this was done as a last resort as there is pretty much no chance this will ever get upstreamed, not just because of licensing, but also simply just strangeness.

Re: macOS in QEMU in Docker

#136
post #120

Earlier quoted context omitted.

If a tree falls in a forest and no one is around to hear it, does it make a sound?

If we are going to divert into Zen koans and non-dual philosophies, then it is definitively "yes it did". The falling away of the perception of an intrinsicly-existing self doesn't change that there's still perception. It would make a sound the same way there is a sound made when one hand claps. Back on topic though: it's too bad Apple doesn't allow licenses for running things headlessly like this.

>Back on topic though

You over-philosophized to the point of bringing their kitschy koan off-topic.

How I interpreted the use of the koan : Apple has no history of legally chasing those who virtualize their operating system; as this is a non-topic thusfar -- who cares?

The hammer may fall one day, but so far 'why are we worried about a legal response that doesn't seem to exist?'.

The answer, of course, is that anyone who builds product based on a legally grey area is at risk when that area begins to crumble.

>it's too bad Apple doesn't allow licenses for running things headlessly like this.

agreed, but I think Apple wants to drive everyone to a hardware solution.

At one point 'enterprise-ish' hardware was offered, but now it seems that it'd be in their interest to offer virtualization licenses while trying to smooth out whatever troubles exist between their software and the major VM hyper-visor offers out there -- mostly since there are huges holes in their hardware offerings for those seeking to do 'enterprise-ish' things en masse.

Re: macOS in QEMU in Docker

#137
post #120

Earlier quoted context omitted.

If a tree falls in a forest and no one is around to hear it, does it make a sound?

If we are going to divert into Zen koans and non-dual philosophies, then it is definitively "yes it did". The falling away of the perception of an intrinsicly-existing self doesn't change that there's still perception. It would make a sound the same way there is a sound made when one hand claps. Back on topic though: it's too bad Apple doesn't allow licenses for running things headlessly like this.

I'd interpret that koan to mean that those in isolated woods can make noise without being heard.

Say I have a personal project with a few dozen users. Somebody reports a bug on osx -- I don't do windows, I don't do macs, so I'd need to rely on my small community to fix it. With a pirate copy, I'd be able to do the fix -- and none would be the wiser.

Scale that up to a company, put it up on a public repo's CI, and that's when people might hear the tree fall.

Re: macOS in QEMU in Docker

#139
post #59

OT: Has anyone Found virtualization really resource in the latest OS X? It was eating up 25 percent of my RAM doing nothing. Both Docker and Vagrant were so resource hungry that I ended up ditching them.

The last version of Docker for Mac had some big resource issues, current latest version seems to be better, but still makes my 2017 MBP into a grill when running multiple containers.

Re: macOS in QEMU in Docker

#140

Edit: Okay, I understand my assumption was wrong. Thanks Doesn't docker run a container in a single thread? So this would be running the entire MacOS in a single thread? Is there a way to tell Docker to execute this in multiple threads?

No, that isn't how containers work. Containers run processes, as many as you want, each which can use as many threads as they (up to ulimits). Most hypervisors will allocate 1 thread per virtual CPU core by default, and since this is using qemu with KVM then that's likely the case. Looking at the Dockerfile in the OP, you can see it's using https://github.com/kholia/OSX-KVM/blob/master/OpenCore-Boot.... as the script…

You can read the main Github page here: https://github.com/kholia/OSX-KVM

It only works on Macs, it needs the toolchain and ROM I guess? Docker is just one step closer to porting it on the Windows and Linux platforms.

Personally, if I wanted to run MacOSX that badly, I'd buy a Mac Mini or the lowest-priced Mac they have. Much easier and worth it for the AppleCare and Warranty.

Edit: grammar and spelling.

Post reply on HN