# kernel config for bridged adapter of virtualbox

## waterloo2005

In order to use bridged adapter of virtualbox 4.2.6 , how to config kernel ?

I upload my kernel config.

Now I can not use bridged adapter function of virtualbox.

I think the matter is about kernel config.

http://dpaste.de/1EOJz/

Thanks

----------

## DawgG

 *Quote:*   

> I think the matter is about kernel config.
> 
> http://dpaste.de/1EOJz/

 

i didn't to read thru your whole kernel-config but you need at least CONFIG_BRIDGE and CONFIG_TUN.

also i think it's necessary to install net-misc/bridge-utils.

GOOD LUCK!

----------

## Veldrin

I could be wrong, but IIRC there is no special config necessary for bridging - everything should be handled by vbox-net (or so) module. 

The config itself is handled by the virtualbox gui - just change the network adapter settings.

V.

----------

## waterloo2005

Some wiki says we do not need CONFIG_BRIDGE and CONFIG_TUN for vbox>=2.1.

My now version is 4.2.6.

I also try enable CONFIG_BRIDGE and CONFIG_TUN and install bridge-utils . But I still can not use bridged adapter .

In ubuntu12.04, I can use bridged adapter in network config .

I think if there are other kernel settings I ignore .

But I see the official manual , with no finding about other kernel config.

Thanks

----------

## kurly

The problem is that Virtualbox has a hard-coded path to /sbin/ifconfig but that program is no longer available there.  As a workaround, you could symlink /bin/ifconfig back to /sbin/ifconfig.  Alternately, file a bug and request that it be fixed properly.  Please note that placing a symlink is only a workaround, not a real fix to the problem, and you should only do that if you will remember to remove the symlink when the problem is fixed.

If you do not understand how to do the workaround or if you have any doubts, please just file a bug and be patient.   :Smile:  It is considered poor practice to manually modify things in /sbin, which is why I label this as a workaround and not a fix.

----------

## waterloo2005

 *kurly wrote:*   

> The problem is that Virtualbox has a hard-coded path to /sbin/ifconfig but that program is no longer available there.  As a workaround, you could symlink /bin/ifconfig back to /sbin/ifconfig.  Alternately, file a bug and request that it be fixed properly.  Please note that placing a symlink is only a workaround, not a real fix to the problem, and you should only do that if you will remember to remove the symlink when the problem is fixed.
> 
> If you do not understand how to do the workaround or if you have any doubts, please just file a bug and be patient.   It is considered poor practice to manually modify things in /sbin, which is why I label this as a workaround and not a fix.

 

I run sudo ln -s /bin/ifconfig /sbin/ifconfig , but the problem still exists.

Do I need CONFIG_BRIDGE and CONFIG_TUN and bridge-utils ?

Thanks

----------

## kurly

 *waterloo2005 wrote:*   

>  *kurly wrote:*   The problem is that Virtualbox has a hard-coded path to /sbin/ifconfig but that program is no longer available there.  As a workaround, you could symlink /bin/ifconfig back to /sbin/ifconfig.  Alternately, file a bug and request that it be fixed properly.  Please note that placing a symlink is only a workaround, not a real fix to the problem, and you should only do that if you will remember to remove the symlink when the problem is fixed.
> 
> If you do not understand how to do the workaround or if you have any doubts, please just file a bug and be patient.   It is considered poor practice to manually modify things in /sbin, which is why I label this as a workaround and not a fix. 
> 
> I run sudo ln -s /bin/ifconfig /sbin/ifconfig , but the problem still exists.
> ...

 

I do not have those.  Are you sure that the vboxdrv, vboxnetadp, and vboxnetflt modules are loaded?

----------

## waterloo2005

 *kurly wrote:*   

>  *waterloo2005 wrote:*    *kurly wrote:*   The problem is that Virtualbox has a hard-coded path to /sbin/ifconfig but that program is no longer available there.  As a workaround, you could symlink /bin/ifconfig back to /sbin/ifconfig.  Alternately, file a bug and request that it be fixed properly.  Please note that placing a symlink is only a workaround, not a real fix to the problem, and you should only do that if you will remember to remove the symlink when the problem is fixed.
> 
> If you do not understand how to do the workaround or if you have any doubts, please just file a bug and be patient.   It is considered poor practice to manually modify things in /sbin, which is why I label this as a workaround and not a fix. 
> 
> I run sudo ln -s /bin/ifconfig /sbin/ifconfig , but the problem still exists.
> ...

 

I have loaded the 3 modules and run sudo ln -s /bin/ifconfig /sbin/ifconfig, the problem still exists.

```
$ lsmod

Module                  Size  Used by

vboxnetadp             17703  0 

vboxnetflt             15699  1 

vboxdrv              1810981  3 vboxnetadp,vboxnetflt

uvcvideo               72132  0 

videobuf2_vmalloc       2677  1 uvcvideo

ath9k_htc              55999  0 

videobuf2_memops        2651  1 videobuf2_vmalloc

videobuf2_core         23196  1 uvcvideo

videodev               96117  2 uvcvideo,videobuf2_core

nvidia               9094010  0 

lpc_ich                10677  0 

ath9k_common            1889  1 ath9k_htc

ath9k_hw              326156  2 ath9k_common,ath9k_htc

ath                    15514  3 ath9k_common,ath9k_htc,ath9k_hw

```

----------

## cwr

As far as I know, CONFIG_BRIDGE isn't needed, although I have it enabled in my kernel

CONFIG_TUN definitely isn't needed, and nor are bridge-utils.

Will

----------

## waterloo2005

 *cwr wrote:*   

> As far as I know, CONFIG_BRIDGE isn't needed, although I have it enabled in my kernel
> 
> CONFIG_TUN definitely isn't needed, and nor are bridge-utils.
> 
> Will

 

So strange. 

I also cancel CONFIG_BRIDGE and CONFIG_TUN support, and do not install bridge-utils.

Why bridged adapter can not work in my machine ?

Thanks

----------

## bbgermany

Hi,

for bridgeing a tun/tap interface you need a tap interface. For creating a tapinterface, you need the following package installed:

```
* sys-apps/usermode-utilities

     Available versions:  *20070815-r3 {{fuse}}

     Homepage:            http://user-mode-linux.sourceforge.net/

     Description:         Tools for use with Usermode Linux virtual machines
```

this will install the tunctl command. For the bridge you need the following package

```
* net-misc/bridge-utils

     Available versions:  *1.2 ~1.4 ~1.5

     Homepage:            http://bridge.sourceforge.net/

     Description:         Tools for configuring the Linux kernel 802.1d Ethernet Bridge
```

both together will help you create a working bridge with a tun/tap interface. If you need further help for creating a bridge in /etc/conf.d/net, just ask.

greets, bb

----------

## waterloo2005

 *bbgermany wrote:*   

> Hi,
> 
> for bridgeing a tun/tap interface you need a tap interface. For creating a tapinterface, you need the following package installed:
> 
> ```
> ...

 

I also try what you said . But the problem still exists.

Now I have tried all method above(including ln -s /bin/ifconfig /sbin/ifconfig) , the problem still exists.

Thanks

----------

## bbgermany

Can you post the output of "ls -la /dev/net/*" I think you dont have the correct permission set for the tun/tap devices. Also which user do you use for trying to access the "bridge".

greets, bb

----------

## cwr

Be aware that you don't need TUN/TAP for VirtualBox.  I'm not sure that you even

need the kernel CONFIG_BRIDGE, and you certainly don't need bridge-utils,

although you used to a few years ago. VirtualBox does it all itself, these days.

Emerge virtualbox[ and virtualbox modules and add:

```

# VirtualBox 4.1.22 modules.

modules="vboxdrv vboxnetadp vboxnetflt vboxpci"

```

to /etc/conf.d/modules and you should be good to  go.

Will

(You will need to re-emerge virtualbox-modules if you rebuild the kernel.)

----------

## waterloo2005

 *bbgermany wrote:*   

> Can you post the output of "ls -la /dev/net/*" I think you dont have the correct permission set for the tun/tap devices. Also which user do you use for trying to access the "bridge".
> 
> greets, bb

 

```
$ ls -la /dev/net/*

crw-rw-rw- 1 root root 10, 200 Feb  2  2013 /dev/net/tun
```

I use a ordinary user to run vbox.

If I cancel CONFIG_TUN in kernel config, I find no /dev/net/tun.

Thanks

----------

## bbgermany

 *waterloo2005 wrote:*   

> 
> 
> ```
> $ ls -la /dev/net/*
> 
> ...

 

As you can see, you dont have permissions to access the tun device. thats why you need the usermode-utilities. This provides the tunctl tool for changeing permissions while creating the necessary devices. Check this wiki entry for the netconfig:

http://en.gentoo-wiki.com/wiki/KVM#Preparations

There you will find a bridge config with the correct settings for creating you tap devices although its for KVM instead of vbox.

greets bb

----------

## waterloo2005

Today I update my kernel to gentoo-sources 3.7.10 .

Now every time I run xp guest in vbox, it says : finding an ethernet controller .

I open network connection in xp guest , there is nothing .

Because I can not connect internet in xp guest , so I can not install the ethernet controller driver .

What is the matter ?

Thanks

----------

## waterloo2005

I also try use kernel config of ubuntu12.04, that makes bridged adapter network config in vbox work.

But I do not how to find that critical item in kernel config.

----------

