1

I recently installed centos7 onto virtualbox. I enabled bridged networking on adapter 1 (enp0s3) on the virtualbox manager, to bridge my wireless adapter on the host.

When I type ifconfig on the guest (the VM), I can't see any ip address, and can't access the internet.

ifconfig

Later, I changed the bridged adapter to adapter 3 and then I see an ip address under enp0s3. What gives?

Can someone explain to be the difference between choosing Adapter #'s 1,2,3, and 4? Also, is enp0s3 the adapter I should use? or the third one, virbr0 (not sure what this is)? My guess is the loopback adapter isn't right.

1
  • Depending on how much magic VirtualBox performs, bridging to a wireless adapter is not possible, because it’s a point-to-point connection that doesn’t expect a network on the client end.
    – Daniel B
    Jul 12, 2016 at 11:32

3 Answers 3

1

After udev-200, the naming convention of interfaces no longer follows the kernel naming convention. Hence, eth0 no longer exists and something like enp0s3 is the new naming convention. Now the name differ depending on where the ethernet card is on the board.

There is no difference between the adapter number, but there might be a difference if the Attached to is different. Make sure you are using the correct form of attachment to your Host.

virbr0 is a virtual network interface that is used to connect the Host to the Guest in a virtualized environment. You don't really have to worry about it now.

The loopback adapter looks fine.

2
  • if adapter 1,2,3,4 does not matter, how does VirtualBox know which adapter on the VM side to bridge? e.g. enp0s3 vs. virbr0.
    – barrrista
    Dec 31, 2014 at 1:18
  • Virbr0 will not work unless it is configured to but enp0s3 might differ if you change adapter. Forget about virbr0.
    – Digisec
    Dec 31, 2014 at 1:20
0

You want to use the enp0s3 adapter. Edit/create /etc/sysconfig/network-scripts/ifcfg-enp0s3 as root and you can set an IP, DNS gateway, set on boot and other options. Then reboot and you should have internet. You also want to run echo "<IP of DNS server>" >> /etc/resolv.conf to set a DNS server if it isn't specified in ifcfg-enp0s3.

You can use this as a template: https://gist.github.com/fernandoaleman/2172388

The part of the UUID, use uuidgen enp0s3 and copy the output and use it for the ifcfg-enp0s3.

4
  • Actually, before you continue with my answer, how are your network adapters set up in the vm settings?
    – xR34P3Rx
    Dec 29, 2014 at 6:41
  • This will only work if your enp0s3 is bridged to your external network.
    – xR34P3Rx
    Dec 29, 2014 at 6:44
  • Right now it is on VirtualBox: Adapter 2, Bridged Adapter, Wireless LAN PCI (the right one I use on my host), Deny promiscuous mode, and cable connected.
    – barrrista
    Dec 29, 2014 at 6:47
  • Nah, just edit the IP, DNS1, GATEWAY, subnet mask. That should get you online.
    – xR34P3Rx
    Dec 29, 2014 at 6:53
0

Just run this command, it should fix the issue.

nmcli connection up enp0s3

1
  • 2
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 28, 2023 at 6:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .