Create simple CentOS 7 Virtualbox with Packer As a software tester you need many virtual machines, the creating can be very time consuming. Of course tools like Vagrant helps a lot but the creation for BaseBoxes starts most with installation from ISO`s. Exact here helps Packer! We provide documentation targeting both end-users and developers: The User Manual of the current VirtualBox release ( PDF version); End-user documentation.
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).
Sigma sport driver download. 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)).
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 :
You should obtain something like this :
The name enp0s3 is what we are looking for.
So now you can edit the file : /etc/sysconfig/network-scripts/ifcfg-enp0s3
/etc/sysconfig/network-scripts/ifcfg-enp0s3
- static mean that you want to set the Ip address manually
- This is the IP Address you want for your virtual machine, in my case it is : 192.168.1.211
- The netmask depends on your network setting, usually you can set the same of your host computer
- Be sure to have the ONBOOT option set to yes for starting the network on virtual machine boot.
Virtualbox
And finally you need to active the network by editing the file :
/etc/sysconfig/network
- 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 (192.168.1.1 / 8.8.8.8)/ domain names : (www.google.com).

Osx Virtualbox Centos 7
And now you can access to your virtual machine.
Install Virtualbox Centos 7 Server
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.
