文档/故障排查6 分钟

macOS 和 Windows 错误

launchd、Gatekeeper、托盘、sc.exe 和 Windows 服务错误及最简单的修复方法。

完成后你将得到

wantasticd 服务开机自动运行,且 wantasticd status 显示 Connected。

开始之前

  • macOS 上使用 sudo,Windows 上以管理员身份运行 PowerShell。

开始之前

  • macOS:使用快速安装进行安装和认领。日志位于 /Library/Logs/Wantastic/wantasticd.log。
  • Windows:使用令牌安装。Windows 上不显示认领二维码。
  • Windows 没有日志文件。在前台运行一次服务以查看错误。
Terminalbash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo launchctl kickstart -k system/com.wantastic.wantasticd

检查要点

Terminalbash
wantasticd status
tail -n 50 /Library/Logs/Wantastic/wantasticd.log
sudo launchctl kickstart -k system/com.wantastic.wantasticd
失败:普通 PowerShell 窗口
PS C:\Users\you> irm https://get.wantastic.app/install.ps1 | iex
Administrator privileges are required.1
Right-click PowerShell, choose 'Run as administrator', and run again:
  1. 1未以管理员身份打开
该窗口没有管理员权限,因此安装程序停止。
已修复:Administrator: Windows PowerShell
PS C:\Windows\system32> irm https://get.wantastic.app/install.ps1 | iex
wantasticd v1.0.54+377f3c0 is installed and running as a Windows Service.1
  1. 1成功
在通过 Run as administrator 打开的窗口中运行同一行,然后在浏览器中批准。

速查表

错误最简单的修复方法
Error: on macOS the installer needs root.在 sh 前加上 sudo。
Interface name must be utun[0-9]*取消设置 WANTASTIC_TUN_NAME。
Killed by Gatekeeper / "cannot be opened"移除隔离标记并签名。
托盘显示 "Status: Daemon not running"重启服务。
Failed to <action> (sc.exe exit code N).关闭 services.msc 或重启。
The service is installed but not started because this device is not logged in yet.wantasticd login --no-connect, then Start-Service wantasticd.
Administrator privileges are required.通过 Run as administrator(以管理员身份运行)打开 PowerShell。
Error creating interface: … (Wintun)以管理员身份运行;在杀毒软件中放行。

验证结果

wantasticd status 显示 Connected。
设备在 Devices 中显示为 Online。

错误与解决方法

macOS 安装立即停止。Error: on macOS the installer needs root.install.sh (macOS)
原因

安装程序没有使用 sudo 运行。

解决方法

在 sh 前加上 sudo 运行快速安装,然后认领设备。

  1. 1运行该命令。
  2. 2打开 Claim URL,登录并点击 Claim Device。
  3. 3出现 "Device claimed" 后,按 Ctrl+C。
  4. 4运行:sudo launchctl kickstart -k system/com.wantastic.wantasticd
Terminalbash
curl -fsSL https://get.wantastic.app/install.sh | sudo sh; sudo wantasticd genkey
验证: wantasticd status 显示 Connected。
macOS:已认领,但设备仍为 Offline。wantasticd genkey (macOS)
原因

genkey 未使用 sudo 运行,因此配置保存在 ~/Library/Application Support/Wantastic,而服务不会读取该位置。

解决方法

使用 sudo 重新运行 genkey,重新认领,然后重启服务。

Terminalbash
sudo wantasticd genkey
# after "Device claimed": press Ctrl+C, then:
sudo launchctl kickstart -k system/com.wantastic.wantasticd
验证: wantasticd status 显示 Connected。
macOS 拒绝自定义 TUN 名称。Interface name must be utun[0-9]*wantasticd 日志(macOS)
原因

WANTASTIC_TUN_NAME 设置的名称不是以 utun 开头。

解决方法

删除该设置。macOS 会自动选择 utun 名称。

Terminalbash
unset WANTASTIC_TUN_NAME
sudo launchctl kickstart -k system/com.wantastic.wantasticd
验证: wantasticd status 显示 Mode TUN (utunN)。
macOS 终止了二进制文件,或提示无法打开。macOS Gatekeeper
原因

手动复制后,文件带有隔离标记或签名无效。

解决方法

移除隔离标记并为二进制文件签名。

Terminalbash
sudo xattr -d com.apple.quarantine /usr/local/bin/wantasticd
sudo codesign -f -s - /usr/local/bin/wantasticd
sudo launchctl kickstart -k system/com.wantastic.wantasticd
验证: wantasticd version 可以运行。
设备已列出,但从 Mac 上无法访问。macOS
原因

隧道已断开,或路由没有经过 utun。

解决方法

重启服务,然后检查路由。

Terminalbash
sudo launchctl kickstart -k system/com.wantastic.wantasticd
wantasticd status
route -n get <peer-ip>
验证: route -n get 显示 interface: utunN。
托盘提示守护进程未运行。Status: Daemon not runningmacOS 菜单栏应用
原因

服务已停止或崩溃。

解决方法

重启服务并检查日志。

Terminalbash
sudo launchctl kickstart -k system/com.wantastic.wantasticd
tail -n 50 /Library/Logs/Wantastic/wantasticd.log
验证: 托盘显示 Connected。
macOS 防火墙阻止了 P2P。[P2P] Could not add … to the application firewallwantasticd 日志(macOS)
原因

macOS 防火墙拒绝了该规则。"Could not allow …" 情况类似。

解决方法

在 System Settings → Network → Firewall → Options 中,允许 wantasticd 的传入连接。

验证: wantasticd peers 显示直连路径。
Wi-Fi 名称显示为已隐藏。控制台 / 设备信息(macOS)
原因

wantasticd 的定位服务已关闭。

解决方法

在 System Settings → Privacy & Security 中为 wantasticd 开启定位服务。

验证: Wi-Fi 名称可见。
旧的日志位置。macOS
原因

1.0.50 之前的版本,日志位于 /var/log/wantasticd.log。

解决方法

当前版本请使用 /Library/Logs/Wantastic/wantasticd.log。

验证: 日志文件中有最近的记录。
安装过程中 sc.exe 步骤失败。Failed to <action> (sc.exe exit code N).install.ps1
原因

通常为退出码 1072:服务管理器(services.msc)或其他工具占用了该服务。

解决方法

关闭服务管理器、任务管理器和事件查看器,或重启。然后重新运行 install.ps1。

PowerShell(管理员)powershell
irm https://get.wantastic.app/install.ps1 | iex
验证: 安装程序完成。
安装后 Windows 服务未运行。The wantasticd service did not reach the Running state.install.ps1
原因

登录失败,因此配置只是占位内容。

解决方法

使用新令牌登录,然后重启服务。

PowerShell(管理员)powershell
& "C:\Program Files\Wantastic\wantasticd.exe" login --no-connect --token <TOKEN>
Restart-Service wantasticd
验证: sc.exe query wantasticd 显示 RUNNING。
服务未在开机时启动。The wantasticd service was not configured for automatic startup.install.ps1
原因

设置失败,或被策略修改。

解决方法

手动设置为自动启动。

PowerShell(管理员)powershell
sc.exe config wantasticd start= auto
验证: sc.exe qc wantasticd 显示 AUTO_START。
安装后服务不存在。The wantasticd service was not found after installation.install.ps1
原因

PowerShell 未以管理员身份运行,或被策略阻止。

解决方法

以管理员身份在 PowerShell 中重新运行 install.ps1。

PowerShell(管理员)powershell
irm https://get.wantastic.app/install.ps1 | iex
验证: sc.exe query wantasticd 正常工作。
Windows 安装期间登录失败。Login did not complete (exit N).install.ps1
原因

浏览器中的批准未及时完成或被拒绝,或令牌被拒绝。

解决方法

重新登录并批准设备,然后启动服务。

PowerShell(管理员)powershell
wantasticd login --no-connect
Start-Service wantasticd
验证: wantasticd status 显示 Connected。
安装程序立即停止。Administrator privileges are required.install.ps1
原因

PowerShell 未以管理员身份打开。

解决方法

点击开始,输入 powershell,点击 Run as administrator,再点击 Yes,然后重新粘贴这一行。

PowerShell(管理员)powershell
irm https://get.wantastic.app/install.ps1 | iex
验证: 安装程序完成。
Windows 服务管理器错误。windows service failed: …事件查看器 / 前台运行
原因

服务包装程序失败。"failed to determine if interactive session" 与此相关。

解决方法

使用 -v 在前台运行以查看真正的错误,然后以管理员身份重新安装。

验证: 服务正在运行。
无法创建 Wintun 适配器。Error creating interface: …wantasticd (Windows)
原因

PowerShell 未提升权限,或杀毒软件阻止了 Wintun 驱动。

解决方法

以管理员身份运行,并在安全软件中放行 C:\Program Files\Wantastic。

验证: wantasticd status 显示 Mode TUN (wantastic0)。
Windows 上看不到二维码或登录提示。install.ps1 · wantasticd login (Windows)
原因

Windows 上较旧的 wantasticd 版本无法向 PowerShell 输出内容。

解决方法

按 Ctrl+C,在 Account → Secrets 中创建令牌,然后用它安装。

PowerShell(管理员)powershell
& ([scriptblock]::Create((irm https://get.wantastic.app/install.ps1))) -Token <TOKEN>
验证: 安装程序提示服务正在运行。
在 Windows 上卸载。Windows
原因

没有卸载脚本。

解决方法

停止并删除服务,然后删除相关文件夹。

PowerShell(管理员)powershell
sc.exe stop wantasticd; sc.exe delete wantasticd
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Run -Name Wantastic -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\Program Files\Wantastic","C:\ProgramData\Wantastic"
验证: sc.exe query wantasticd 提示该服务不存在。

继续阅读

仍然无法解决?

请通过邮件发送设备名称、平台和完整的错误文本。切勿发送令牌、密钥或密码。

hello@wantastic.app