qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] qemu networking guestfwd


From: Peter Maydell
Subject: Re: [Qemu-discuss] qemu networking guestfwd
Date: Tue, 28 May 2019 16:19:15 +0100

On Tue, 28 May 2019 at 15:01, Pascal <address@hidden> wrote:
> how to redirect a local port in guest to a local port on host (adb) ?
>
> I've tried :
>
> qemu ... -nic user,guestfwd=tcp:127.0.0.1:5037-tcp:127.0.0.1:5037
>
> but I've got this error :
>
> qemu-system-x86_64: Conflicting/invalid host:port in guest forwarding rule
> 'tcp:127.0.0.1:5037-tcp:127.0.0.1:5037'

This command line doesn't look right. The -guestfwd option is
expecting the first IP address to be one that the guest can
access (ie which is on the "user mode networking" emulated
subnet, which by default is 10.0.2.x), and the second to be that
of the host that you're redirecting it to, but you've given two
IP addresses which are the same and which are both the loopback
address. I think having the second IP addr be 127.0.0.1 is OK,
but the first is wrong.

If you're trying to make QEMU cause guest OS accesses to
127.0.0.1:5037 to be redirected, there is no way to do that.
Loopback connections are handled entirely within the guest
OS and never go out to the network. All QEMU can do is
work with the packets that go out of the emulated network card.

(Also, just to check, -guestfwd is for "when the guest OS
connects to 10.0.2.100, really connect it to external
server address X port Y". If what you wanted was "when
a program on the host connects to host port X, make it
really connect to port Y on the guest", that is -hostfwd.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]