Skip to content

Instantly share code, notes, and snippets.

@heo001997
Created April 7, 2026 09:21
Show Gist options
  • Select an option

  • Save heo001997/a7f6dfdd7942781dfc7ab1836a9bb65c to your computer and use it in GitHub Desktop.

Select an option

Save heo001997/a7f6dfdd7942781dfc7ab1836a9bb65c to your computer and use it in GitHub Desktop.
Setup openclaw-remote VM
#!/bin/bash
set -e
echo "=== openclaw-remote VM Setup ==="
# 1. Detect network interface
IFACE=$(ip -o link show | awk -F': ' '{print $2}' | grep -v lo | head -1)
echo "[1/4] Detected interface: $IFACE"
# 2. Set static IP via netplan
echo "[2/4] Configuring static IP 192.168.100.82..."
# Remove any existing netplan configs that might conflict
sudo rm -f /etc/netplan/*.yaml 2>/dev/null || true
sudo tee /etc/netplan/01-static.yaml > /dev/null << EOF
network:
version: 2
ethernets:
$IFACE:
dhcp4: no
addresses:
- 192.168.100.82/24
routes:
- to: default
via: 192.168.100.1
nameservers:
addresses:
- 192.168.100.81
- 8.8.8.8
EOF
sudo netplan apply
sleep 2
# 3. Verify connectivity
echo "[3/4] Testing internet..."
if ping -c 2 -W 3 8.8.8.8 > /dev/null 2>&1; then
echo " Internet OK"
else
echo " WARNING: No internet. Check gateway/router."
echo " Continuing anyway (apt may fail)..."
fi
# 4. Install SSH + QEMU guest agent
echo "[4/4] Installing openssh-server and qemu-guest-agent..."
sudo apt update -y
sudo apt install -y openssh-server qemu-guest-agent
sudo systemctl enable --now ssh
sudo systemctl enable --now qemu-guest-agent
echo ""
echo "=== DONE ==="
echo "IP: 192.168.100.82"
echo "SSH: ssh heo001997@192.168.100.82"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment