Setting up a NATed VirtualBox FTP and Webserver with ProFTPD

A few quick steps to setting up a NATed VirtualBox FTP and Webserver for development. I’m going to assume you’re using some variant of linux.

  1. Install ProFTPD – for debian this would be apt-get install proftpd
  2. Add a user using the useradd command. Ex: useradd username -p password -d /apps -s /bin/false
  3. Edit the following lines in /etc/proftpd/proftpd.conf
    PassivePorts                  65532 65534 #Change the range as necessary, but keep it small
    RequireValidShell               off #If you disabled their shell using the command above make sure this is set to off, this is important for PASV
    MasqueradeAddress               127.0.0.1 #Or whatever address you have set for your guest IP, this is important for PASV
  4. Restart your ProFTPD server /etc/init.d/proftpd restart
  5. In VirtualBox go to Devices->Network Adapters and click on port forwarding and create the following rules:
    Name,Protocol,HostIP,Host Port,Guest IP,Guest Port
    ftp,,21,,21
    ftpdata1,,65532,,65532
    ftpdata2,,65533,,65534
    ftpdata3,,65534,,65534
    web,,80,,80

That’s it! You should be able to connect to the guest webserver and ftp server. Make sure you check PASV for your FTP client.

5 Replies to “Setting up a NATed VirtualBox FTP and Webserver with ProFTPD”

Leave a Reply

Your email address will not be published. Required fields are marked *