VirtualBox CentOs 7 Bridge Network over Wi-Fi on Mac Os

Recently I wanted to create a Centos 7 Virtual machine on my Macbook Air (OS El Capitain – 10.11.3), as usual I downloaded an Iso from the net (The minimal Centos 7 Iso Installation).

And as I will want to access my Virtual machine from other computers I wanted to bridge the network.

But I don’t know why I can’t retrieve an IP address from my DHCP Server, so I defined a static IP Address and the network worked fine.

Define the Bridge Adapter in Virtual Box

First in the configuration of the virtual machine on VirtualBox, I attached a network card bridged on the Wi-Fi (en0: Wi-Fi (Airport)).

virtualbox_centos_7_networking_over_wifi_1.png Figure 1. VirtualBox Network Configuration

Define Static Ip Address in Centos 7

First you need to find the name of the interface bridged, so in the virtual machine simply execute the command :

ip a

You should obtain something like this :

1: lo:  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP qlen 1000 <1>
  1. The name enp0s3 is what we are looking for.

So now you can edit the file : /etc/sysconfig/network-scripts/ifcfg-enp0s3


BOOTPROTO="static" <1>
ONBOOT="yes" <4>
  1. static mean that you want to set the Ip address manually
  2. This is the IP Address you want for your virtual machine, in my case it is :
  3. The netmask depends on your network setting, usually you can set the same of your host computer
  4. Be sure to have the ONBOOT option set to yes for starting the network on virtual machine boot.

And finally you need to active the network by editing the file :


# Created by anaconda
  1. The IP address of the gateway depends on your network configuration.

And now you can restart the network :

Or reboot your virtual machine.

And Test ping pinging some ip ( / domain names : (

And now you can access to your virtual machine.

I don’t know why i can’t obtain an IP address from my DHCP using bridged networking on Wi-Fi, but the Static IP is a satisfying workaround for me.

Vous aimerez aussi...

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *