Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed pure-ftpd in the Guest machine. I tried to connect to FTP server of Guest Machine from Guest Machine with the port number 21 and I could connect to it successfully.

In the host machine I have added following command in order to redirect host's port 2121 into guest's port 21 and connect to FTP Server of Guest Machine.

VBoxManage setextradata Ubuntu "VBoxInternal/Devices/e1000/0/LUN#0/Config/FTP/HostPort" 2121   
VBoxManage setextradata Ubuntu "VBoxInternal/Devices/e1000/0/LUN#0/Config/FTP/GuestPort" 21
VBoxManage setextradata Ubuntu "VBoxInternal/Devices/e1000/0/LUN#0/Config/FTP/Protocol" TCP

But once I tried to access this guest ftp server from Host Machine it asked me a password for the user I have in Guest machine and authentication passed successfully. But when it tried to list directories it showed me an error message saying following:

alt text

If you translate it into Enlgish, it will be following:

The folder contents could not be displayed.

Could not display the entire contents of "/ in localhost:2121": Can not open data connection. Maybe your firewall is blocking it?

How to solve the problem?

share|improve this question
Hmm... you might be able to solve it by using a SSH enabled FTP client. Once it burrows a SSH tunnel using your admin user (who has access to all files) then it can connect to the FTP service internally on the machine. The important point here is to use a user account with the proper permissions. – djangofan Dec 23 '10 at 23:15

FTP can be a tricky protocol. The control connection is (normally) set up on port. This connection is used for authentication and sending commands to the server. Data transfer happens on a different connection. Normally this is on port 20. What happens is that the client requests data from the server on port 21, then the server opens a connection back to the client on port 20 to transfer the data. This is where a firewall on the machine running the ftp client can get in the way (it may block the incoming connection from the ftp server).

FTP has a passive mode that is supposed to cause the ftp server to transfer data to the client over the control connection instead of opening a new connection for the data transfer. I think the command is PASV, but I have never tried it myself.

I hope this is helpful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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