Skip to content

Instantly share code, notes, and snippets.

@drew970
Last active March 17, 2021 04:45
Show Gist options
  • Select an option

  • Save drew970/85d25478839d0964aa2e4e44fb8be273 to your computer and use it in GitHub Desktop.

Select an option

Save drew970/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

segabor commented Feb 3, 2021

Copy link
Copy Markdown

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

@drew970

drew970 commented Mar 17, 2021

Copy link
Copy Markdown
Author

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