Some checks failed
Tests / test (push) Has been cancelled
不是翻译 —— 多数文档描述的行为已经不存在了。 先修一个更基本的问题:我们不拥有 u-claw.org 域名,那是上游的。所以之前写在 README、诊断包提示、联系方式里的 help@u-claw.org 全都会把用户的问题发给 上游 —— 一个没有理由回复的人。改为指向我们自己的 issue tracker,并加断言 禁止再出现指向该域名的支持入口。 重写(内容过时,不是语言问题): - install/README.md —— 还写着 10 个中国技能、DeepSeek 优先、国内镜像。 现在按实际流程写:技能读 manifest、模型菜单 Gemini 优先、bundle 有 SHA256 校验。并如实写明 curl|bash 在受管企业电脑上会被 EDR 拦。 - CLAUDE.md 的模型配置整节 —— 还在描述虾盘云首选卡片和 12 个 provider, 那个界面已经换成单框 Key 输入了。 - SECURITY.md —— 安全报告原本指向上游维护者个人邮箱。fork 之后那条路由 是错的:漏洞会发给写不了这份代码、也修不了的人。 - CONTRIBUTING.md —— 补上 fork 关系、pre-push 钩子怎么装、以及 `node --test tests/` 为什么不能用。 翻译并保留: - bootable/README.md、TROUBLESHOOTING.md —— 面向用户,顺带把 「国内镜像」「小米/华为 BIOS 按键」等换成目标市场的实际情况 HANDOFF.md 重写为一份事故复盘:原文一半是过时的一次性交接笔记(引用的 website/guide.html 已不在本仓库),另一半是 persistence.dat 未格式化导致 启动失败的排查记录 —— 后者有长期价值,尤其是「读 offset 1080 的两字节 验证 ext4」这个判断方法,已同时写进 bootable/README.md。 bootable/IMPROVEMENTS_SUMMARY.md 保留中文,加了说明:它是上游 fork 前的 历史改进记录,没人引用,描述的是已完成的工作而非当前行为。翻译它反而会 让人误以为是现行文档。 新增 skills/en/uclaw-help —— 把「怎么用、东西在哪、出问题怎么办」做成 内置知识,每个角色都装。方案 C10.8:能问的产品才是不需要学的产品。
265 lines
9.1 KiB
Markdown
265 lines
9.1 KiB
Markdown
# Bootable Linux USB
|
||
|
||
> Turn any computer into an AI workstation — boot from the drive, no operating
|
||
> system required on the machine itself.
|
||
|
||
## How this differs from the portable build
|
||
|
||
The portable build (`portable/`) needs the computer to already run Windows or
|
||
macOS. This one does not need the machine to have an operating system at all:
|
||
it boots Ubuntu off the drive and runs U-Claw inside it.
|
||
|
||
That makes it the answer for a machine that is locked down, wiped, or running
|
||
something you cannot install onto.
|
||
|
||
## Self-contained on purpose
|
||
|
||
This directory does not reference `portable/`, `u-claw-app/` or anything else in
|
||
the repository. Every script hardcodes its own URLs and paths. A change here
|
||
cannot break another module, and a change elsewhere cannot break this.
|
||
|
||
There is also a standalone mirror at
|
||
[u-claw-linux](https://gitea.fanghe.it.com/zhenghy/u-claw-linux) with the same
|
||
contents, for cloning it on its own.
|
||
|
||
## What ends up on the drive
|
||
|
||
```
|
||
Ventoy boot area (hidden partition)
|
||
BIOS + UEFI dual-mode boot, Ventoy 1.0.99
|
||
|
||
Ventoy data partition (visible)
|
||
ubuntu-24.04.4-desktop-amd64.iso 5.8 GB
|
||
persistence.dat 20 GB
|
||
ventoy/ventoy.json config
|
||
u-claw-linux/
|
||
├── setup-openclaw.sh
|
||
└── start-openclaw.sh
|
||
```
|
||
|
||
| Choice | Why |
|
||
|---|---|
|
||
| **Ventoy 1.0.99** | Drop an ISO in and it boots — no burning, and several systems can share the drive |
|
||
| **Ubuntu 24.04 LTS** | Long-term support, the widest hardware driver coverage |
|
||
| **casper-rw persistence** | Lets a live USB keep data across reboots |
|
||
|
||
## What you need
|
||
|
||
| | |
|
||
|---|---|
|
||
| USB drive | **32 GB or larger.** USB 3.0 strongly recommended — on 2.0 everything is painful |
|
||
| Build machine | Windows 10/11, PowerShell 5.1+ |
|
||
| Target machine | x86_64 (Intel or AMD), any brand |
|
||
| Network | Needed once, when installing OpenClaw |
|
||
|
||
## Building it — four steps
|
||
|
||
Open PowerShell **as Administrator** on Windows:
|
||
|
||
```powershell
|
||
cd path\to\u-claw\bootable
|
||
|
||
.\1-prepare-usb.ps1 # Write Ventoy to the drive — THIS FORMATS IT
|
||
.\2-download-iso.ps1 # Download Ubuntu 24.04 (~5.8 GB)
|
||
.\3-create-persistence.ps1 # Create the persistence image (20 GB default)
|
||
.\4-copy-to-usb.ps1 # Copy everything onto the drive
|
||
```
|
||
|
||
### What each step does
|
||
|
||
**1 · Write Ventoy** — lists your USB devices for confirmation, downloads Ventoy,
|
||
then hands you its GUI to pick the drive and click Install.
|
||
**This erases the drive. Back it up first.**
|
||
|
||
**2 · Download Ubuntu** — fetches the 24.04.4 desktop ISO from
|
||
`releases.ubuntu.com`, verifies its SHA256, and caches it so a retry does not
|
||
re-download 5.8 GB.
|
||
|
||
**3 · Create persistence** — the step that actually decides whether this works.
|
||
|
||
- **With WSL installed** → creates a properly formatted ext4 image directly
|
||
- **With only docker-desktop's WSL** → falls back to `/sbin/mkfs.ext4`
|
||
- **With no WSL at all** → creates an empty sparse file that **you must format
|
||
by hand** on first boot (see below)
|
||
|
||
The volume label must be `casper-rw` — that is the name Ubuntu looks for.
|
||
|
||
**4 · Copy to the drive** — finds the Ventoy drive by its label, checks free
|
||
space, copies the ISO, `persistence.dat`, `ventoy.json` and the setup scripts.
|
||
|
||
## When the scripts fail
|
||
|
||
Reported by @wzf9 in issue #28. Useful when a download fails, the network is
|
||
unreliable, or you are building offline.
|
||
|
||
**Ventoy would not download or install**
|
||
|
||
Get the Windows build from https://github.com/ventoy/Ventoy/releases, unzip,
|
||
run `Ventoy2Disk.exe`, pick the drive, click Install. It formats the drive.
|
||
|
||
**The ISO would not download**
|
||
|
||
Fetch it yourself:
|
||
- https://releases.ubuntu.com/24.04/ubuntu-24.04.4-desktop-amd64.iso
|
||
- https://releases.ubuntu.com/24.04/SHA256SUMS
|
||
|
||
Put the ISO at `bootable\.download-cache\ubuntu-24.04.4-desktop-amd64.iso`, then
|
||
check it:
|
||
|
||
```powershell
|
||
(Get-FileHash -Algorithm SHA256 ".\.download-cache\ubuntu-24.04.4-desktop-amd64.iso").Hash -eq "3a4c9877b483ab46d7c3fbe165a0db275e1ae3cfe56a5657e5a47c2f99a99d1e"
|
||
```
|
||
|
||
**The persistence file is empty (no WSL)**
|
||
|
||
Boot into Ubuntu once, then:
|
||
|
||
```bash
|
||
sudo mkfs.ext4 -F -L casper-rw /media/*/Ventoy/persistence.dat
|
||
```
|
||
|
||
**Reboot after formatting** — persistence does not take effect until you do.
|
||
|
||
**The copy step failed**
|
||
|
||
Put these on the Ventoy data partition by hand:
|
||
|
||
| From | To (drive root) |
|
||
|---|---|
|
||
| `bootable\linux-setup\` | `u-claw-linux\` |
|
||
| `bootable\ventoy\` | `ventoy\` |
|
||
| `bootable\.download-cache\persistence.dat` | `persistence.dat` |
|
||
| `bootable\.download-cache\ubuntu-24.04.4-desktop-amd64.iso` | (same name) |
|
||
|
||
## Using it
|
||
|
||
### First time
|
||
|
||
1. Plug the drive into the target machine
|
||
2. Power on and press the boot-menu key:
|
||
|
||
| Brand | Key |
|
||
|---|---|
|
||
| Dell | F12 |
|
||
| Lenovo | F12 |
|
||
| HP | F9 |
|
||
| ASUS | F2 or DEL |
|
||
| Acer | F12 |
|
||
| MSI | F11 |
|
||
| Others | F12 or F2 usually; check the splash screen |
|
||
|
||
3. Choose the USB device, then Ubuntu from the Ventoy menu
|
||
4. Wait for the desktop — one to three minutes off a USB drive is normal
|
||
5. Connect to Wi-Fi
|
||
6. Open a terminal (`Ctrl+Alt+T`) and run:
|
||
|
||
```bash
|
||
sudo bash /media/*/Ventoy/u-claw-linux/setup-openclaw.sh
|
||
```
|
||
|
||
7. A **U-Claw AI Assistant** icon appears on the desktop
|
||
8. Double-click it, then paste an API key in the browser
|
||
|
||
### After that
|
||
|
||
Plug in, boot, double-click the icon. Everything you set up is still there.
|
||
|
||
## What `setup-openclaw.sh` does
|
||
|
||
| Step | |
|
||
|---|---|
|
||
| 1 | Check it is running as root — it needs `sudo` |
|
||
| 2 | Install `curl` and `xdg-utils` |
|
||
| 3 | Create `/opt/u-claw/{runtime,core,data}` |
|
||
| 4 | Download Node.js from `nodejs.org` |
|
||
| 5 | Write `package.json` |
|
||
| 6 | Install OpenClaw and the QQ plugin from `registry.npmjs.org` |
|
||
| 7 | Write the default config — gateway and token |
|
||
| 8 | Install the start script into `/opt/u-claw/` |
|
||
| 9 | Create the desktop shortcut, optionally starting on login |
|
||
|
||
## Configuration
|
||
|
||
### `ventoy/ventoy.json`
|
||
|
||
```json
|
||
{
|
||
"persistence": [
|
||
{
|
||
"image": "/ubuntu-24.04.4-desktop-amd64.iso",
|
||
"backend": "/persistence.dat",
|
||
"autosel": 1
|
||
}
|
||
]
|
||
}
|
||
```
|
||
|
||
Tells Ventoy to attach `persistence.dat` when booting that ISO. `autosel: 1`
|
||
skips the confirmation prompt.
|
||
|
||
### Environment on Linux
|
||
|
||
| Variable | Value |
|
||
|---|---|
|
||
| `OPENCLAW_HOME` | `/opt/u-claw/data/.openclaw` |
|
||
| `OPENCLAW_STATE_DIR` | `/opt/u-claw/data/.openclaw` |
|
||
| `OPENCLAW_CONFIG_PATH` | `/opt/u-claw/data/.openclaw/openclaw.json` |
|
||
|
||
## Files
|
||
|
||
```
|
||
bootable/
|
||
├── README.md this file
|
||
├── 1-prepare-usb.ps1 write Ventoy
|
||
├── 2-download-iso.ps1 download Ubuntu
|
||
├── 3-create-persistence.ps1 create the persistence image
|
||
├── 4-copy-to-usb.ps1 copy onto the drive
|
||
├── linux-setup/
|
||
│ ├── format-persistence.sh format the persistence image
|
||
│ ├── setup-openclaw.sh install OpenClaw
|
||
│ ├── start-openclaw.sh launcher
|
||
│ └── openclaw.desktop desktop shortcut
|
||
└── ventoy/
|
||
└── ventoy.json persistence config
|
||
```
|
||
|
||
## Things learned the hard way
|
||
|
||
**An unformatted `persistence.dat` drops Ubuntu into initramfs.** Ventoy cannot
|
||
mount a file with no ext4 filesystem in it, and the boot fails in a way that
|
||
gives no hint about the cause. To check whether a file is actually formatted,
|
||
read two bytes at offset 1080 — they should be `0x53 0xEF`, the little-endian
|
||
form of the ext4 magic number `0xEF53`.
|
||
|
||
**Formatting requires a reboot.** Running `mkfs.ext4` and continuing in the same
|
||
session looks like it worked and silently does not persist.
|
||
|
||
**Drive quality matters more than you would expect.** Cheap unbranded drives fail
|
||
in ways that look like software problems. Use USB 3.0, plug into the board
|
||
directly rather than through a hub, and prefer 32 GB+ (5.8 GB ISO + 20 GB
|
||
persistence + overhead leaves little room otherwise).
|
||
|
||
**Sizing**: 20 GB persistence on a 32 GB drive, 40 GB+ on a 64 GB drive.
|
||
|
||
## Troubleshooting
|
||
|
||
| Problem | Fix |
|
||
|---|---|
|
||
| Will not boot from USB | In BIOS: disable Secure Boot, enable USB boot. Try both UEFI and Legacy/CSM |
|
||
| No Ubuntu in the Ventoy menu | The ISO must be in the root of the Ventoy data partition |
|
||
| Boot stops at initramfs | `persistence.dat` is not formatted. `mkfs.ext4 -F -L casper-rw`, then reboot |
|
||
| Data lost on reboot | Same cause — check the file is ext4 and the label is exactly `casper-rw` |
|
||
| No USB boot entry at all | Try another port; some machines disable USB boot in BIOS by default |
|
||
| Desktop takes ages to load | Normal off a USB drive. USB 3.0 on a USB 3.0 port helps a lot |
|
||
| OpenClaw install fails | Check the network — it needs `nodejs.org` and `registry.npmjs.org` |
|
||
| Wi-Fi does not work | Ubuntu 24.04 covers most chipsets; otherwise tether over USB from a phone |
|
||
| Browser does not open | Go to `http://localhost:18789` yourself |
|
||
| Port already in use | OpenClaw uses 18789–18799. Close the terminal window and open it again |
|
||
| Wrong screen resolution | Settings → Displays |
|
||
|
||
**Performance**: running off a USB drive is slower than a disk — that is
|
||
physics, not a bug. Inference happens at your model provider, so conversation
|
||
speed is unaffected; only startup and file operations are slower.
|
||
|
||
For anything not covered here, see [TROUBLESHOOTING.md](TROUBLESHOOTING.md).
|