Skip to content

Instantly share code, notes, and snippets.

@cuibonobo
Created July 23, 2015 15:55
Show Gist options
  • Select an option

  • Save cuibonobo/b2d9a4c78e22fccc256a to your computer and use it in GitHub Desktop.

Select an option

Save cuibonobo/b2d9a4c78e22fccc256a to your computer and use it in GitHub Desktop.
Ping a VirtualBox Windows guest from the host.

Much help from here: http://serverfault.com/questions/225155/virtualbox-how-to-set-up-networking-so-both-host-and-guest-can-access-internet

  1. Set up your VM guest with 2 network cards: * First card set to NAT: this will connect the VM to the internet * Second card set to Host-only: this will connect the VM to the host
  2. Set the IPv4 address of the host-only network to 192.168.56.1 and its network mask to 255.255.255.0
  3. Boot up the VM and set the second network card to a static IP address: * IP address: 192.168.56.56 * Subnet mask: 255.255.255.0 * Default gateway: 192.168.56.1 * Set the DNS servers to whatever the host is using
  4. From the Control Panel, select Windows Firewall and then Advanced Settings. In the Windows Firewall with Advanced Securitywindow: * In the left column, selectInbound Rules * In the right column, selectNew Rule... * In theNew Inbound Rule Wizard` window:
    • Select the Custom radio button. Click Next.
    • Leave the default All programs radio button. Click Next.
    • Leave the default Protocol type as Any. Click Next.
    • Under Which local IP address does this rule apply to?, select These IP addresses and add 192.168.56.56. Under Which remote IP addresses does this rule apply to?, select These IP addresses and add 192.168.56.1. Click Next.
    • Leave the default Allow the connection radio button. Click Next.
    • Leave all default Domain, Private, and Public checkboxes checked. Click Next.
    • Enter Allow VM Host in the Name input box. Click Finish.

You should now be able to ping your Windows VM at 192.168.56.56.

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