Skip to content

Instantly share code, notes, and snippets.

@AlanJui
Created September 5, 2015 13:33
Show Gist options
  • Select an option

  • Save AlanJui/5481ee5017e904dd5b62 to your computer and use it in GitHub Desktop.

Select an option

Save AlanJui/5481ee5017e904dd5b62 to your computer and use it in GitHub Desktop.

My environment:

enter image description here

  • Host
  • Mac OS X 10.10.5
  • Network: 192.168.99.0/24
  • IP: 192.168.99.110 (Static IP)
  • IP for Host communicate to guest: 192.168.56.99
  • Guest(VM)
  • Ubuntu 14.04
  • IP for Host communicate: 192.168.56.100
  • ssh has been installed
  • VirtualBox: 5.0.3 R102467

Procedure for Setup:

  1. Create a Host-only Adapter by VBoxManage by Terminal.

    enter image description here

  2. Configure IP for Host-only Adapter.

    enter image description here

  3. Check and confirm the IP for Host-only Adapter.

    enter image description here

  4. Setup guest(VM) using 2 network adapters on VirtualBox.

    enter image description here

    enter image description here

  5. Configure the networking on Guest by editing /etc/network/interfaces.

    sudoedit /etc/network/interfaces

    enter image description here

    enter image description here

  6. Reboot Guest(VM).

Verify

  1. NAT(eth0) can access Internet.

    Browsing web page on Guest(VM).

    enter image description here

  2. Host can access Guest

Open terminal on Host and enter command to connect to Guest(VM) by ssh.

enter image description here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment