Skip to contentSkip to conversation

user-net -redir working?

Qemu-devel Richard Neill 3 participants 3 messages Nov 20, 2005 – Nov 21, 2005

lore
Share & tools
lore
#0 lore raw

Does the user-net redirection for tcp actually work? I have been unable to make it work at all!

I've tried several different host machines (all Linux, different versions of Qemu from 0.6.1 to 0.7.2), and different guests (Win98 and Knoppix). But it doesn't work. Eg:

qemu -cdrom /dev/cdrom -boot d -user-net -redir tcp:2300::2301

In Guest (knoppix):
netcat -l -p 2301

On Host:

netcat localhost 2300

This connection is accepted (Netcat doesn't say connection refused),
but then no data is ever transferred.

Could someone confirm whether
a)I am being an idiot
b) -redir is actually broken
c) something is extremely weird in my setup.

Thanks for your help,

Richard

#1 lore raw
Quoted 7 lines · Richard Neill

qemu -cdrom /dev/cdrom -boot d -user-net -redir tcp:2300::2301

In Guest (knoppix):

   netcat -l -p 2301

On Host:

Quoted 8 lines

netcat localhost 2300

This connection is accepted (Netcat doesn't say connection refused),
but then no data is ever transferred.

Could someone confirm whether
a)I am being an idiot

Without more data, I'd vote for (a). It sounds like netcat is behaving normally to me. Since you are typing this at the prompt, netcat is dutifully waiting for you to type something to send over the link.

Perhaps if you type something on the client side and hit <ENTER>? Then see if it shows up on the server side.

If you don't get any output on the server side, a network sniffer (tcpdump) on both sides of the connection should be illuminating.

Later,

-- John.

#2 lore raw

Disabling the Nagle algorithm (i.e., enabling TCP_NODELAY) or typing a lot of garbage just to fill the buffer with enough data can help, also.

And IIRC, netcat has a UDP mode as well. I see no reason for this to happen, but is there any chance it's using UDP by default, and you're only redirecting TCP?

Good luck!

--
"The user-friendly computer is a red herring. The user-friendliness of a book just makes it easier to turn pages. There's nothing user-friendly about learning to read."
-Alan Kay

Quoted 3 lines · John R. Hogerhuis
Quoted 2 lines · Richard Neill

This connection is accepted (Netcat doesn't say connection refused),
but then no data is ever transferred.

[8<]

Quoted 10 lines

Without more data, I'd vote for (a). It sounds like netcat is behaving normally to me. Since you are typing this at the prompt, netcat is dutifully waiting for you to type something to send over the link.

Perhaps if you type something on the client side and hit <ENTER>? Then see if it shows up on the server side.

If you don't get any output on the server side, a network sniffer (tcpdump) on both sides of the connection should be illuminating.