Created
May 3, 2024 07:42
-
-
Save skyhisi/bf1e387abeb8f91db59f6ae4a8e1f1ef to your computer and use it in GitHub Desktop.
Connect to Virtual Box serial port pipe terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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