I'd like to have a virtual machine connected to a host-only network. I have virtualbox-4.0.22 installed (but I also tried with virtualbox-bin-4.0.22).

The problem is that, even after loading vboxdrv, vboxnetadp and vboxnetflt, ifconfig -a does not show the virtual adapter and the virtual machine network settings page does not let me choose any host-only adapter.

Is it possible that my kernel configuration must be corrected? Or is somebody aware of a possible solution?_________________Spiros

Let's step back second. I think you have to set up the host-only adapters first. On the Virtualbox UI, go to File -> Preferences. Under there is a tab for "Network". On that tab is an icon to add an adapter. Click on that and configure the host-only adapter first.

After that's done, you should be able to select it on the VM configuration.

What I just described is how it works in VB 4.2.0. It's probably similar in older versions, the main preferences panel may look slightly different than what I described.

Does that help get you going?

I run my VMs all sharing the same host-only network. Then I set up iptables Internet sharing just like you would if sharing an internal LAN adapter. I like this set up better than bridging. Gives me more control over the network behavior. This method works well if you have a lot of experience messing with iptables rules.

Thanks for your accurate description, gentoo_ram! Unfortunately, this does not help.

Now I upgraded to virtualbox-4.2.0-r1 and I have the same behaviour. I explain it a bit more in detail.

I go into the configuraton of the machine and select the page "Network". Then, I select the adatpter 2 (the first one is still NAT and I let it so). I enable the adapter 2 and I select "Attached to:" "Host-only adapter". Now the box "Name" is active and the only option is "Not selected". The button "OK" is inactive and the warning box says "no host-only network adapter is selected". The snapshot shows this situation.

The modules vboxdrv, vboxnetadp and vboxnetflt are loaded correctly. dmesg does not list anything relevant:

Thanks for the link, liucougar. Unfortunately, I don't think this is my case, because I just do not have any vboxnet interface. In my opinion what I need is a kernel module. Anyway, I don't use VirtualBox anymore, so I can't test this workaround.

EDIT: I don't know how, I don't know why, I don't know when, but the problem just disappeared. Now I have working host-only networks. Thanks all._________________Spiros