Saturday, June 8, 2013

When VirtualBox keeps re-setting your Windows 7 host-only networking IP address to the autoconfiguration address

I've had this problem intermittently over the life of my VirtualBox installation, and others have reported it too.

Basically, on every host reboot Windows 7 would re-set the IP address of my host-only network interface to the autoconfiguration address, which caused virtual hosts to be unable to see it (and unable to get their own host-only IP address, which, at least on FreeBSD guests, basically caused a very long pause during the boot process, perhaps because I was also mounting host directories on the guest machines).

Solutions people have proposed for this are all over the map, so my solution may not work for everyone.

For me, I came up with an easy fix that worked.

VBoxManage list hostonlyifs
to get the name of the host-only network interface.

VBoxManage hostonlyif delete <name>
to delete that interface

VBoxManage hostonlyif create
to create a new one

VBoxManage list hostonlyifs
to get the name of the new network interface

VBoxManage hostonlyif ipconfig <name> --ip <ip>
to set the IP address to the address I wanted.

Now it works. I hope it's this easy for you!