Well, this solution only makes the connection disappear but does not address the issue: the connection is still considered as "Public" and therefore cannot be managed correctly with the windows firewall. I want to be able to have various services on my private network, yet not accessible from the internet. This method does not make it possible.kengaru wrote:This is well-known issue.
In Windows 7, Virtualbox Host-only adapter should have an *NdisDeviceType key set to 1 at registry. Logically, it should be set during installation of VirtualBox, but it's not. So you should go to registry and set it manually. Don't forget to disable/enable VB adapter after regedit.
Here is some more info: http://forums.virtualbox.org/viewtopic.php?f=9&t=27924
And here is even more info: http://www.brokenwire.net/bw/Various/12 ... -windows-7
It even opens a security hole in my case.
The correct solution is to make Windows recognize the connection, so that one can give it a private status (Home/Work). For some unknown design decision, it seems that Windows 7 is unable to "identify" a network if it does not have a gateway. It suffices to give one to the virtualbox network adapter and presto! the connection is identified and its status can be changed.
My setting is as follows:
1) In virtualbox -> Settings -> Network : one host-only adapter, *without* dhcp, of static IP address 192.168.56.1 and netmask 255.255.255.0
2) In guest, I have a debian system and the host-only adapter is eth0. the file /etc/network/interfaces configures the interface as follows:
auto eth0
iface eth0 inet static
address 192.168.56.100
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255
3) In host (Win7) : Control Panel -> Network and Internet -> Network Connections -> VirtualBox host only Network: right click -> properties. In the list, select "Internet Prtotocol Version 4", select "Properties" -> Now, you can add a gateway. It needs to be an existing address on the network. Here, I only have two: the guest and the host. For it to work, It has to be the address of the guest, so 192.168.56.100 in my case. Beware: it will not work if you choose the address of the host system 192.168.56.1... Click Ok, Ok, ... to close the various windows and go back to the "Network and Sharing Center": the connection is now identified.
Why cannot it be the address 192.168.56.1? Well, Windows is a bit sensitive and you cannot give an adapter the same address for its IP and its gateway. Otherwise, this makes a loop and you will end up with messed up routing tables. If you want to try, to put back everything to default, issue the command "route delete 0.0.0.0" as administrator in a shell. You will have to reconfigure your various adapters, though.
Note that your new gateway is not, and should not be connected to the internet (well, it can, but it should not "share" its connection with windows). Otherwise, this creates routing issues again. And a non-default, high measure should be added to the "IPv4" property in step 3.
Hope this helps,
-Benoit