Environment:
- Virtualbox 5.1.10
- CentOS 7.4.1708
Before start with the installation, in Virtualbox you have to configure two network adapters:
- Adapter 1: Host only
- Adapter 2: NAT
When CentOS starts for first time, you will already had internet access. But local network will be disabled. Execute the following command to check your network interfaces:
ip add
The result will be something like this:
Here you can see three interfaces:
- lo: Loopback
- enp0s3: Host-Only adapter
- enp0s8: NAT adapter
If you have doubts about which is the host-only, you can check the MAC address and compare it with the Virtualbox adapter.
Once you are sure enp0s3 is your interface, go to /etc/sysconfig/network-scripts/ and edit ifcfg-enp0s3 file, for example with vi. You will have to make two changes:
- Set BOOTPROTO=none
- Set ONBOOT=yes
- Add IPADDR=your IP
systemctl restart network.service
Now you will have your interface up and with the IP address you set before.
Note
As stated in my previous post, remember to configure proxy settings for system and yum configuration:System config
Edit ~/.bash_profile file and add the following lines:
# The Web proxy server used by this account
http_proxy="http://usuario:password@my.proxy:8080"
export no_proxy=localhost,127.0.0.1
export http_proxy
YUM config
Edit /etc/yum.conf y add the following lines:
# The proxy server - proxy server:port number
proxy=http://my.proxy:8080
# The account details for yum connections
proxy_username=usuario
proxy_password=password