VirtualBox Configuration for Static IP with Host-only network

Surya Prakash Pandey
4 min readJul 25, 2020

VirtualBox configuration:

Giving VMs Internal Network, Host PC and Internet Access. You can use a NAT networking adapter and Host-only networking adapter to allow VMs to communicate with each other, the Host PC and Internet.

Create Host-only network:

In the Host Network Manager pop-up click on “Create” for adding Host-only network adapter.

Fill the IP in IPV4 Address field that is going to be your default gateway for both the VMs.

In DHCP server tab you can keep “Enable Server” field unchecked for now.

Select and right click on one of the VMs as shown in screenshot below pop up will open. Go to the settings for adding the network adapters to your VMs(Keep both the machine shut down).

Keep Adapter1 tab setting as it is. In Adapter2 tab as shown in screen shot below:

· Check Enable Network Adapter

· Select Host-only Adapter

· Select previously created adapter name as in below “VirtualBox Host-only Ethernet Adapter #2”

Now start both the VMs.

Open Server Manager inside the Windows Server. Click on the Local Server tab.

As shown in below screen shot highlighted internet configuration is for Ethernet 2, we need to change this.

Right Click on Ethernet 2 and go to properties.

Uncheck IPv6 Internet Protocol version.

Select IPv4 and click on the Properties.

As per the IPv4 Properties pop up here you can see, we have filled Default Gateway as suggested earlier, in start while defining Adapter settings.

In IP address field 192.168.37.* is fixed at place of * you can fill anything between 2 to 255. Just make sure it doesn’t match with any IP related to this complete environment.

At Preferred DNS server place, we have filled Google DNS server address which is 8.8.8.8

Now in below screen shot at Server Manager home page as highlighted you will be able to see the IP as configured.

If you need access this IP from you local machine, you need to disable for Window firewall for this adapter. For disabling the Window firewall follow below steps,

Click on highlighted hyperlink

Now navigate to Advance settings in Windows Firewall as shown below,

Now go to Windows Firewall properties as shown is picture below,

Click to customize private network connections,

Uncheck the box for Ethernet 2, do the same for private and public profile.

Now after restarting the server, you must be able to ping your IP from local machine.

--

--

Surya Prakash Pandey

A problem solver, who sometimes blogs about how problem was solved.