There is ubuntu 16.04 which is installed on VirtualBox. In the machine itself, there is one physical com port, it is prokinut in VirtualBox in the "host device" mode like this:
I also turned on 2 ports in "off" mode:
As a result, these ports are defined on ubuntu. (But I can only work with one)
$ dmesg | grep tty [ 0.004000] console [tty0] enabled [ 0.772403] 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A [ 0.794717] 00:03: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A [ 0.816355] 00:04: ttyS2 at I/O 0x3e8 (irq = 4, base_baud = 115200) is a 16550A The question is: can I make it so that I can write to the com-port and read from it (like here ) without connecting any device (I just need an echo) and without resorting to any crutches like inserting a clip into the port to close Tx-rx.
Can socat help me with this? As I understand it, with the help of it you can make a bridge from one port to another, but I got confused in the wilds of its settings, I would be grateful if someone could tell me the correct line.
Or is socat not suitable for this purpose, and do I need something else?

