Live data from Hacker News

macOS in QEMU in Docker

github.com

71–80 of 190 posts

Re: macOS in QEMU in Docker

#73

Earlier quoted context omitted.

According to Apple software license agreements, yes, it is too much to ask. You can not legally run Mac OS on non-Apple hardware. But don't be sad, their new Mac Pro is fantastic .

It's also £5,499.00 in the UK (just under $7k USD). Not exactly ideal for hobbyists.

And that's before the wheels.

Re: macOS in QEMU in Docker

#75

I just want a good CI/CD system for macOS to build iOS apps without needing to buy a farm of Mac Minis, or even buy a Mac, is that too much to ask?

If you make games, Unity Cloud Build can turn a Unity project into a downloadable IPA that you can easily load into TestFlight/App Store (and presumably a device or simulator, but I've never tried).

Re: macOS in QEMU in Docker

#76

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.

The problem is cocoa performs terribly without gpu acceleration and nobody has figured out how to get around that, there are some tweaks to get OSX running in vmware and wherever else but you never wind up with working GPU acceleration so not only can you not change the resolution once you turn it on (iirc, may be wrong here), it's refresh rate is horrendous. If you ever used Windows before it installs the gpu drivers where the window manager is all weird and unoptimized and glitchy, it's that but worse.

It's been a long time since I played with macos vfio passthru stuff but maybe that's a way around it nowadays. There's a little /r/vfio community that tries to tackle it pretty frequently.

Hopefully someone else has more recent details than me, I'm back to using osx hardware now that the 16" mbp lets me have 32gb.

Re: macOS in QEMU in Docker

#77

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…

I don't care though. What I care about is that it's a pain in the butt to do CI/CD pipelines for an application with iOS/OSX support. So if someone has a headless OS X contraption on offer, I want to hear some more about it.

The last time I set this up, a manager decided he wanted a laptop like the rest of us instead of the iMac he got. He asked semi-jokingly if someone wanted the machine for anything and I said "Yes, I do" before he even got the sentence out.

There was just enough memory on the machine for me to set up a few Jenkins agents on it, one for Safari, the rest using the Selenium-maintained docker images.

Re: macOS in QEMU in Docker

#78

Earlier quoted context omitted.

I'm pretty sure since Docker uses bhyve on mac, so that would be a nested VM...

Docker has their own xhyve derivative called hyperkit. Nested VMs are not supported https://github.com/moby/hyperkit/issues/127

You can use Docker Machine and whatever backend you want, including xhyve, VirtualBox, and VMware Fusion, and enable nested virtualisation in the created machine.

Re: macOS in QEMU in Docker

#79
post #70

Earlier quoted context omitted.

If you have container orchestration in place, being able to use it to run VMs via qemu is actually incredibly useful and isn't really much of a yikes. Sure, you're losing the container's isolation features, but you have a VM there, which is even stronger isolation. We do CI for our VM images in our kubernetes clusters. The build system already was in kubernetes, so putting the OS image testing in there was a big win.…

I work at Sourcegraph and have been considering something like this for a while for running long-running jobs, things like CI pipelines and GitHub actions for example. How would you feel about an app like GitLab, for example, shipping a docker container that required privileges for this, I wonder?

It'd definitely be a harder sell for third party software to require a privileged container and /dev/kvm mounted when you run it in your environment, especially since nested virtualization is largely unavailable in AWS. It also requires that the correct kvm kernel module is loaded, etc.

However, if it was a product that required virtualization and that was recognized as a requirement, then also distributing a docker image that could do it would probably be useful for people in the "and if you don't have virtualization infrastructure, but have container orchestration and nodes that support virtualization, our service will also work in a privileged container" camp

Re: macOS in QEMU in Docker

#80

Earlier quoted context omitted.

Docker has their own xhyve derivative called hyperkit. Nested VMs are not supported https://github.com/moby/hyperkit/issues/127

If I am not mistaken then xhyve and hyperkit are separate projects utilizing the same Hypervisor Framework from Apple under the hood.

hyperkit is a fork of xhyve, plus stuff like bridges between inotify and kqueue/fsevents, or transparent tcp port forwarding.

Hypervisor.framework is an API to execute hypervised code, to build virtualisation engines that can run unprivileged; you still have to write an actual virtual machine.

Post reply on HN