NetVM: 1:1 profile:node mapping — hashed iface names, netvm-enter + netvm-chrome launcher

This commit is contained in:
Antigravity Agent
2026-10-03 00:43:08 -04:00
parent 218a527623
commit b86b6fa4b5
8 changed files with 84 additions and 46 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# netvm-chrome.sh <profile> [url] — launch a chrome-box profile inside its
# dedicated NetVM netns. 1:1: profile = node = warp identity = egress IP.
# Run as your normal user (uses sudo -n only for allowlisted netns ops).
set -euo pipefail
PROFILE="${1:?usage: netvm-chrome.sh <profile> [url]}"
URL="${2:-}"
NODE="$PROFILE"
NETVM_BIN="$(cd "$(dirname "$0")" && pwd)"
CHROME_BOX="${CHROME_BOX_BIN:-$HOME/Projects/chrome-box/chrome-box}"
[ -x "$CHROME_BOX" ] || { echo "chrome-box not found at $CHROME_BOX (set CHROME_BOX_BIN)"; exit 1; }
[ -f "/etc/netvm/${NODE}.conf" ] || { echo "no warp identity for '$NODE' — human: netvm-new-identity.sh $NODE"; exit 1; }
sudo -n "$NETVM_BIN/netvm-node-up.sh" "$NODE" | tail -2
if [ -n "$URL" ]; then
exec sudo -n "$NETVM_BIN/netvm-enter.sh" "$NODE" "$(id -u)" "$(id -g)" "$HOME" -- "$CHROME_BOX" launch "$PROFILE" "$URL"
else
exec sudo -n "$NETVM_BIN/netvm-enter.sh" "$NODE" "$(id -u)" "$(id -g)" "$HOME" -- "$CHROME_BOX" launch "$PROFILE"
fi