Live data from Hacker News

Osx-kvm: Run macOS on QEMU/KVM

github.com

1–10 of 111 posts

Re: Osx-kvm: Run macOS on QEMU/KVM

#5
post #2

Previous post from 2016 with 89 comments: https://news.ycombinator.com/item?id=12556609

Yeah, one has been able to do this for some time now.

A few years ago I had a setup where (and I admit much of this was for the aesthetic purity of it, not practical reasons), I used a legally purchased copy of macos, copied it unmodified to my VM server, and, with a decent amount of effort, and a patched qemu (for the SMC thingie -- i donno if by now the patch is in mainline), was enjoying a non pirated, non modified macos on a linux host.

I even got USB and BLE passthrough working, so I could use the mac VM for iOS app development.

It was quite effective.

A more challenging project I did later (which I probably deserve some derision for not documenting and sharing) is "How to develop, sign, and upload iOS apps entirely from debian linux, entirely with F/OSS, no VM, no Xcode, just good ol' emacs and cmake". IIRC, there were very little Big Contributions I did, but plenty of assembling a large variety of other projects, bug fixing them, and making an integrated environment.

Re: Osx-kvm: Run macOS on QEMU/KVM

#6
post #4

Soooo any way this can help run OS X in docker?

I googled > and this was the 5th entry:

https://github.com/Cleafy/sxkdvm

Though maybe you can enlighten me -- why the heck would you want to? It's in a VM -- you already have fantastic isolation. Why clutter it with an extra layer of packaging that to my naive eyes adds no more value?

Like, a cool hack might be running macos...._slowly_.... on a SBC like a raspi :D But when you have real virtualization, what's the use of docker? (honest question)

Re: Osx-kvm: Run macOS on QEMU/KVM

#7
post #6
post #4

Soooo any way this can help run OS X in docker?

I googled > and this was the 5th entry: https://github.com/Cleafy/sxkdvm Though maybe you can enlighten me -- why the heck would you want to? It's in a VM -- you already have fantastic isolation. Why clutter it with an extra layer of packaging that to my naive eyes adds no more value? Like, a cool hack might be running macos...._slowly_.... on a SBC like a raspi :D But when you have real virtualization, what's the us…

Docker offers a simple way to provision the VM - install software, configure networking, execute apps... Docker itself is not a VM or isolation, it uses other tools for that (linux containers in the past, not sure how it works today), it's value is in the ease of use provided by its tooling.

Re: Osx-kvm: Run macOS on QEMU/KVM

#8
post #6
post #4

Soooo any way this can help run OS X in docker?

I googled > and this was the 5th entry: https://github.com/Cleafy/sxkdvm Though maybe you can enlighten me -- why the heck would you want to? It's in a VM -- you already have fantastic isolation. Why clutter it with an extra layer of packaging that to my naive eyes adds no more value? Like, a cool hack might be running macos...._slowly_.... on a SBC like a raspi :D But when you have real virtualization, what's the us…

Docker uses a single Linux kernel for all containers. Docker containers are much lighter weight than VMs, since each VM must run a full kernel instance.

Re: Osx-kvm: Run macOS on QEMU/KVM

#9
post #6

Earlier quoted context omitted.

I googled > and this was the 5th entry: https://github.com/Cleafy/sxkdvm Though maybe you can enlighten me -- why the heck would you want to? It's in a VM -- you already have fantastic isolation. Why clutter it with an extra layer of packaging that to my naive eyes adds no more value? Like, a cool hack might be running macos...._slowly_.... on a SBC like a raspi :D But when you have real virtualization, what's the us…

Docker offers a simple way to provision the VM - install software, configure networking, execute apps... Docker itself is not a VM or isolation, it uses other tools for that (linux containers in the past, not sure how it works today), it's value is in the ease of use provided by its tooling.

I'm familiar enough with Docker to know of it as a combination of lxc, cgroups, and probably other things so that I can have 1 machine, 1 kernel, and yet multiple userspaces. These userspaces are not (as i understand it) Securely Isolated from eachother, but enough so that if there existed some monstrosity of a complex piece of software, which required lots of dependencies and customization, it might make sense to put it in a chroot, or a docker for the CoW benefits.

But what I'm not following (and again, I don't get the point of Docker, I don't use it, so in trying to learn I'm assuming you must know more...) is how it assists provisioning the VM as you say. Sure, it could _change_ the provisioning of the _host_ (i'm calling the inside of the docker container the host in this context). But it's not like the binaries being executed in the container is the mac operating system. It's a VM that within THAT is the mac operating system.

If I have mac running on a VM on a linux host, I still need to log in to that mac guest to configure networking, execute apps, install software.... So how did adding docker to the picture make it easier?

Hence my confusion.

Re: Osx-kvm: Run macOS on QEMU/KVM

#10
post #6

Earlier quoted context omitted.

I googled > and this was the 5th entry: https://github.com/Cleafy/sxkdvm Though maybe you can enlighten me -- why the heck would you want to? It's in a VM -- you already have fantastic isolation. Why clutter it with an extra layer of packaging that to my naive eyes adds no more value? Like, a cool hack might be running macos...._slowly_.... on a SBC like a raspi :D But when you have real virtualization, what's the us…

Docker uses a single Linux kernel for all containers. Docker containers are much lighter weight than VMs, since each VM must run a full kernel instance.

Yes, that's what I said. (although in a comment below this one. ;))

A container is much lighter weight than a VM, yes. (and so is a chroot)

But the MacOS userspace isn't running on the linux kernel, it's running on darwin. So, macos-in-docker would be an entire qemu installation in docker, with a macos image inside that.

EDIT: Ahhh, because it doesn't make sense to run a full operating system in a container, only a single program, I'm guessing that what OP really wants is some way to dockerize a specific (or several) macos apps. To do so, you'd need a way to wrap the linux kernel do it can provide a darwin like api, as well as the same for any required libraries.

OP: You may find this project interesting: https://www.darlinghq.org/project-status/

They made a MacOS to Linux translation (not virtualization) layer of sufficient quality that you an run a decent amount of (text only) native binaries.

Post reply on HN