Virtual port pair with socat

socat -d -d PTY: PTY:

Creates two linked virtual serial ports. The ports will receive some random number. The -d indicates a verbosity level. If more -d’s are added, the verbosity level increases.