Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kernel config for bridged adapter of 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
waterloo2005
Apprentice
Apprentice


Joined: 26 Aug 2008
Posts: 248

PostPosted: Tue Jan 29, 2013 7:34 am    Post subject: kernel config for bridged adapter of virtualbox Reply with quote

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
_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs


Last edited by waterloo2005 on Wed Jan 30, 2013 1:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
DawgG
Guru
Guru


Joined: 17 Sep 2003
Posts: 596

PostPosted: Tue Jan 29, 2013 9:42 am    Post subject: Reply with quote

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!
_________________
DUMM KLICKT GUT.
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1942
Location: Zurich, Switzerland

PostPosted: Tue Jan 29, 2013 11:20 am    Post subject: Reply with quote

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.
_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
waterloo2005
Apprentice
Apprentice


Joined: 26 Aug 2008
Posts: 248

PostPosted: Tue Jan 29, 2013 4:56 pm    Post subject: Reply with quote

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
_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs
Back to top
View user's profile Send private message
kurly
Apprentice
Apprentice


Joined: 02 Apr 2012
Posts: 170

PostPosted: Wed Jan 30, 2013 1:08 am    Post subject: Reply with quote

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


Joined: 26 Aug 2008
Posts: 248

PostPosted: Wed Jan 30, 2013 4:34 am    Post subject: Reply with quote

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
_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs
Back to top
View user's profile Send private message
kurly
Apprentice
Apprentice


Joined: 02 Apr 2012
Posts: 170

PostPosted: Wed Jan 30, 2013 7:29 am    Post subject: Reply with quote

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.
Do I need CONFIG_BRIDGE and CONFIG_TUN and bridge-utils ?
Thanks

I do not have those. Are you sure that the vboxdrv, vboxnetadp, and vboxnetflt modules are loaded?
Back to top
View user's profile Send private message
waterloo2005
Apprentice
Apprentice


Joined: 26 Aug 2008
Posts: 248

PostPosted: Wed Jan 30, 2013 11:54 am    Post subject: Reply with quote

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.
Do I need CONFIG_BRIDGE and CONFIG_TUN and bridge-utils ?
Thanks

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

I have loaded the 3 modules and run sudo ln -s /bin/ifconfig /sbin/ifconfig, the problem still exists.
Code:
$ 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

_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1685

PostPosted: Wed Jan 30, 2013 1:04 pm    Post subject: Reply with quote

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


Joined: 26 Aug 2008
Posts: 248

PostPosted: Thu Jan 31, 2013 3:38 am    Post subject: Reply with quote

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
_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1479
Location: Oranienburg/Germany

PostPosted: Thu Jan 31, 2013 5:56 am    Post subject: Reply with quote

Hi,

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

Code:
* 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

Code:
* 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
_________________
1st: i5-4440 3.1GHz, 16GB, 1.7TB, HD4850
2nd: Celeron 2.6GHz, 2GB, 500GB, HD4350
3rd: TP X220, 2,5GHz, 8GB, 320GB, HD3000
4th: Athlon X2 BE-2300, 4GB, 64GB SSD + 3TB RAID5 GF7025
5th: Samung N350, 2GB, 250GB, HD3150
6th: Rasperry Pi, 512MB, 32GB SD
Back to top
View user's profile Send private message
waterloo2005
Apprentice
Apprentice


Joined: 26 Aug 2008
Posts: 248

PostPosted: Thu Jan 31, 2013 6:56 am    Post subject: Reply with quote

bbgermany wrote:
Hi,

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

Code:
* 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

Code:
* 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


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
_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1479
Location: Oranienburg/Germany

PostPosted: Fri Feb 01, 2013 7:37 am    Post subject: Reply with quote

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
_________________
1st: i5-4440 3.1GHz, 16GB, 1.7TB, HD4850
2nd: Celeron 2.6GHz, 2GB, 500GB, HD4350
3rd: TP X220, 2,5GHz, 8GB, 320GB, HD3000
4th: Athlon X2 BE-2300, 4GB, 64GB SSD + 3TB RAID5 GF7025
5th: Samung N350, 2GB, 250GB, HD3150
6th: Rasperry Pi, 512MB, 32GB SD
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1685

PostPosted: Fri Feb 01, 2013 11:50 am    Post subject: Reply with quote

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:
Code:

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


Joined: 26 Aug 2008
Posts: 248

PostPosted: Fri Feb 01, 2013 2:23 pm    Post subject: Reply with quote

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

Code:
$ 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
_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1479
Location: Oranienburg/Germany

PostPosted: Mon Feb 04, 2013 8:18 am    Post subject: Reply with quote

waterloo2005 wrote:

Code:
$ 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


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
_________________
1st: i5-4440 3.1GHz, 16GB, 1.7TB, HD4850
2nd: Celeron 2.6GHz, 2GB, 500GB, HD4350
3rd: TP X220, 2,5GHz, 8GB, 320GB, HD3000
4th: Athlon X2 BE-2300, 4GB, 64GB SSD + 3TB RAID5 GF7025
5th: Samung N350, 2GB, 250GB, HD3150
6th: Rasperry Pi, 512MB, 32GB SD
Back to top
View user's profile Send private message
waterloo2005
Apprentice
Apprentice


Joined: 26 Aug 2008
Posts: 248

PostPosted: Wed Mar 06, 2013 6:51 am    Post subject: Reply with quote

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
_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs
Back to top
View user's profile Send private message
waterloo2005
Apprentice
Apprentice


Joined: 26 Aug 2008
Posts: 248

PostPosted: Sat Mar 09, 2013 5:19 am    Post subject: Reply with quote

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.
_________________
i5-2450M, gnome, amd64
R,Mathematica,Emacs
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