Encore 公司开发了 crackling,一个跨平台微虚拟机系统,旨在解决工程师无法在 Mac 上本地运行基于 Firecracker 的 Linux 构建环境的问题1。Firecracker 原本需要 Linux 主机和 /dev/kvm 支持,macOS 不兼容此需求,导致 Encore 的工程师被迫依赖远程连接共享构建主机1。
crackling 采用跨平台架构,在 Linux 上由 Firecracker 驱动,在 macOS 上则以 Apple 的 Virtualization.framework 作为后端,为两个平台提供统一的 OCI 镜像启动和管理接口1。为支持 macOS,团队需要重建整个 Linux 镜像工具链,包括 EFI zboot 内核解包、OCI 层应用和 initramfs 生成等功能1。系统通过 AF_VSOCK 进行客户端-主机通信,agent 支持 exec、交互式 shell、cp 和端口转发等操作1。
Apple 的虚拟化框架的快照保存功能需要 com.apple.private.virtualization 权限,但 Apple 不向第三方应用授予此权限,导致保存功能无法正常工作1。尽管存在此限制,crackling 使工程师能够在本地 Mac 上运行完整的构建系统,消除了之前需要远程连接的限制1。
Encore has developed crackling, a cross-platform microVM system that enables engineers to run Linux-based build environments natively on Mac computers1. The solution addresses a fundamental limitation: Firecracker, the lightweight virtualization technology underlying these systems, requires a Linux host with /dev/kvm support, making it inaccessible on macOS and forcing Encore's engineers to rely on remote connections to shared build machines1.
Crackling functions as a unified daemon and command-line interface that abstracts platform differences by leveraging Firecracker on Linux and Apple's Virtualization.framework on macOS1. To enable this compatibility, Encore rebuilt the entire Linux image toolchain for macOS, including EFI zboot kernel unpacking, OCI layer application, and initramfs generation1. The system uses AF_VSOCK for client-host communication and supports exec operations, interactive shells, file copying, and port forwarding through an agent1.
However, the implementation encountered constraints from Apple's platform restrictions. The snapshot-saving functionality provided by Apple's virtualization framework requires the com.apple.private.virtualization permission, which Apple does not grant to third-party applications, resulting in save failures1. Despite this limitation, crackling streamlines local development workflows by eliminating the need for remote access to centralized build infrastructure1.
评论
还没有评论,欢迎留下第一条。