8 ms·
OS X-KVM: Run macOS on QEMU/KVM
- cable2600 5y agoI haven't got a Linux box to run this on, I run Linux via emulation.
- Mogzol 5y agoIm running this on Windows though WSL 2. There's definitely a performance hit but other than that it works surprisingly well.
- skrowl 5y agoCan you post the steps you had to go through to get it working?
- Mogzol 5y agoSorry for the late response, just saw this. When I did it last I just used the Docker-OSX project [1]. It should pretty much just work, the readme has a section about on running it on WSL. If you don't want to use Docker it should still be possible with the OSX-KVM, I've done it before, but I can't remember the exact steps I took to get it running, sorry. Should also note that I've run into issues with AMD CPUs, Intel seems to work better, but I also haven't tried it since they first added nested virtualization support with AMD CPUs to Hyper-V, so those problems might be fixed now. [1] https://github.com/sickcodes/Docker-OSX https://github.com/sickcodes/Docker-OSX
- skrowl 5y agoThank you! I'll give it a go right now.
- pdenton 5y agoQuickemu already does this and many more operating systems too. https://github.com/quickemu-project/quickemu https://github.com/quickemu-project/quickemu
- j16sdiz 5y agoQuickemu is built on Kholia's work
- password4321 5y agoDiscussed https://news.ycombinator.com/item?id=28797129 https://news.ycombinator.com/item?id=28797129
- lathiat 5y agoSee also quickemu which has support for launching macOS using information largely taken from this and similar repositories as well as Windows with TPM and enables all the good features: https://github.com/quickemu-project/quickemu https://github.com/quickemu-project/quickemu There is also another promising project called docker-osx which has the best documentation around doing the serial number generation to make iMessage etc work (you can use it in combo with most other methods but the docs are often confusing when I looked about a year ago): https://github.com/sickcodes/Docker-OSX https://github.com/sickcodes/Docker-OSX
- jjcon 5y agoI’m hoping to run macOS with QEMU/KVM with a project like this or another - does anyone know though if it is possible to pass through an intel integrated gpu (in a CPU only machine) to use for hardware acceleration?
- R0b0t1 5y agoYes, starting with CPUs circa 2014. You need CONFIG_DRM_I915_GVT from Device Drivers -> Graphics support -> Intel 8xx/9xx/G3x/G4x/HD Graphics -> Enable Intel GVT-g graphics virtualization host support. There are a fixed number of partitions and a specific setup you need to do with /sys nodes, refer to the manual. Considering this and that support only became possible some time after 2014 it's worth realizing it does not work like normal VFIO passthrough. Why? No idea, seems like an oversight. Need to stop providing lying interfaces to users. https://serverfault.com/questions/1048811/vfio-igpu-passthrough-on-intel-4770-to-a-qemu-virtual-machine-proxmox https://serverfault.com/questions/1048811/vfio-igpu-passthro...
- ohthehugemanate 5y agoNot really pass through, no. If CONFIG_DRM_I915_GVT is enabled in your kernel, you can use Intel's graphics virtualization system... basically a virtio style virtual device that shares the GPU between VM and host. IMO this is way more convenient than real passthrough, where the device is only available either to the VM or the host. The downside is that you don't get full performance in the VM. "Intel GVT-g is a full GPU virtualization solution with mediated pass-through (VFIO mediated device framework based), starting from 5th generation Intel Core(TM) processors with Intel Graphics processors. GVT-g supports both Xen and KVM (a.k.a XenGT & a.k.a KVMGT). A virtual GPU instance is maintained for each VM, with part of performance critical resources directly assigned. The capability of running native graphics driver inside a VM, without hypervisor intervention in performance critical paths, achieves a good balance among performance, feature, and sharing capability." https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide
- broknbottle 5y agoGvt-g is pretty much dead. New hardware e.g. Tiger Lake with Xe isn’t supported and it’s my understanding that Intel has no plans to support. See the following link for supported devices. https://github.com/torvalds/linux/blob/bbf5c979011a099af5dc76498918ed7df445635b/drivers/gpu/drm/i915/intel_gvt.c#L43-L59 https://github.com/torvalds/linux/blob/bbf5c979011a099af5dc7...
- nly 5y agoWill this project survive the ARM transition? E.g. will we be able to run macOS for ARM on x86 when Apple pull the plug on macOS x86?
- jeswin 5y agoIt's an insane amount of work, but people do try - https://twitter.com/JonathanAfek/status/1350000894784495617 https://twitter.com/JonathanAfek/status/1350000894784495617 I think we'll eventually get there. Simply because the M1 macs will upsize the pool of people working on it.
- lloeki 5y agoThe ARM CPU would still have to be emulated on x86_64, which would be ungodly slow.
- nly 5y agoThere's no reason to believe this has to be slower than x86 on ARM
- lloeki 5y agoWell, emulating† x86 on ARM is excruciatingly slow, just as emulating ARM on x86 is (turns out I do both, routinely, so no need to believe when I have data: it's about an order of magnitude slower than native) † Rosetta 2 is not emulation.
- saagarjha 5y agoRosetta 2 is an emulator. It has a JIT compiler inside of it!
- smoldesu 5y agoEmulating x86 is slow on ARM because it's inherently a less complex instruction set. Emulating things the other way around is dead-simple by comparison, it's what made it such a cakewalk to write Nintendo Switch emulators on x86. ARM has to swing up the abstraction chain to implement x86 instructions, whereas x86 can execute ARM instructions for cheap, free, or even faster than ARM natively in the case of SIMD calls. Plus, that's ignoring how people will actually try to get MacOS running on these machines. Once x86 is finally considered "dead" and removed from the MacOS ecosystem, the solution is going to be kernel patching. It's hard to speculate on how difficult this might be, but I'd imagine that a small team could port binary patches from BSD to Nu-Mac fairly quickly. It's not a particularly complicated process, just a mite arduous.
- ghishadow 5y agois there any way to run macOS on Hyper V ?
- skrowl 5y agoNot that I've seen, but you can run it on VMware and VirtualBox on Windows. Check YouTube, there are tons of videos of how to do it.
- lukeh 5y agoI’d be careful about offering commercial support for this.
- mijoharas 5y agoI think I was thinking along the same lines as you. There is a section in the linked github titled "is this legal"[0] [0] https://github.com/kholia/OSX-KVM#is-this-legal https://github.com/kholia/OSX-KVM#is-this-legal
- sys_64738 5y agoThat appears to be in reference to the act of running macOS on non-Apple hardware. The reference to paid commercial support is what will have the Apple lawyers knocking.
- R0b0t1 5y agoIf the software is sold then he's in the clear. If it is actually leased then Apple needs to make that obvious and start charging recurring fees like a normal lease agreement.
- aasasd 5y agoThis looks new-ish, but I remember seeing something about OSX on KVM years ago. The author's name seems familiar for some reason, however. Found it, the same repo linked in August 2018: https://news.ycombinator.com/item?id=17763855 https://news.ycombinator.com/item?id=17763855 And September 2016: https://news.ycombinator.com/item?id=12556609 https://news.ycombinator.com/item?id=12556609 Apparently the version control model of the repo is ‘scrap everything once in a while’.
- niklasrde 5y ago"Removed history to reduce repository size"
- kevindurb 5y agoDoesnt the quickemu project do some of this automagically? https://github.com/quickemu-project/quickemu https://github.com/quickemu-project/quickemu
- NovemberWhiskey 5y agoWhat's the argument that this is OK from an ethical or moral perspective? Or does everyone acknowledge it's a willful violation of Apple's intellectual property and doesn't actually care?
- throw111444 5y agoI'm perfectly fine with running Hackintoshes for more than a decade now and I see it as being morally superior to buying the stuff from Apple, or Microsoft, or Google, you name it. I believe that the world could be a better place if the hardware and software were more fragmented and less integrated. This would lead to simpler, less opaque solutions that could be controlled by the users and developers and not by 10 international corporations. I wish all of them were destroyed by some EM storm and the tech would return to using older technologies which wouldn't allow the systems to become too complex (due to the hardware decoming very slow). Having less of convenience is not an issue when the alternative is having no control. Having to teach the population to use the plain email, FTP and the text editor is better than being herded by "I know what is better for you"-type elitist groups. I know from the experience that if the information crud is removed, most organisatons could run on the C program with an sqlite db (or even a text file) and be perfectly fine. So I'm happily stealing from both Apple and Microsoft, and I wish I could encourage more people to do likewise. "Why wouldn't you use Linux then?" - because I'm forced to use all that garbage by a workplace or the orgs I'm interacting with. I would personally use none of that. My background is 30 years of programming.
- encryptluks2 5y ago[flagged]
- smoldesu 5y agoI never read the EULA when I put MacOS on my Thinkpad, so I'd file it under "willful ignorance" if I were you.
- NovemberWhiskey 5y agoThanks for answering! I am not really asking about the legality, per se, which is where the EULA comes into this. I don't want to put any words into your mouth, so let me just imagine a couple of "inner monologues" about the ethical/moral aspect of that, just so you have an idea of what I'm trying to ask. "I know Apple doesn't want me to use it this way, and I know I shouldn't, but I'm going to do it anyway even though it's wrong" "I know Apple doesn't want me to use it this way, but they shouldn't have a say in it, so it's not really wrong" Would be interested to know how you're thinking about your decision to run MacOS on your Thinkpad from that perspective.
- robk 5y agoThis also works surprisingly well in a docker image in Ubuntu. I use it as a relay to imessage for my windows pc to use with bluebubbles.
- kjfarm 5y agocan you share more information about getting iMessage to work? I thought you needed a hardware id or serial number to make it work
- hendersoon 5y agoHow do you run a VM inside a docker image?