工具与资源github.com
在 Docker 的 QEMU 中运行 macOS
macOS in QEMU in Docker
2020 — 2024,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Docker-OSX 是一个开源项目,通过在 Docker 容器内运行 QEMU 来虚拟化完整的 macOS 系统,让用户在 Linux 等平台上运行 macOS,甚至可以跑 Xcode 来构建 iOS 应用。它基于 kholia 的 OSX-KVM 项目,几条命令即可启动一个 macOS 虚拟机。
为什么经久不衰:它解决了『没有 Mac 也要跑 macOS/Xcode』这一长期痛点,部署方式简单,因此多年来反复受到关注。
HN 评论精选
标题有误导:这是容器内跑 QEMU 全系统模拟,依赖特权模式和 KVM,并非真正的『Docker 里跑 macOS』
这个标题挺有误导性。它其实是在 Docker 里运行一个完整的系统模拟器 QEMU,而且容器使用了 --privileged 的 root 权限,隔离性非常弱。它还依赖硬件辅助虚拟化 KVM,而大多数 Docker 环境下 KVM 并不可用。可以把 Docker 平台理解为 Linux 平台的一个子集,很多常用特性默认被移除了。所以别以为这是『在任何能跑 Docker 的地方跑 macOS』。更接近『Docker 里跑 macOS』的其实是 Darling(类似 Wine 的兼容层)。另外我好奇能否让 macOS 在 QEMU 中不依赖硬件虚拟化启动,那样就能在完全隔离的容器里运行了,不过性能大概会惨不忍睹。
etaioinshrdlu查看英文原文
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... SYS_PTRACE, cgroups come to mind as not allowed within the container. (This "Docker as a subset of Linux" is also what you end up getting from most "Docker as a service" platforms offered by clouds, including kubernetes. I'm referring to AWS Fargate, Google Cloud Run, GKE, AKS, here.) So don't think of this as macOS in docker wherever docker runs. What would be a lot more analogous to macOS in docker would be running Darling in docker: https://www.darlinghq.org/ ... if that could be made to work for the entire system (highly unlikely) Darling is more like Wine in that it runs native executables for one platform as native processes on another platform using a compatibility layer. Wine, by the way, definitely works quite well inside Docker. Also, one final thought. I wonder if you could get macOS to boot in QEMU without hardware assisted virtualization. Then you could probably run this in a fully isolated container again. The performance would likely be abysmal though!
开发者真正的痛点:iOS 构建离不开 macOS,希望有云端方案替代 Mac 硬件
我只想要一个好用的 macOS CI/CD 系统来构建 iOS 应用,不用买一堆 Mac Mini,甚至不用买 Mac,这个要求过分吗?
cercatrova查看英文原文
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?
指出项目的技术来源:基于 kholia 的 OSX-KVM
更多项目信息见几小时前的这个 Reddit 帖子。开发者提到,和 macOS-Simple-KVM 一样,这个项目利用了 kholia 的 OSX-KVM。
miles查看英文原文
More info on the project in this reddit thread from a few hours back: https://www.reddit.com/r/jailbreak/comments/gwg3e4/free_release_dockerosx_run_xcode_on_linux_sign/ The developer mentions[0] that, like macOS-Simple-KVM[1], this leverages kholia's OSX-KVM[2]. [0] https://www.reddit.com/r/jailbreak/comments/gwg3e4/free_release_dockerosx_run_xcode_on_linux_sign/fsuz29i/ [1] https://github.com/foxlet/macOS-Simple-KVM [2] https://github.com/kholia/OSX-KVM
质疑用 Docker 的必要性:直接用 VM 镜像效果相同且更省事
既然 QEMU 是在 Docker 里运行的,很难看出 Docker 在这里加了什么。用一个裸的虚拟机镜像几乎能得到完全相同的功能,还不用应付 Docker 的各种麻烦。
sjburt查看英文原文
It's hard to see what Docker is adding here since qemu is being run inside Docker. You could get almost identical functionality out of a bare VM image and not deal with the hassles of docker.
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com