In Host-only networking mode, VirtualBox creates a virtual network interface called Host-only Ethernet Adapter on the host system. It is particularly useful when VMs not only want to talk to each other, but to the host system, too. Also, the traffic going through such an interface can be intercepted by binding a packet sniffer like Wireshark. Unlike other modes of networking supported, a static or dynamic IP can be set to this adapter.
A bug I stumbled upon in VirtualBox v4.3.20 running on Windows 7 Ultimate x64 is the IP of a freshly created host-only adapter getting reset every time it is configured manually. Surprisingly, I did not experience this bug on Windows 8.1 Enterprise x64 running the same version of VirtualBox. After quick googling, I discovered that bug#8796 and bug#11155 have already been reported. The video records the bug and the solution to it.
You can bind a static IP to the interface from Oracle VM VirtualBox Manager UI => File => Preferences => Network => Host-only Networks tab => Select the adapter => Click on the third button (Edit) on the right sidebar. Here, what you can see is, I have tried setting the IP 192.168.56.1 and netmask 255.255.255.0 to the host-only adapter several times. Every time I confirmed the IP-netmask pair by clicking ‘OK’ twice. Immediately after, when I reopened same dialog box, the IP and netmask get set to some random value.
To solve this issue, you need to set the adapter to obtain its IP address dynamically.
Navigate to Windows 7 Start Menu => Network => Network and Sharing Center => Change Adapter Settings => Right click on the host-only adapter interface => Properties => Select ‘Internet Protocol Version 4 (TCP/IPv4)’ => Click on ‘Properties’ button => Select ‘Obtain IP address dynamically’ radio button => Click ‘OK’. Now, you can set the IP-netmask of the adapter from inside VirtualBox and it won’t get reset any more.