VirtualBox

Ticket #430 (closed defect: fixed)

Opened 7 years ago

Last modified 4 years ago

Passive FTP to host via NAT networking broken => fixed in SVN

Reported by: freggy Owned by:
Priority: major Component: network/NAT
Version: VirtualBox 3.0.4 Keywords:
Cc: Guest type: other
Host type: other

Description

I have Virtualbox OSE 1.4.0 running on Mandriva Linux Cooker x86_64 (installed from Mandriva packages). In Virtualbox I have a Mandriva 2007.1 Spring i586 installation running. The virtual machine is connected via Virtualbox NAT: the host has address 10.0.2.0, the client 10.0.2.15.

I try to access an FTP server running on the host from the virtual machine. This fails with passive FTP, because the NAT engine returns 127.0.0.1 as the host address:

[root@localhost frederik]# wget  ftp://10.0.2.2/Mandriva/2007.1/i586/media/main/release --23:34:51--  ftp://10.0.2.2/Mandriva/2007.1/i586/media/main/release

=> `release'

Connecting to 10.0.2.2:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /Mandriva/2007.1/i586/media/main ... done. ==> PASV ... couldn't connect to 127.0.0.1 port 26318: Connection refused

A Wireshark capture confirms that the virtual machine received 127.0.0.1 port 26318 after the PSV command. So it seems the Virtualbox NAT engine screws up the FTP connection: actually in this case NAT probably should not even be needed as host and client are connected to the same network.

Change History

comment:1 Changed 7 years ago by freggy

Of course the host's IP is 10.0.2.2, not 10.0.2.0 like in the previous message...

comment:2 Changed 6 years ago by rmanus

Same issue with a Solaris host and WinXP guest running VBox 1.5.51.

comment:3 Changed 6 years ago by frank

  • Component changed from other to network

comment:4 Changed 5 years ago by haesbaert

Same behaviour using OS X as host system and an openBSD as guest, trying to connect to outside ftp server (ftp.openbsd.org), not using nat mode, using host network mode and os x nat. I believe is something to do with virtual box, since I used to use similiar configurations with QEMU and others.

comment:5 Changed 5 years ago by frank

  • Component changed from network to network/NAT

comment:6 Changed 5 years ago by lemketron

Looks like "outbound" (guest -> host) ftp (#2932) was fixed, but is there any update on getting INBOUND (host -> guest) FTP (this bug) fixed?

comment:7 follow-up: ↓ 8 Changed 5 years ago by lemketron

It's still happening with VirtualBox 3.0.2 r49928...

comment:8 in reply to: ↑ 7 Changed 5 years ago by Hachiman

Replying to lemketron:

It's still happening with VirtualBox 3.0.2 r49928...

Please attach your log.

comment:9 follow-up: ↓ 10 Changed 5 years ago by lemketron

Which log? Actually, I just realized I got the direction wrong -- the original bug was guest -> host, not inbound, which doesn't really work due to the inbound address not being fixed up by the NAT. However, I think I've found a solution that works for me... A minor patch to the guest ftp server with a configuration option to force-fix the inbound IP address when it doesn't match, and that might just solve it for my needs.

comment:10 in reply to: ↑ 9 Changed 5 years ago by Hachiman

Replying to lemketron:

Which log? Actually, I just realized I got the direction wrong -- the original bug was guest -> host, not inbound, which doesn't really work due to the inbound address not being fixed up by the NAT. However, I think I've found a solution that works for me... A minor patch to the guest ftp server with a configuration option to force-fix the inbound IP address when it doesn't match, and that might just solve it for my needs.

Log of your VM. The problem was introduced in 3.0 branch and already has been fixed in svn. I need information about your host to offer test build .

comment:11 follow-up: ↓ 12 Changed 5 years ago by aargh

I see the same issue. Running the latest stable virtualbox build - 3.0.2.

Win XP 32 bit host Ubuntu 9.0.4 32 bit guest

I can login to an ftp site but can't do a file listing. The command/connection times out after a while. This used to work fine pre VitualBox 3.x.

comment:12 in reply to: ↑ 11 Changed 5 years ago by Hachiman

Replying to aargh:

I see the same issue. Running the latest stable virtualbox build - 3.0.2.

Win XP 32 bit host Ubuntu 9.0.4 32 bit guest

I can login to an ftp site but can't do a file listing. The command/connection times out after a while. This used to work fine pre VitualBox 3.x.

Fixed in svn will be available in 3.0.4

comment:13 Changed 5 years ago by aargh

Excellent. Any release date?

comment:14 Changed 5 years ago by Hachiman

  • Summary changed from Passive FTP to host via NAT networking broken to Passive FTP to host via NAT networking broken => fixed in SVN

comment:15 Changed 5 years ago by Hachiman

  • Status changed from new to closed
  • Resolution set to fixed

comment:16 follow-up: ↓ 17 Changed 5 years ago by aargh

  • Status changed from closed to reopened
  • Resolution fixed deleted

Just installed 3.0.4 and I don't see it as fixed. Any way I can help you debug the problem?

comment:17 in reply to: ↑ 16 Changed 5 years ago by Hachiman

Replying to aargh:

Just installed 3.0.4 and I don't see it as fixed. Any way I can help you debug the problem?

Could you please attach your ftp log session here? usually ftp client command (debug 9) do the job.

comment:18 Changed 5 years ago by Hachiman

  • Version changed from VirtualBox 1.4.0 to VirtualBox 3.0.4

comment:19 follow-up: ↓ 21 Changed 5 years ago by aargh

Password:
---> PASS XXXX
230 User sra logged in, access restrictions apply.
---> SYST
215 UNIX Type: L8 Version: SVR4
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
ftp: setsockopt (ignored): Permission denied
---> PORT 10,0,2,15,156,11
200 PORT command successful.
---> LIST
425 Can't build data connection: Connection timed out.

comment:20 Changed 5 years ago by aargh

Sorry for the coredump above.. but this is what i did with ftp -d <site_address>. I'm able to login ok but fail to do a file listing or a ascii/binary transfer. The connection times out after a while.

comment:21 in reply to: ↑ 19 Changed 5 years ago by Hachiman

Replying to aargh:

> Password:
> ---> PASS XXXX
> 230 User sra logged in, access restrictions apply.
> ---> SYST
> 215 UNIX Type: L8 Version: SVR4
> Remote system type is UNIX.
> Using binary mode to transfer files.
> ftp> ls
> ftp: setsockopt (ignored): Permission denied
> ---> PORT 10,0,2,15,156,11
> 200 PORT command successful.
> ---> LIST
> 425 Can't build data connection: Connection timed out.

It isn't passive ftp it's active one.(please see #4427)

comment:22 Changed 5 years ago by Hachiman

  • Status changed from reopened to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use