Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Accessing to VM via serial console at VMware Fusion 5

Environment

  • Using FreeBSD
  • Mountain Lion
  • VMware Fusion 5
  • Your VMware is installed at '/Applications/VMware Fusion.app'
  • Command Line tools are at '/Applications/VMware Fusion.app/Contents/Library'
  • especially vmrun
  • suppose you VM is at /path/to/freebsd.vmwarevm/freebsd.vmx

FreeBSD installed as usual VMware Fusion 5

Prepare MacOS

Install socat

$ sudo port install socat

Configureing VMware

Edit the freebsd.vmx while the VM is shut down

serial0.fileType = "pipe"
serial0.fileName = "/path/to/FreeBSD64serial_port"
serial0.present = "TRUE"

Start the VM

$ /Applications/VMware Fusoin.app/Contents/Library/vmrun -T fusion start /path/to/freebsd.vmwarevm/freebsd.vmx

Watch the serial port

via stdio: simple

Input will be echoed.

$ socat -d -d unix-connect:/path/to/FreeBSD64serial_port stdio

via pty: for old socat?

To avoid echo, use screen

$ socat -d -d unix-connect:/path/to/FreeBSD64serial_port pty
2012/10/03 12:48:05 socat[16888] N opening connection to LEN=44 AF=1 "/var/vb_disk/kuenishi/FreeBSD64serial_port"
2012/10/03 12:48:05 socat[16888] N successfully connected from local address LEN=16 AF=1 ""
2012/10/03 12:48:05 socat[16888] N PTY is /dev/ttys001
2012/10/03 12:48:05 socat[16888] N starting data transfer loop with FDs [3,3] and [4,4]

and in another console:

$ screen /dev/ttys001

Configure FreeBSD

Handbook worked well . Edit /boot/loader.conf - create if doesn't exist.

# echo 'console="comconsole"' >> /boot/loader.conf

Edit /etc/ttys and change off to on and dialup to vt100 for the ttyu0 entry. Reboot the system to see if the changes took effect.

Conclusion

Screen size is limited and cannot be changed so it's not good for me - sigh. Try virsh though not working with VMware Fusion 5.

Links worked

Linked didn't work

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