在 ChromeOS Crostini 上折腾 ClashTui
crostini没有3D加速,为了使用代理,就要使用tui
整个过程中真正要处理的其实就两件事:
- MMDB/GeoIP 数据源:替换
geox-url为可用镜像,否则GEOIP规则会让配置直接加载失败; - TUN 不可用的心理预期:Crostini 容器拿不到
CAP_NET_ADMIN,老实用 HTTP/SOCKS。
环境背景
$ uname -m
aarch64
$ cat /etc/os-release | head -3
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
$ hostname
penguin
$ ls /mnt/chromeos
fonts sharedpenguin + /mnt/chromeos 是典型的 Crostini 环境——ChromeOS 内置的 Linux 容器。
一、装 ClashTui
ClashTui 是一个终端 UI(TUI)代理管理工具,同时支持 Mihomo(Clash.Meta) 和 sing-box 两个核心,能在终端里切节点、更新订阅、看连接、管服务。比 GUI 省资源,比纯 CLI 直观。
一键安装脚本
官方提供了安装脚本,会自动下载 ClashTui 本体 + Mihomo + sing-box + systemd 服务文件:
bash <(curl -fsSL https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/installs/install) --core all脚本默认以 system 模式安装到 /opt/clashtui,并会把当前用户加入 mihomo、sing-box 两个组(用于读写配置文件)。安装结束时会提示:
To apply group file permissions, either log out and back in (RECOMMENDED) or run 'newgrp' (TEMPORARY).⚠️ 这个提示很重要,不重登可能会出现权限读取问题。
小插曲:默认配置下载失败
我的安装脚本末尾报了两个 curl 写入错误,导致核心默认配置文件没下载成功:
[ERROR] Failed to download: .../mihomo/core_override_config.yaml
[ERROR] Failed to download: .../sing-box/core_override_config.json
chown: cannot access '/opt/clashtui/mihomo/config/config.yaml': No such file or directory手动补上即可:
sudo mkdir -p /opt/clashtui/mihomo/config /opt/clashtui/sing-box/config
sudo curl -fsSL https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/contrib/default_configs/mihomo/core_override_config.yaml \
-o /opt/clashtui/mihomo/config/config.yaml
sudo curl -fsSL https://raw.githubusercontent.com/JohanChane/clashtui/refs/heads/main/contrib/default_configs/sing-box/core_override_config.json \
-o /opt/clashtui/sing-box/config/config.json
sudo chown :mihomo /opt/clashtui/mihomo/config/config.yaml && sudo chmod 640 /opt/clashtui/mihomo/config/config.yaml
sudo chown :sing-box /opt/clashtui/sing-box/config/config.json && sudo chmod 640 /opt/clashtui/sing-box/config/config.json安装后的目录结构
/opt/clashtui/
├── bin/clashtui
├── mihomo/
│ ├── mihomo
│ ├── clashtui_mihomo.service
│ └── config/config.yaml
└── sing-box/
├── sing-box
├── clashtui_singbox.service
└── config/config.json用户级配置在 ~/.config/clashtui/,包含 config.yaml、default_keymap.yaml、default_theme.yaml,以及各核心的 core_override_config、profiles/、template_proxy_providers.yaml 等。
服务文件装好了,但不会自启:
sudo systemctl enable --now clashtui_mihomo # 启动并开机自启
# 或
sudo systemctl start clashtui_mihomo # 只启动二、导入订阅
sudo clashtui
选到profiile
输入 i
就可以配置你自己的配置啦
输入u 可以更新配置
这是快捷键清单,可以用 ? 来显示快捷键有哪些

三、第一个坑:MMDB 下不下来
导入订阅后选 Profile,我的TUI 弹出一坨错误,核心信息是:
Can't find MMDB, start download
level=error msg="can't initial GeoIP: can't download MMDB:
Get \"https://github.com/MetaCubeX/meta-rules-dat/releases/download/...\""
rules[9813] [GEOIP,CN,🇨🇳 国内网站] error: can't download MMDB
configuration file ~/.config/clashtui/mihomo/profiles/IK.yaml test failed排查 profile 配置发现里面有大量 GEOIP,CN 规则,Mihomo 启动时需要 GeoIP 数据库(Country.mmdb),默认从 github.com 拉取——但 GitHub 在国内访问不稳定,结果卡住整张配置加载。
思路:绕过 GitHub
Mihomo 支持配置 geox-url 指定 GeoIP/GeoSite/MMDB/ASN 的下载源。
实测 ghfast.top 在当前网络下还能用:
# 直接下到 mihomo 配置目录
sudo curl -fsSL --connect-timeout 10 \
"https://ghfast.top/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb" \
-o /opt/clashtui/mihomo/config/Country.mmdb把镜像写回配置
光下文件还不够——geo-auto-update: true 默认每 7 天会再尝试拉取,下次还会卡。改 config.yaml,把注释打开并换成 ghfast.top:
geox-url:
geoip: "https://ghfast.top/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat"
geosite: "https://ghfast.top/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
mmdb: "https://ghfast.top/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb"
asn: "https://ghfast.top/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb"
geo-auto-update: false
geo-update-interval: 7回到 TUI 重试 Profile 测试,这次直接通过。
四、在crostini TUN 是起不来的
这个我不知道怎么解决 好消息是 HTTP/SOCKS 代理一直工作正常:
$ curl -s --connect-timeout 5 -x http://127.0.0.1:7890 \
https://www.google.com -o /dev/null \
-w "HTTP状态: %{http_code}\n耗时: %{time_total}s\n"
HTTP状态: 302
耗时: 0.424925sTL;DR:在 ChromeOS Crostini 上装 ClashTui 顺利,但 Country.mmdb 因为 GitHub 不通加载失败——把 geox-url 换成可用 GitHub 镜像(ghfast.top)即可解决;TUN 模式受限于 Crostini geo-auto-update无法启用,放弃全局代理、改用 127.0.0.1:7890 的 HTTP 代理或 :7891 的 SOCKS5 是最务实的做法。