Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pjdoland/jetscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

jetscript

One-shot setup script for an NVIDIA Jetson Orin Nano Super running JetPack 6.2 (Ubuntu 22.04 ARM64, GNOME) to make it a working headless dev box.

What it does

Step Default Purpose
apt-get full-upgrade on Fresh Jetson images ship with hundreds of pending security updates.
Install base packages on x11vnc, curl, python3, x11-xserver-utils, etc.
GDM3 autologin + force Xorg on x11vnc must attach to a logged-in user's X session, otherwise it accepts TCP connections and immediately drops them.
x11vnc systemd service on Tuned for compatibility with macOS Screen Sharing.app: -rfbversion 3.3, -rfbauth, -shared, -threads.
Force VNC resolution at session start 1920x1080@60 Helper script + autostart .desktop runs xrandr to apply a chosen resolution. Set VNC_RESOLUTION="" to disable.
Snap Chromium install with snapd 2.70 fix on Works around the well-known snapd-2.70-vs-Jetson-kernel regression by downgrading and pinning snapd before installing chromium.
Node.js 20 LTS + @anthropic-ai/claude-code on From NodeSource.
Xorg snippet to force resolution via xorg.conf.d off Was too aggressive on cheap DisplayPort dummy plugs in testing. Opt in via FORCE_RESOLUTION=1.

Usage

On the Jetson, as your regular user (not root). Run it from an SSH session inside tmux since the apt full-upgrade step can take a while:

curl -fsSL https://raw.githubusercontent.com/pjdoland/jetscript/main/setup-jetson.sh -o setup-jetson.sh
chmod +x setup-jetson.sh
tmux new -s setup
./setup-jetson.sh

You will be prompted once for your sudo password and once for a VNC password. Then sit back. When it finishes, sudo reboot.

After reboot, connect from a Mac

ssh -L 5900:localhost:5900 youruser@<jetson>.local

Then in Finder: Cmd-K > vnc://localhost. Enter the VNC password.

On a trusted LAN you can skip the SSH tunnel and just open vnc://<jetson>.local. VNC itself is unencrypted, so tunnel through SSH on anything else.

Config knobs

Override any of these via env vars on the command line:

INSTALL_CHROMIUM=0 INSTALL_CLAUDE_CODE=0 ./setup-jetson.sh   # just VNC + autologin
DO_FULL_UPGRADE=0 ./setup-jetson.sh                          # skip apt full-upgrade
VNC_RESOLUTION=2560x1440 ./setup-jetson.sh                   # different resolution
VNC_RESOLUTION="" ./setup-jetson.sh                          # don't force any resolution
FORCE_RESOLUTION=1 ./setup-jetson.sh                         # opt into xorg.conf snippet
SKIP_APT_UPDATE=1 ./setup-jetson.sh                          # skip apt-get update at start
VNC_PASSWORD_PROMPT=0 ./setup-jetson.sh                      # don't prompt; set ~/.vnc/passwd yourself

Idempotency

Re-running is safe. Every step detects whether it's already done:

  • Existing x11vnc unit content diffed before rewrite
  • snapd downgrade only fires when snapd >= 2.70 is detected
  • Chromium snap, Node, Claude Code all skipped if already present
  • VNC password file kept if it already exists and is non-empty
  • GDM custom.conf edits idempotent (sed uncomments stock lines; inject fallback only if missing)

If any step fails, the ERR trap prints the failing line, the command, and the path to a full log under /tmp/setup-jetson-<timestamp>.log. Just re-run and it picks up where it left off.

Diagnostic checks after first boot

systemctl status x11vnc
tail -n 20 /var/log/x11vnc.log
xrandr | head                                      # confirm resolution
loginctl show-session $(loginctl | awk "/$USER/ {print \$1; exit}") -p Type
                                                   # should print Type=x11

Why these specific choices

  • x11vnc over vino / gnome-remote-desktop: vino is unreliable on headless boots; gnome-remote-desktop on JP6.2 leans RDP/Wayland. x11vnc with -rfbversion 3.3 -shared -rfbauth is the combination that actually works with Apple's Screen Sharing.app.
  • -noxdamage removed: it slows things down a lot. XDamage on Orin's nvidia driver is fine in practice.
  • -ncache not used: breaks macOS Screen Sharing rendering (Apple's client doesn't know to crop the off-screen cache framebuffer, so the desktop appears as a thin strip at the top).
  • Autologin required: without it, x11vnc accepts the TCP connection, then drops it right after the RFB version handshake because it can't read GDM's Xauthority file under /run/user/128/.
  • snapd downgrade for Chromium: snapd >=2.70 requires kernel security options the Jetson kernel doesn't expose, so snap installs fail. Pinning snapd at revision 24724 (apt: 2.63.2) fixes it.

License

MIT. Use at your own risk; this messes with gdm3, snapd, and fstab-style config and is intended for fresh-imaged Jetson dev boxes, not production.

About

Headless setup for Jetson Orin Nano Super (JetPack 6.2): x11vnc for macOS Screen Sharing, Chromium, Claude Code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages