View previous topic :: View next topic |
Author |
Message |
Nerevar l33t
Joined: 31 May 2008 Posts: 720
|
Posted: Sun Nov 22, 2009 6:12 pm Post subject: VirtualBox 3.0.12 and openrc bridged howto |
|
|
Here's how I got VirtualBox 3.0.12 working with openrc in manual bridged mode.
As noted below by cwr, there is also an "automatic" bridging method.
Linux Kernel:
Code: | Networking support --->
Networking options --->
<*> 802.1d Ethernet Bridging
Device Drivers --->
[*] Network device support --->
<*> Universal TUN/TAP device driver support |
Add to /etc/make.conf:
Code: | ACCEPT_LICENSE="PUEL" |
Emerge Virtualbox:
Code: | emerge -av virtualbox-bin |
Add user to vboxusers group
Code: | useradd -G vboxusers <username> |
Add to /etc/conf.d/modules:
Code: | modules="vboxdrv vboxnetadp vboxnetflt" |
Restart modules:
Code: | /etc/init.d/modules restart |
Emerge bridge-utils (for brctl) and usermode-utilities (for tunctl):
Code: | emerge -av bridge-utils usermode-utilities |
Stop network:
Code: | /etc/init.d/network stop |
Edit /etc/conf.d/network:
Code: | # Create bridge interface.
ifconfig_br0="<host ip address> netmask <host netmask>"
defaultroute="<host default route>"
ifup_br0="brctl addbr \$int; brctl setfd \$int 0; brctl addif \$int eth0; brctl addif \$int vboxnet0"
ifdown_br0="ifconfig \$int down; brctl delbr \$int"
# Add the tap to the bridge.
interfaces="tap0 br0"
ifup_tap0="tunctl -g vboxusers -t \$int"
ifdown_tap0="tunctl -d \$int"
# Setup host and client interfaces.
ifup_eth0="ifconfig \$int up"
ifdown_eth0="ifconfig \$int down"
ifup_vboxnet0="ifconfig \$int up"
ifdown_vboxnet0="ifconfig \$int down" |
Start network (reboot may be needed to clear current network interfaces):
Code: | /etc/init.d/network start |
Virtualbox Settings:
Code: | Machine -> Settings -> Network
Attached to: <Bridged Adapter>
Name: <br0> |
Virtualbox client network configured for static IP address on same subnet as host.
Last edited by Nerevar on Tue Dec 01, 2009 12:07 am; edited 1 time in total |
|
Back to top |
|
|
ursusca Apprentice
Joined: 10 Sep 2008 Posts: 284 Location: Toronto ON, CANADA
|
Posted: Mon Nov 23, 2009 8:00 pm Post subject: |
|
|
Thanks for sharing I am going to create my own network lab of Oracle 11gR2 RAC using VirtualBox on my Gentoo box. _________________ You deserve free software! |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Tue Nov 24, 2009 5:03 pm Post subject: |
|
|
Why do you need bridging? It used to be needed in VirtualBox < 2.1 (??),
but since then vboxnetflt seems to handle everything.
Will |
|
Back to top |
|
|
Nerevar l33t
Joined: 31 May 2008 Posts: 720
|
Posted: Tue Nov 24, 2009 6:53 pm Post subject: |
|
|
cwr wrote: | Why do you need bridging? It used to be needed in VirtualBox < 2.1 (??),
but since then vboxnetflt seems to handle everything.
Will |
I need bridging because I want the vbox client and host on the same network. The client will be running a server that is not available on linux.
As for the vboxnetflt module, I don't know anything about it other than google leads me to believe it's not included in a lot of distros.
If you have a link to how vboxnetflt works, please post it. |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Wed Nov 25, 2009 1:35 pm Post subject: |
|
|
Well, I run VirtualBox clients and host on the same network without problems;
dhcpd dishes out either static or dynamic addresses depending on the setup.
vboxnetflt is part of VirtualBox and is installed with it. I don't know exactly what
it does, but it came into use at the same time that VirtualBox no longer needed
explicit bridging.
Will |
|
Back to top |
|
|
Nerevar l33t
Joined: 31 May 2008 Posts: 720
|
Posted: Wed Nov 25, 2009 5:25 pm Post subject: |
|
|
That very interesting.
I tried changing the client's default class A private address network to my class C private address network before implementing the bridge manually. So, there must be something that you have to do to get the netflt module to "automatically" bridge. Maybe it's just a vbox network setting?
Can you tell me what your network settings are for your client?
You have a choice of "Not Attached", "NAT" (I'm sure this doesn't work for me), "Bridged Adapter" (what I'm using), "Internal Network" and "Host-only Adapter". Also, what network interface are you using? Just your typical eth0? |
|
Back to top |
|
|
agent_jdh Veteran
Joined: 08 Aug 2002 Posts: 1783 Location: Scotland
|
Posted: Wed Nov 25, 2009 5:44 pm Post subject: |
|
|
I switched to VirtualBox early in v3 and have never needed the additional bridging stuff e.g. kernel and userland tools - bridging 'just works' now with the vbox net module. _________________ Jingle Jangle Jewellery |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Thu Nov 26, 2009 11:26 am Post subject: |
|
|
I can't recall the VirtualBox virtual card I'm using - it's the default, whatever
that is. The VirtualBox connection is Bridged, and the net interface is eth0,
(which is the hardware connection on the host). That setup lets me connect
to eg: SMB filesystems exported from the host, networked printers controlled
by CUPS, and other machines on the local network. It all seems to be pretty
reliable.
Will |
|
Back to top |
|
|
Nerevar l33t
Joined: 31 May 2008 Posts: 720
|
Posted: Tue Dec 01, 2009 12:08 am Post subject: |
|
|
Thanks for the info cwr. I got it working that way as well. I don't have the time right now to do any benchmarking, but both ways "feel" the same speed wise. |
|
Back to top |
|
|
shinyspoongod n00b
Joined: 11 Jul 2010 Posts: 18
|
Posted: Sun Aug 29, 2010 8:48 pm Post subject: |
|
|
Nerevar wrote: | Thanks for the info cwr. I got it working that way as well. I don't have the time right now to do any benchmarking, but both ways "feel" the same speed wise. |
i know this is a little old to post in but this is just a confirm that with the vboxnetctl vboxnetadp modules running bridging directly via the virtualbox configs in major version 3 is working via selecting eth0 as the interface. just want to help save anybody whatever amount of trouble i have wasted. _________________ "Shiny" |
|
Back to top |
|
|
|