Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Host-only network in VirtualBox
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Spiros
Apprentice
Apprentice


Joined: 11 Mar 2008
Posts: 189
Location: Zurich

PostPosted: Wed Sep 19, 2012 8:45 pm    Post subject: Host-only network in VirtualBox Reply with quote

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
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 398
Location: San Diego, California USA

PostPosted: Wed Sep 19, 2012 11:48 pm    Post subject: Reply with quote

I don't see the VM network adapter show up until I actually start a VM.
Back to top
View user's profile Send private message
Spiros
Apprentice
Apprentice


Joined: 11 Mar 2008
Posts: 189
Location: Zurich

PostPosted: Thu Sep 20, 2012 7:38 am    Post subject: Reply with quote

gentoo_ram: then you can actually start a VM. I can't! I cannot even set up the machine to use the host-only adapter because VirtualBox does not find any.

EDIT: sorry, I was unclear. I CAN start VMs, but not with an host-only adapter.
_________________
Spiros
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 398
Location: San Diego, California USA

PostPosted: Thu Sep 20, 2012 7:58 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Spiros
Apprentice
Apprentice


Joined: 11 Mar 2008
Posts: 189
Location: Zurich

PostPosted: Sun Sep 23, 2012 3:10 pm    Post subject: Reply with quote

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:

Code:

$ dmesg | grep vbox
[    3.558991] vboxdrv: Found 8 processor cores.
[    3.559146] vboxdrv: fAsync=0 offMin=0x188 offMax=0x13ed1
[    3.559171] vboxdrv: TSC mode is 'synchronous', kernel timer mode is 'normal'.
[    3.559172] vboxdrv: Successfully loaded version 4.2.0 (interface 0x001a0004).
[ 2524.521446] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 2542.899274] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 2554.942854] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 2555.307155] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 2562.926773] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 2563.297208] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 3550.383563] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 3550.991374] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.752682] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.765078] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.790470] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.816026] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.841303] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.869864] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.896071] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.924615] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4101.950762] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4102.228122] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4102.257751] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4102.301566] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4102.327383] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4102.352570] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4102.378934] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4966.525184] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 4967.010218] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 5451.316850] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 5702.648679] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 6198.323816] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 6198.365012] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 6198.390657] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)
[ 6198.415984] Modules linked in: vboxnetadp(O) vboxnetflt(O) vboxdrv(O) hid_logitech_dj nvidia(PO)


My first guess was that something was not set up correctly in the kernel, but in this case the modules would say something, wouldn't they?


EDIT: I also have a laptop with a very similar configuration and the same problem: I cannot set up a Host-only adapter because there are no such adapters.
_________________
Spiros
Back to top
View user's profile Send private message
dreeh
n00b
n00b


Joined: 24 Mar 2006
Posts: 10
Location: Germany, Bavarian, Wolfratshausen

PostPosted: Sun Dec 16, 2012 2:01 pm    Post subject: Reply with quote

did someone found a solution?

my workaround for that issus is, to start the adapter by hand:
ifconfig vboxnet0 192.168.50.1 netmask 255.255.255.0 up

but this doesnt start automaticly. this was always working with an older version of virtualbox.
Back to top
View user's profile Send private message
Spiros
Apprentice
Apprentice


Joined: 11 Mar 2008
Posts: 189
Location: Zurich

PostPosted: Sun Dec 16, 2012 2:15 pm    Post subject: Reply with quote

I did not find a solution. I just checked and I don't have a vboxnet0 interface in ifconfig -a, even if the module vboxnetadp is loaded.
_________________
Spiros
Back to top
View user's profile Send private message
liucougar
n00b
n00b


Joined: 07 Nov 2010
Posts: 8

PostPosted: Tue Feb 05, 2013 7:04 am    Post subject: Reply with quote

here is a workaround:

http://forums.gentoo.org/viewtopic-t-943758-start-0.html
_________________
生于忧患,死于安乐
"People's characters are strengthened through struggle against difficulties; they are weakened by comfort."
- Old Chinese adage
Fly Together Forever
Back to top
View user's profile Send private message
Spiros
Apprentice
Apprentice


Joined: 11 Mar 2008
Posts: 189
Location: Zurich

PostPosted: Tue Feb 05, 2013 7:36 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum