Skip to content

Instantly share code, notes, and snippets.

@0xf10e
Last active March 23, 2020 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xf10e/9afdf198f04600587bd59faacc9e605f to your computer and use it in GitHub Desktop.
Save 0xf10e/9afdf198f04600587bd59faacc9e605f to your computer and use it in GitHub Desktop.
How To Connect to the Serial Console of a FreeBSD guest running under VMware Fusion 11 Pro

So Cisco's AnyConnect prevents access to virtual local networks, too, great!

Turns out, you can do more with a serial port in VMware Fusion than logging it's output. Like, use it as a proper serial console so you can log in when something is messing with your network stack.

This primarily shows @kuenishi's directions still work on macOS 10.14 Mojave with VMware Fusion 11.x Pro.

  1. Create VM, add serial port, make sure VM is shut down, edit .vmx file's `serial0' lines to look like this:

    mbp:~ me$ grep -i serial Virtual\ Machines.localized/fbsd.vmwarevm/fbsd.vmx
    serial0.fileType = "pipe"
    serial0.fileName = "/Users/me/Virtual Machines.localized/fbsd.serial"
    serial0.present = "TRUE"
    mbp:~ me$ 
    
  2. Boot your FreeBSD, enable login on the (1st) serial line.

  3. To create a pty connected to the socket serial0.fileName and send socat to the background:

    socat unix-connect:/Users/me/Virtual\ Machines.localized/fbsd.serial pty,link=/tmp/fbsd.pty &
    
  4. Now start screen to connect to the pty device:

    screen /tmp/fbsd.pty
    

Done.

I had some troubles with re-connecting to the console but those might've been stray socat processes still having a lock on the /tmp/*.pty.

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