I have installed Debian Squeeze on a Windows computer with Oracle Virtualbox. Then I've port forwarded port 21 on the NAT adapter.

In Debian I've run:

apt-get install proftpd

Then I uncommented the PassivePorts so I have the ports 49152 to 49155 available as passive ports. Then I uncommented MasqueradeAddress and set it to

Then after trying to Quick Connect in FileZilla I get:

Status: Connecting to
Status: Connection established, waiting for welcome message...
Response:   220 FTP Server ready.
Command:    USER webserver
Response:   331 Password required for webserver
Command:    PASS *
Response:   230 User webserver logged in
Command:    OPTS UTF8 ON
Response:   200 UTF8 set to on
Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is the current directory
Command:    TYPE I
Response:   200 Type set to I
Command:    PASV
Response:   227 Entering Passive Mode (127,0,0,1,192,3).
Command:    MLSD
Error:  Connection timed out
Error:  Failed to retrieve directory listing

How can this be fixed? It seems that it's something related to the VM, (running on the same machine right now), because all tutorials out there suppose it should work after just running the apt-get.

  • Uncomment PassivePorts from proftpd.conf, restart the server and retry. – Sacx Feb 12 '13 at 12:47
  • @Sacx I have already tried this, tried with MasqueradeAddress as well. I opened the defined ports in PassivePorts on the NAT adapter in the Virtualbox settings. – Student of Hogwarts Feb 12 '13 at 14:41
  • @MDMarra Can I ask why this was closed as off topic? – Student of Hogwarts Feb 19 '13 at 12:02

You will need to enable PassivePorst in your proftd.conf -

   PassivePorts      35000 40000

Enable the ip_conntrack_ftp module

   modprobe ip_conntrack_ftp 

In your firewall, all the ports related to ftp/passive ftp have to be opened -

 iptables -A INPUT  -p tcp --sport 21 -m state --state ESTABLISHED -j ACCEPT

 iptables -A OUTPUT -p tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT

 iptables -A INPUT -p tcp --sport 20 -m state --state ESTABLISHED,RELATED -j ACCEPT

 iptables -A OUTPUT -p tcp --dport 20 -m state --state ESTABLISHED -j ACCEPT

 iptables -A INPUT -p tcp --sport 1024: --dport 35000:40000  -m state --state ESTABLISHED -j ACCEPT

 iptables -A OUTPUT -p tcp --sport 1024: --dport 35000:40000  -m state --state ESTABLISHED,RELATED -j ACCEPT
  • Thank you very much for the reply! But it didn't work, unfortunately. Same output as always.. – Student of Hogwarts Feb 12 '13 at 16:14
  • why are you trying to access the Ubuntu vm using rather than its IP address? – Daniel t. Feb 12 '13 at 16:26
  • Okay, so I'm using Debian as the production server, and so I'm using Debian as the testing server. So on my WINDOWS computer, I have installed Debian on Virtualbox. I set the network adapter to NAT, and have port forwarded 80, 22, 21, 49152-49155. This way I can develop on my Windows computer and SSH into the Debian and upload the files via FTP just like it was an external server residing on it's own IP address. So when I connect to localhost:80, it will actually be redirected into the VM to Debian, same with 21 for FTP. – Student of Hogwarts Feb 12 '13 at 18:10
  • It turned out what you wrote is everything that should be needed. The problem was that the ports I forwarded and used (49152-49155) didn't work for some strange reason. I tried 5000 to 5003 instead, and it just magically worked. Maybe those ports were already in use, or else there has got to be something wrong with Oracle Virtualbox on these ports. Anyway, thanks for you time! I do really appreciate people like you trying to help, spending their time for others who have struggled without getting this to work! – Student of Hogwarts Feb 12 '13 at 18:20

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