Loading...
Loading...
Install and configure NVIDIA NemoClaw (sandboxed OpenClaw agent platform) on Linux. Handles cloudflared tunnels, Docker cgroup fixes, OpenShell, sandbox creation, remote access via Cloudflare Tunnel, and known bug workarounds. Triggers: "install nemoclaw", "setup nemoclaw", "nvidia nemoclaw", "openclaw setup", "nemoclaw on spark", "nemoclaw on dgx".
npx skill4agent add jezweb/claude-skills nemoclaw-setup| Requirement | Check | Install |
|---|---|---|
| Linux (Ubuntu 22.04+) | | — |
| Docker | | |
| Node.js 20+ (22 recommended) | | |
| NVIDIA GPU (optional but recommended) | | — |
| NVIDIA API key | — | https://build.nvidia.com/settings/api-keys |
# Check Docker
docker ps 2>/dev/null || echo "Docker not running or no access"
# Check Node.js
node --version
# Check if already installed
which nemoclaw && nemoclaw --version
which openshell && openshell --versionnemoclawcurl -fsSL https://nvidia.com/nemoclaw.sh | bash~/.npm-global/bin/curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejscurl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh~/.local/bin/openshelldockersudo usermod -aG docker $USER
newgrp docker
# or log out and back in# Check if needed
grep cgroup2 /proc/filesystems && echo "cgroup v2 detected — fix needed"
# Apply fix (needs sudo)
sudo $HOME/.npm-global/bin/nemoclaw setup-spark"default-cgroupns-mode": "host"/etc/docker/daemon.jsonnemoclaw setup-sparknvapi-PATH=$HOME/.npm-global/bin:$HOME/.local/bin:$PATH nemoclaw onboardclawfuser -k 8080/tcp# Check sandbox is running
PATH=$HOME/.npm-global/bin:$HOME/.local/bin:$PATH nemoclaw claw status
# Connect via terminal
PATH=$HOME/.npm-global/bin:$HOME/.local/bin:$PATH nemoclaw claw connectPATH=$HOME/.npm-global/bin:$HOME/.local/bin:$PATH openshell forward start 18789 clawhttp://127.0.0.1:18789/# Get the token
ssh -F /tmp/nemoclaw-ssh-config openshell-claw \
"python3 -c \"import json; print(json.load(open('/sandbox/.openclaw/openclaw.json'))['gateway']['auth']['token'])\""http://127.0.0.1:18789/#token=<gateway-token>cat > ~/.local/bin/nemoclaw-keepalive.sh << 'KEEPALIVE'
#!/bin/bash
export PATH="$HOME/.npm-global/bin:$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin"
cleanup() { kill %1 2>/dev/null; exit 0; }
trap cleanup SIGTERM SIGINT
while true; do
fuser -k 18789/tcp 2>/dev/null; sleep 1
openshell forward start 18789 claw &
FORWARD_PID=$!; sleep 3
while kill -0 $FORWARD_PID 2>/dev/null; do
if ! curl -sf -o /dev/null --connect-timeout 3 http://127.0.0.1:18789/ 2>/dev/null; then
echo "$(date): Health check failed, restarting..."
kill $FORWARD_PID 2>/dev/null; wait $FORWARD_PID 2>/dev/null; break
fi
sleep 10
done
echo "$(date): Forward died, restarting in 3s..."; sleep 3
done
KEEPALIVE
chmod +x ~/.local/bin/nemoclaw-keepalive.shsudo tee /etc/systemd/system/nemoclaw-forward.service << 'SERVICE'
[Unit]
Description=NemoClaw Port Forward with Health Check
After=docker.service
Requires=docker.service
[Service]
Type=simple
User=$USER
Group=docker
Environment=PATH=/home/$USER/.npm-global/bin:/home/$USER/.local/bin:/usr/local/bin:/usr/bin:/bin
ExecStart=/home/$USER/.local/bin/nemoclaw-keepalive.sh
Restart=always
RestartSec=5
KillMode=control-group
[Install]
WantedBy=multi-user.target
SERVICE
sudo systemctl daemon-reload
sudo systemctl enable nemoclaw-forward
sudo systemctl start nemoclaw-forwardcloudflared tunnel route dns <tunnel-name> nemoclaw.<domain>/etc/cloudflared/config.yml - hostname: nemoclaw.<domain>
service: http://localhost:18789
originRequest:
httpHostHeader: "127.0.0.1:18789"sudo systemctl restart cloudflaredopenshell sandbox ssh-config claw > /tmp/nemoclaw-ssh-config
ssh -F /tmp/nemoclaw-ssh-config openshell-claw 'python3 -c "
import json
with open(\"/sandbox/.openclaw/openclaw.json\") as f:
config = json.load(f)
config[\"gateway\"][\"controlUi\"][\"allowedOrigins\"].append(\"https://nemoclaw.<domain>\")
config[\"gateway\"][\"trustedProxies\"] = [\"127.0.0.1\", \"::1\", \"172.0.0.0/8\", \"10.0.0.0/8\"]
config[\"gateway\"][\"allowRealIpFallback\"] = True
with open(\"/sandbox/.openclaw/openclaw.json\", \"w\") as f:
json.dump(config, f, indent=2)
print(\"Done. Token:\", config[\"gateway\"][\"auth\"][\"token\"])
"'https://nemoclaw.<domain>/#token=<gateway-token>/sandbox/.openclaw/skills/<name>/SKILL.mdssh -F /tmp/nemoclaw-ssh-config openshell-claw
mkdir -p /sandbox/.openclaw/skills/my-skill
cat > /sandbox/.openclaw/skills/my-skill/SKILL.md << 'EOF'
---
name: my-skill
description: What this skill does.
tools: [exec, read, write]
---
# My Skill
Instructions for the agent...
EOFopenclaw skills list/sandbox/.openclaw/workspace/USER.md/sandbox/.openclaw/workspace/TOOLS.md/sandbox/.openclaw/workspace/SOUL.md# 1. Update host-side packages
npm install -g openclaw@latest
# 2. Destroy and recreate sandbox
nemoclaw claw destroy
nemoclaw onboard
# 3. Reconfigure remote access (Step 9) and skills (Step 10)| Issue | Cause | Fix |
|---|---|---|
| Docker service stopped or user not in docker group | |
| Docker not configured for cgroupns=host | |
| Port 8080 in use | Another service on that port | |
| Not in PATH | |
| Bug in OpenClaw ≤ v2026.3.11 | Append |
| Token changed after sandbox rebuild | Get new token from sandbox config |
| Rate limited from old token attempts | Restart gateway: |
| Domain not in allowedOrigins | Add to |
| Port 18789 not responding | SSH tunnel died | |
| npm 403 Forbidden inside sandbox | Network policy blocking TLS | Cannot install packages inside sandbox — rebuild instead |
| Wrong Cloudflare account/cert | Check |
| Error 502 on Cloudflare | Tunnel connections dropped | |
| Assets 404 via Cloudflare | Browser not authenticated for sub-requests | Hard refresh (Ctrl+Shift+R) after Cloudflare Access login |
Docker (openshell-cluster-<name>)
└─ k3s cluster
├─ NVIDIA device plugin
└─ OpenShell sandbox
├─ OpenClaw agent
├─ NemoClaw plugin
├─ Gateway (WebSocket + REST)
└─ Workspace (SOUL.md, USER.md, TOOLS.md, skills/)
Port forward (systemd): localhost:18789 ←SSH tunnel→ sandbox:18789
Cloudflare Tunnel (optional): nemoclaw.domain → localhost:18789