Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VirtualBox and "Bridge-mode"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
sincorchetes
n00b
n00b


Joined: 21 Jan 2020
Posts: 11
Location: Spain

PostPosted: Tue Aug 25, 2020 11:14 pm    Post subject: VirtualBox and "Bridge-mode" Reply with quote

Hello all,

I want to use a VirtualBox machine with Bridge-mode enabled, I could used it over Windows and Fedora 33, but not with Gentoo. I followed this guide:
https://wiki.gentoo.org/wiki/VirtualBox#Advanced_networking-related

But I cannot use it.

Code:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp3s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
3: wlp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.129/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp4s0
       valid_lft 50389sec preferred_lft 50389sec
    inet6 fe80::9b85:3114:45d5:a8b/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
5: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff



My user forms part of vboxusers

Kernel modules are loaded:
Code:

vboxnetadp             28672  0
vboxnetflt             32768  0
vboxdrv               450560  2 vboxnetadp,vboxnetflt


If I launch a machine in this mode, I see messages in dmesg:
Code:

[36493.580180] SUPR0GipMap: fGetGipCpu=0x1b
[36494.822826] vboxdrv: 0000000006d213da VMMR0.r0
[36494.895848] VBoxNetFlt: attached to 'vboxnet0' / 0a:00:27:00:00:00
[36494.895857] IPv6: ADDRCONF(NETDEV_CHANGE): vboxnet0: link becomes ready
[36494.896093] device vboxnet0 entered promiscuous mode
[36494.906278] vboxdrv: 00000000423221a4 VBoxDDR0.r0
[36494.922632] vboxdrv: 000000001266d255 VBoxEhciR0.r0
[36494.923535] VMMR0InitVM: eflags=246 fKernelFeatures=0x0 (SUPKERNELFEATURES_SMAP=0)
[36509.162496] VBoxNetFlt: attached to 'wlp4s0' / XX:XX:XX:XX:XX:XX
[36509.165696] device wlp4s0 entered promiscuous mode


My kernel:
Code:

Linux shark 5.4.48-gentoo-x86_64 #1 SMP PREEMPT Wed Jul 8 16:50:16 CEST 2020 x86_64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz GenuineIntel GNU/Linux


My Virtualbox version: (I was tried with 5.2.40-r1, It does not work. So, I've installed 6.1.12a.
Currently I'm using Gentoo with OpenRC as service management.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3948

PostPosted: Tue Aug 25, 2020 11:26 pm    Post subject: Reply with quote

Hi
What do you mean bridge-mode?
Just create a VM and in network settings assign it "Bridged Adapter".
You do NOT have to do some crazy config for VBox like you do in KVM.
It works out of the Box?
Cliick on the Bridged Adapter and you will see a list of physical ifaces of the host.
If it doesnt work and you have no internet connectivity in the VM then it means that your kernel is missing iptables functionality.
Back to top
View user's profile Send private message
joanandk
Apprentice
Apprentice


Joined: 12 Feb 2017
Posts: 169

PostPosted: Wed Aug 26, 2020 3:58 am    Post subject: Reply with quote

Code:
[36509.162496] VBoxNetFlt: attached to 'wlp4s0' / XX:XX:XX:XX:XX:XX


Bridging wirelessLAN is not possible. You have to use NAT.

If you have any special reasons for bridge-mode, you can achieve it with port forwarding in NAT.

BR
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3948

PostPosted: Wed Aug 26, 2020 9:14 am    Post subject: Reply with quote

Quote:
Bridging wirelessLAN is not possible. You have to use NAT.

Yes I am also aware about bridging wifi in KVM,BUT virtualbox somehow does it.
I remember this was case in windows and also possibly linux.
I think VirtualBox CAN bridge wifi without any problem.
:D
Back to top
View user's profile Send private message
joanandk
Apprentice
Apprentice


Joined: 12 Feb 2017
Posts: 169

PostPosted: Wed Aug 26, 2020 11:12 am    Post subject: Reply with quote

alamahant wrote:
Quote:
Bridging wirelessLAN is not possible. You have to use NAT.

Yes I am also aware about bridging wifi in KVM,BUT virtualbox somehow does it.
I remember this was case in windows and also possibly linux.
I think VirtualBox CAN bridge wifi without any problem.
:D


I am not the expert, but I think if you are trying to create a wireless access point, then bridging is possible. If you have two clients on the wireless (real machine and VM(s)) then it could not work as each must have its own wpa_supplicant (or similar) to be able to en- and decrypt the traffic. If your are not using any security (which is not recommended), then the bridge might work.

Maybe someone other who is an expert in wireless can shine some light on the matter.

BR
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3948

PostPosted: Wed Aug 26, 2020 11:45 am    Post subject: Reply with quote

Quote:


alamahant wrote:
Quote:
Bridging wirelessLAN is not possible. You have to use NAT.

Yes I am also aware about bridging wifi in KVM,BUT virtualbox somehow does it.
I remember this was case in windows and also possibly linux.
I think VirtualBox CAN bridge wifi without any problem.
:D

I mean In Network->Bridged Adapter in VBox UI
use the wireless adapter.
Back to top
View user's profile Send private message
sincorchetes
n00b
n00b


Joined: 21 Jan 2020
Posts: 11
Location: Spain

PostPosted: Wed Aug 26, 2020 2:44 pm    Post subject: Reply with quote

alamahant wrote:
Hi
What do you mean bridge-mode?
Just create a VM and in network settings assign it "Bridged Adapter".
You do NOT have to do some crazy config for VBox like you do in KVM.
It works out of the Box?
Cliick on the Bridged Adapter and you will see a list of physical ifaces of the host.
If it doesnt work and you have no internet connectivity in the VM then it means that your kernel is missing iptables functionality.


Yes, It works in Windows and Fedora, but here It does not work.

https://i.postimg.cc/jj404xXN/vbox.png
Back to top
View user's profile Send private message
sincorchetes
n00b
n00b


Joined: 21 Jan 2020
Posts: 11
Location: Spain

PostPosted: Wed Aug 26, 2020 2:45 pm    Post subject: Reply with quote

joanandk wrote:
Code:
[36509.162496] VBoxNetFlt: attached to 'wlp4s0' / XX:XX:XX:XX:XX:XX


Bridging wirelessLAN is not possible. You have to use NAT.

If you have any special reasons for bridge-mode, you can achieve it with port forwarding in NAT.

BR



Why is not possible? I can use it in Windows and Fedora.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3948

PostPosted: Wed Aug 26, 2020 4:28 pm    Post subject: Reply with quote

Can you post same picture of VBOX UI but from Gentoo?
The one with Network->Bridged Adapter
In any case if it doesnt work in Gentoo i think your kernel .config is lacking flags.Maybe wireless drivers and/or iptables
:D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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