Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question is mostly about "socat", but here's some background to go with it:

I am trying -- for reasons having mostly to do with nostalgia -- to write a virtual modem driver for use with VirtualBox. It should listen to the socket that VirtualBox connects to the virtual guest, and emulate (a) a standard Hayes command set and (b) let one connect to remote systems using "atd some.host.name". Mostly it works, but I've run into problems with data transfers. I assume the problem is mine, because I seldom have the chance to muck about with mult-channel communication, select loops, and the like...

...so I though I would prototype my solution using the "socat" command, like this:

socat UNIX-CONNECT:/tmp/vbox.port EXEC:"telnet -E8 some.remote.host"

This works, sort of, just like my solution -- basic interactive typing seems fine, but try a file transfer and it just falls over. I've also tried this, just in case there was some sort of tty line discipline in the way:

socat UNIX-CONNECT:/tmp/vbox.port EXEC:"telnet -E8 some.remote.host",pty,raw,cs8

That didn't work any better.

I'm wondering if anyone here has thoughts on solving this. The problem is not with telnet; using -E8 provides an 8-bit clean path that works fine by itself (e.g., when not involved in this sort of pty-proxying).

This is obviously not a critical problem, but I'm hoping that someone else out there finds it at least mildly interesting.

share|improve this question
I don't think socat has any problem with arbitrary byte streams, so I suspect the fault is elsewhere. Can you post a small reproducible example? – Gilles Mar 11 '11 at 20:59
@Gilles: (1) Install DOS under virtualbox and assign com1 to a socket on the remote host. (2) Install a terminal program; txzm seems like a nice one. (3) Connect the com1 socket to a remote host using socat. (4) Try to transfer a file with zmodem (e.g., using sz from the lrzsz package). – larsks Mar 17 '11 at 1:03
...noting, again, that I'm not suggesting you actually go through any of this unless you find this problem interesting. – larsks Mar 17 '11 at 1:04
I might try it if I could do Linux to Linux, but DOS? No way. Though what's DOS for anyway? I do have a Linux VM on Linux. – Gilles Mar 17 '11 at 1:09
You could probably demonstrate the problem using minicom on Linux, too. – larsks Mar 17 '11 at 1:18

Although you say telnet is not the culprit, I would test taking it away.

Have you tried the following?

socat UNIX-CONNECT:/tmp/vbox.port tcp:some.remote.host:23

This should be 8-bit clean by itself.

share|improve this answer
Unfortunately, telnet is required, and demonstrably is not the problem -- for example, one can use qodem over a telnet connection without a hitch. I'm beginning to suspect the VirtualBox socket itself, but I'm not sure exactly how to verify that. A simple "send characters 0x00 through 0xFF" seems to work as expected. – larsks Mar 17 '11 at 1:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.