Skip to content

Instantly share code, notes, and snippets.

@skyhisi
Created May 3, 2024 07:42
Show Gist options
  • Save skyhisi/bf1e387abeb8f91db59f6ae4a8e1f1ef to your computer and use it in GitHub Desktop.
Save skyhisi/bf1e387abeb8f91db59f6ae4a8e1f1ef to your computer and use it in GitHub Desktop.
Connect to Virtual Box serial port pipe terminal
#!/bin/bash
# Connect to a Virtual Box serial port pipe
# 1. Enable Virtual Box serial port 1 as "Host Pipe", untick "Connect to
# existing", enter path, e.g "/tmp/apollo"
# 2. Start VM, SSH in and enable terminal and reboot:
# systemctl enable serial-getty@ttyS0.service
# 3. Connect to port with this script, pass the filename
# 4. Disconnect with escape key Ctrl+O (letter not zero)
if [ $# -ne 1 ]; then echo "Usage: $0 PIPE"; exit 1; fi
set -eux
exec socat -d unix-connect:"$1" stdio,rawer,escape=0x0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment