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.
- Install ProFTPD – for debian this would be apt-get install proftpd
- Add a user using the useradd command. Ex: useradd username -p password -d /apps -s /bin/false
- 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
- Restart your ProFTPD server /etc/init.d/proftpd restart
- 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
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.