2017年9月13日星期三

Mapping remote ESXi VM serial port to local serial port via ethernet

Topology:
 VM(Linux with Serial Port /dev/ttyS0)---------Ethernet----------Login remote VM with Local Serial Port(PC with SerialPort /dev/ttyUSB0)

1. First of all, if the requirement is telnet to remote VM's serial port, the only thing you need to do is set esxi serial port as below, the use telnet ip 10001 to login, NOT need following all step next.

2. If the requirement is use remote serial port as same as local serial port, then download https://elifulkerson.com/projects/downloads/tsb-release/tsb-client.py script document is here: https://elifulkerson.com/projects/telnet-serial-bridge.php

3. Install python libary:pip install pyserial
Insert #!/usr/bin/python2.7  to tsc-client.py first line.
set file format to unix by vi/vim, :set ff=unix or :%s/^M//g (https://stackoverflow.com/questions/82726/convert-dos-line-endings-to-linux-line-endings-in-vim(https://stackoverflow.com/questions/82726/convert-dos-line-endings-to-linux-line-endings-in-vim)
sudo ./tsb-client.py -p '/dev/ttyS0' -r 57600 -b 1 -c 10001 -i [VM's esxi host ip]

没有评论:

发表评论