Skip to content

Instantly share code, notes, and snippets.

@arr888
Last active March 17, 2021 04:45
Show Gist options
  • Save arr888/85d25478839d0964aa2e4e44fb8be273 to your computer and use it in GitHub Desktop.
Save arr888/85d25478839d0964aa2e4e44fb8be273 to your computer and use it in GitHub Desktop.
Get a serial console to linux host for docker on mac
#!/bin/bash
TTY_TMP=$(mktemp)
$(socat -d -d ~/Library/Containers/com.docker.docker/Data/debug-shell.sock pty,rawer 2>&1 | grep -Eo --line-buffered "/dev/tty\w+" > ${TTY_TMP} ) &
sleep 2
TTY=$(tail -n 1 "${TTY_TMP}")
picocom $TTY 2>/dev/null
@segabor
Copy link

segabor commented Feb 3, 2021

You saved the day, thanks for the script! For the record some tools needs to be installed first (if not done yet),

brew install socat picocom

@arr888
Copy link
Author

arr888 commented Mar 17, 2021

I'm glad it was of some use it's derived from another persons post although I can't recall the original thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment