Download
https://www.virtualbox.org/wiki/Downloads
Port Forwarding
Get Linux Guest IP address in terminal using:
ip addr show
You will get something like:
eth0: inet 10.0.2.15 (example)
- From VirtualBox Menu, go to Settings → Network
- Or if the VM is running, from the Toolbar Menu, go to Devices → Network → Network Settings
- Set Network Adapter to Attached to: NAT
- Click the Port Forwarding button
- Use the table below to find the correct IP and Port.
- You can now access the sever from your Host machine's web browser by visiting http://127.0.0.1:8888 or http://localhost:8888.
| Name | Protocol | Host IP | Host Port | Guest IP | Guest Port |
| HTTP | TCP | 127.0.0.1 | 8888 | 10.0.2.15 | 80 |
| SSH | TCP | 127.0.0.1 | 3022 | 10.0.2.15 | 22 |
| Django | TCP | 127.0.0.1 | 8000 | 10.0.2.15 | 8000 |
| Rails | TCP | 127.0.0.1 | 3000 | 10.0.2.15 | 3000 |
| webpy | TCP | 127.0.0.1 | 8080 | 10.0.2.15 | 8080 |
Website Setup
Apache Example
<VirtualHost *:80>
ServerAdmin webmaster@example.com
ServerName 127.0.0.1:8888
DocumentRoot /var/www/example/public/
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
ErrorLog /var/www/example/logs/error.log
CustomLog /var/www/example/logs/access.log combined
</VirtualHost>
Nginx Example
server {
listen 80;
server_name 127.0.0.1:8888;
root /var/www/example/public;
index index.html index.htm index.php;
access_log /var/log/nginx/localhost.access_log;
error_log /var/log/nginx/localhost.error_log info;
}
Multiple Sites
FTP
| Host: | 127.0.0.1 |
| Port: | 3022 |
| Protocol: | SFTP |
| Logon Type: | Normal |