Setting up a VirtualBox development instance with NAT port forwarding

I just spent another couple of hours figuring out how to effectively re-install my development instance (Ubuntu Server running in VirtualBox on my Windows host) and thought I’d write it down for personal reference and in case someone needs it :).

  1. Install VirtualBox (of course)
  2. Install Ubuntu Server
  3. Enable port forwarding from 127.0.0.1 to 10.0.2.15 on port 80
  4. Install guest additions
    1. sudo apt-get install dkms build-essentials
    2. mount guest additions
    3. sudo mount /dev/cdrom /media/cdrom
    4. cd media cdrom
    5. sudo ./VBoxLinuxAdditions.run
  5. Reboot
  6. You’re done ! You should now be able to access your linux guest by going to localhost on your host 🙂

Now you might want to set up folder sharing and map your local www folder to /var/www, but that is easy from here I guess :).

Note: do not forget to sudo adduser “youruser” vboxsf to enabled permissions on your shared folder!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s