qemu-discuss
[Top][All Lists]
Advanced

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

Re: sparc-solaris networking not working


From: Peter Maydell
Subject: Re: sparc-solaris networking not working
Date: Fri, 19 Jun 2020 23:08:13 +0100

On Fri, 19 Jun 2020 at 22:24, Michele Denber <mdenber@gmx.com> wrote:
>
> I started my virtual SparcStation 5 like this:
>
> $ qemu-system-sparc -nographic -bios ss5.bin -m 32 -rtc base="1999-04-19" 
> -hda sunos414.img -net nic,model=lance -net 
> user,hostfwd=tcp::4422-:22,hostfwd=tcp::4423-:23
>
>
> following the recommendation here: 
> https://stackoverflow.com/questions/53315086/transferring-file-to-virtual-machine-qemu-using-tcp-port-2222-not-working
>
> But when the guest starts, I can't access my LAN (192.168.0.x).
>
> sunss5 login: root
> Apr 18 19:09:07 sunss5 login: ROOT LOGIN console
> Last login: Sun Apr 18 19:00:45 on console
> SunOS Release 4.1.4 (GENERIC) #2: Fri Oct 14 11:09:47 PDT 1994
> sunss5# ping 192.168.0.1
> ^Csunss5# ping 10.0.2.2
> 10.0.2.2 is alive
> sunss5# ping 192.168.0.2

Ping does not work with user-mode networking; don't try to use
it to see whether networking works or not, because it will
mislead you.

> The funny thing is that if I start ftp to a machine on the LAN, it will 
> connect OK but I can't transfer any files (it just hangs when I do a PUT).
>
> sunss5# ftp 192.168.0.78
> Connected to 192.168.0.78.
> 220 avon FTP server ready.
> Name (192.168.0.78:root):
> ...

ftp is a weird protocol that by default requires the
server to connect back to the client. This will not work
via user-mode networking, because the outside world
can't connect into the guest (unless you set up specific
port-forwarding). In theory PASV mode ought to work
(but see below).

You can see that the guest has successfully connected
because it's received the 220 response string back,
so networking is basically functional.

> Or even ftp to the ubuntu host doesn't work
>
> sunss5# ftp
> ftp> op
> (to) 10.0.2.2
> Connected to 10.0.2.2.
> 220 (vsFTPd 3.0.3)
> Name (10.0.2.2:root): ftpuser
> 331 Please specify the password.
> Password:
> 230 Login successful.
> ftp> bin
> 200 Switching to Binary mode.
> ftp> put
> (local-file) libsuntool.so.0.54
> (remote-file) libsuntool.so.0.54
> 500 Illegal PORT command.
> 425 Use PORT or PASV first.
> ftp> quote PASV
> 227 Entering Passive Mode (127,0,0,1,39,26).

I think here that PASV mode has failed because you're trying
to connect to an ftp server on the host machine. To the ftp
server, the guest in the VM looks like it's connecting
to localhost (127.0.0.1), so the server says "OK, the
data port you should use for PASV is 127.0.0.1:10010".
But when that gets back to the guest FTP client, it tries
to connect to 127.0.0.1 which is the guest VM's loopback.
PASV to some other host ought to work; PASV to the VM host's
actual IP address on 192.168.x.x (ie not to the 10.0.2.2
magic address that says "give me localhost on the host")
might work.

> What am I doing wrong here?

You've had the bad luck to pick two things (ping and ftp)
which are weird and complicated in ways that user-mode
networking can't handle. Try something simpler, like HTTP
or SSH. (You might also consider bridge-mode networking
if user-mode's deficiencies are deal-breakers for you,
but be aware that it is a lot more complicated to set up.)

thanks
-- PMM



reply via email to

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