Clone
1
Home
Mr.Lee edited this page 2026-11-27 07:59:24 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

VirtualBuddy 镜像同步记录与项目分析

维护说明:本页由 gitea-mirror-wiki 技能生成(2026-11-27 07:59),记录该仓库在 GPD Gitea 的镜像状态与代码速览。Wiki 属于本地维护内容,不来自上游,也不受 8 小时同步影响。

一、仓库概况

项目 值
上游 https://github.com/insidegui/VirtualBuddy.git
本地镜像 http://192.168.1.99:3000/jarod/VirtualBuddy
公网入口 https://git.lxj.ai/jarod/VirtualBuddy
状态 活跃镜像(8 小时自动同步)
默认分支 main
仓库大小 约 83.0 MB(DB 87020169 字节;裸仓约 85065 KB)
refs 195 分支 / 44 标签 / HEAD 历史 1171 提交
建立时间 2026-11-27 07:51:07
描述 Virtualize macOS 12 and later on Apple Silicon — VirtualBuddy is a virtual machine GUI for macOS M1/M2/M3/M4 (Swift, BSD-2-Clause)

二、同步过程与当前状态

本次同步实测

项目 结果
上游仓库 https://github.com/insidegui/VirtualBuddy (insidegui/VirtualBuddy,Swift,BSD-2-Clause,9028 star)
迁移请求 POST /api/v1/repos/migrate;mirror=true、mirror_interval=8h0m0s、private=false、repo_owner=jarod
迁移结果 HTTP 201,耗时 58.4 s,repo id 43,empty=false(一步式完成,上游约 82 MB)
默认分支 main;裸仓 HEAD = 529712cdfd9921376f47ad186b66dcc6a6dcc334,与 GitHub 上游 HEAD 一致
refs 规模 195 分支 / 44 标签 / 全 refs 1577 提交(main 历史 1171);裸仓约 84 MB,git fsck 无异常
origin 配置 https://github.com/insidegui/VirtualBuddy.git;fetch = +refs/:refs/ 与 +refs/tags/:refs/tags/
代理链路 mihomo 127.0.0.1:7890 → gitea-proxy-bridge 0.0.0.0:17890 → 容器 HTTP_PROXY/HTTPS_PROXY 环境变量(gitconfig 对 Gitea 无效)
同步超时配置 app.ini [git.timeout] MIRROR=3600 / MIGRATE=14400
镜像同步验证 POST /repos/jarod/VirtualBuddy/mirror-sync → HTTP 200 / 0.12 s;排期 2026-11-27 07:52:52 → 15:52:52(+8h),enable_prune=1
页面与 API 校验 GET /jarod/VirtualBuddy → 200;GET /api/v1/repos/jarod/VirtualBuddy → 200(empty=false、mirror=true、size=84899 KB、status=0)
仓库计数 jarod 下第 28 个仓库(27 个历史 + 本仓库),第 26 个活跃镜像
注意事项 仓库名含大写,但 Gitea 裸仓目录一律小写(virtualbuddy.git / virtualbuddy.wiki.git);技能脚本已做大小写归一化

当前校验状态

检查项 结果
is_mirror / is_empty 1 / 0
HEAD refs/heads/main → 529712c
remote.origin.url https://github.com/insidegui/VirtualBuddy.git
remote.origin.fetch +refs/*:refs/* / +refs/tags/*:refs/tags/*
自动同步排期 updated 2026-11-27 07:52:52 → next 2026-11-27 15:52:52

页面验证:GET /jarod/VirtualBuddy/wiki 返回 200 即表示 Wiki 裸仓已被 Gitea 正确识别。

三、项目功能速览

README 来源:README.md

# VirtualBuddy
VirtualBuddy runs macOS and Linux virtual machines on Macs with Apple silicon. Use it to test your apps on multiple versions of macOS, including betas.
## System Requirements
- **VirtualBuddy requires a Mac with Apple silicon running macOS 14 Sonoma or later.**
- Guest systems include macOS 12 Monterey or later and ARM64 Linux distributions such as Ubuntu Desktop and Ubuntu Server. The installation wizard shows which catalog images and features your Mac supports.
## Download
Download the [latest stable release](https://github.com/insidegui/VirtualBuddy/releases/latest) or browse [all releases, including betas](https://github.com/insidegui/VirtualBuddy/releases).
If you use Homebrew, run `brew install --cask virtualbuddy`.
VirtualBuddy is free and open-source. If you’d like to support its development, [you may purchase it on Gumroad](https://insidegui.gumroad.com/l/virtualbuddy) or [sponsor my work on GitHub](https://github.com/sponsors/insidegui).
## Installing macOS or Linux
Click **+** in the VirtualBuddy library and choose macOS or Linux. Select a version from the catalog to download its installer, enter a custom download URL, or open a file you already have. Use an IPSW restore image for macOS or an ARM64 ISO for Linux.
Some macOS restore images require newer device support on the host. Select the version in the catalog to see its requirements and installation instructions. Apple provides device support with compatible versions of Xcode and sometimes as a separate [Apple Developer download](https://developer.apple.
**Installing macOS 27 Golden Gate from an IPSW** requires a host running macOS 26 or later with compatible device support. To upgrade an existing macOS VM, open **System Settings → General → Software Update** inside the guest. For beta releases, see [how to enable beta updates in a VM](https://githu
## Features

检出的技术栈 / 构建信号:Swift Package Manager、SPM 依赖锁文件、macOS / iOS App Bundle

顶层目录:.github、(根目录)、DeepLinkSecurity、Documentation、Packages、ReleaseNotes、Scripts、VirtualBuddy.xcodeproj、VirtualBuddy、VirtualBuddyGuest、VirtualBuddyGuestHelper、VirtualBuddyTests、VirtualCore、VirtualCoreTests、VirtualInstallation、VirtualInstallationService、VirtualUI、VirtualWormhole、VirtualWormholeTests、assets

四、代码功能与安全简析(人工复核)

功能定位

VirtualBuddy(insidegui,BSD-2-Clause,约 9.0k star)是在 Apple Silicon Mac 上跑 macOS 12+ / ARM64 Linux 虚拟机的图形化前端,基于 Apple 官方 Virtualization.framework。宿主要求 macOS 14 Sonoma 或更新,源码构建需 Xcode 27 + macOS 27 SDK。主要用途是让开发者在一台 Mac 上多版本 macOS(含 beta)测试 App。

核心能力:从官方 catalog 下载 IPSW 恢复镜像或自定义 ARM64 ISO 安装系统;配置 CPU / 内存 / 磁盘 / 显示 / 网络;进入 Recovery 改启动安全策略;vbctl 命令行与脚本控制;Service Tunnels(宿主机 loopback TCP 端口与 Unix socket 转发进 guest);共享文件夹(virtiofs,macOS 13+)与剪贴板共享(macOS 14+);保存/恢复/复制 VM 状态;macOS 27+ 下 USB 透传与自动创建首个账户跳过 Setup Assistant;从 Xcode 直接在 VM 内调试 Mac App。

技术栈与工程结构

纯 Swift / SwiftUI,SPM 多模块:VirtualCore(虚拟化核心与恢复镜像)、VirtualUI、VirtualWormhole(宿主 ↔ guest 通信)、VirtualBuddyGuest / GuestHelper(guest 内助手)、VirtualInstallation / VirtualInstallationService(安装向导)、DeepLinkSecurity(深链鉴权独立框架)、vbctl / vctool(CLI)、Packages/*(AppStoreConnectDevices / MacDebug* 等 4 个本地 SPM 包)。构建入口 VirtualBuddy.xcodeproj,依赖锁 xcshareddata/swiftpm/Package.resolved(9 个依赖,含版本与校验和)。CI 走 Xcode Cloud(ci_scripts/ci_pre_xcodebuild.sh),仓库内没有 .github/workflows。

安全快检结论(人工复核)

  • 无凭据泄露:未检出 .env / *.pem / *.p12 / 私钥 / credentials.json 等敏感文件入库;未检出硬编码 PEM 私钥;password|secret|token|api_key|private_key|access_key 全树命中 329 处,抽样均为变量名、日志文案、Keychain API 常量(如 kSecClassGenericPassword)与 Apple Event auditToken 字段名,无「键=固定值」型硬编码赋值。未检出 curl|bash、eval、base64 -d、chmod 777、sudo 等危险脚本模式。
  • 一处需如实标注的硬编码共享 key:VirtualCore/Source/Restore Images/VBAPIClient.swift(production / DEBUG 两套 Environment)与 VirtualBuddy/CommandLine/vctool/MigrateCommand.swift 中,写死了同一个 apiKey=15A25D48-4A34-4EE4-A293-C22B0DE1B54E,用于请求作者自建的恢复镜像目录 API https://api.virtualbuddy.app/v2;DEBUG 环境还指向 virtualbuddy.ngrok.io 与 localhost:8787。这是客户端侧的公开目录服务 key(随 App 分发,用于只读拉取 IPSW 元数据),不是云账号密钥、私钥或用户数据,但属于「硬编码共享密钥」:任何人都可复用/滥用,作者一旦轮换或吊销,旧版本目录功能即失效。自托管/二次开发必须替换。
  • 签名标识是公开信息而非秘密:VirtualBuddy/Config/Security.xcconfig 中 VB_DEVELOPMENT_TEAM = 8C7439RJLG 是作者的 Apple Team ID,用于代码签名要求(code requirement)校验 guest 组件合法性;Signing.xcconfig 的 VB_BUNDLE_ID_PREFIX 为空、按要求自行填写。自建构建需替换为自己的 Team ID 与 bundle id 前缀,否则签名校验会不匹配。
  • 正向安全设计:DeepLinkSecurity/ 是专门的深链安全框架,用 Apple Event 的 sender audit token 识别调用方、CryptoKit 做签名校验、授权决策存 Keychain(签名项,KeychainDeepLinkAuthStore),并有 DeepLinkSentinel 统一拦截 —— 说明对「恶意 URL scheme 调用」有显式防护。entitlements 只申请 com.apple.security.virtualization、device.audio-input、accessory-access.usb 三项虚拟机必要权限,未见 disable-library-validation / 沙盒逃逸类放宽。
  • 许可证 BSD-2-Clause,二次分发需保留版权与免责声明,无 GPL 类传染风险。

风险提示

  1. 平台强绑定:仅 Apple Silicon Mac + macOS 14+ 可用,x86 / Windows / Linux 全部无法运行;本镜像仅作代码归档与阅读参考,不具备跨机床到即用性。
  2. VM 是高权限软件:Service Tunnels 会把宿主机 loopback 端口 / Unix socket 转发进 guest,共享文件夹与剪贴板打通宿主与 VM,guest 内 VirtualBuddyGuest 助手以登录项形式运行。只安装官方签名发行版(或完全自审源码构建),不要用来路不明的 IPSW / ISO / 预编译 guest DMG(仓库 data/LegacyGuestApp/ 内含 3 个预编译 .dmg)。
  3. 自建构建需替换三处标识:目录 API 的 apiKey、VB_DEVELOPMENT_TEAM、VB_BUNDLE_ID_PREFIX;否则目录拉取或签名校验会失败。目录服务依赖作者域名,存在可用性/供应链单点。
  4. Beta / 新版本特性涉及 USB 透传与自动建账户,建议在非工作主机、隔离网络里验证,别直接对生产开发机开。

结论

上游活跃(2026-11-26 仍有提交)、模块划分清晰、有独立深链安全框架与依赖锁文件、无私有凭据入库,工程规范度高,值得在 Apple Silicon Mac 上使用官方发行版;本仓库作为只读镜像归档风险很低。唯一需要记住的是那枚公开的目录 API key 属于硬编码共享密钥,二次开发时应改为配置项。

五、代码安全快检(自动)

  • password|secret|token|api_key|private_key|access_key 命中 329 处;此类命中多为变量名、UI 文案或协议字段,需人工复核,不等于存在凭据泄露。
  • 敏感文件(.env / *.pem / *.p12 / 私钥 / credentials 等):未检出
  • 硬编码 PEM 私钥:未检出
  • 危险脚本模式(curl|bash / eval / base64 -d / chmod 777):未检出

六、风险提示

  1. 自动快检只覆盖常见模式,不替代人工审计;部署前核对依赖来源、锁文件与 CI 中的 ${{ secrets.* }} 用法。
  2. 远程控制 / Agent / 文件上传 / 解析外部文档类项目,优先放在内网隔离环境,避免直接暴露公网。
  3. 注意许可证(GPL / AGPL 等)对二次分发与闭源集成的约束。

七、维护约定

  • Gitea 对 is_mirror=1 的仓库禁止 Wiki API / UI 写入(POST .../wiki/pages 返回 405),但读正常;本页由服务端直接维护 <repo>.wiki.git 裸仓。
  • 更新方式:临时 chown -R root:root,用 hash-object -w + mktree + commit-tree + update-ref 提交,最后 chown -R 1000:1000;root 直接 git clone 会触发 dubious ownership。
  • Wiki 是独立裸仓,8 小时 mirror-sync --prune 只操作主裸仓,不会影响本页;删除并重建仓库会连带删除 Wiki,Gitea 迁移/备份时须单独带上 .wiki.git。
  • 每次人工发起的镜像同步完成后,按 gitea-mirror-wiki 技能更新本页;后台自动同步不重复生成。