VirtualBox with Centos 7 minimal install, cannot connect to network

I just installed Centos 7 on a VM I'm running from VirtualBox on a windows machine.

I installed the latest minimal release. I then went about setting up a static IP. When I try to access the machine I cannot, I cannot ping out from the machine either.

I'm not sure if it is a CentOS problem or a VirtualBox problem.

Here is the output of ip addr:

ip addr

Here is the output of nmcli d:

nmcli d

I should also mention that really I have no idea what I am doing.

2

2 Answers

You have likely not configured your network in Virtualbox correctly.

Please refer to section 6.2:

By default, Virtualbox puts adapters in NAT mode. This works for connecting the virtual machine to the internet, but not much else. This is because Virtualbox creates an additional NAT on your machine, and puts the VMs behind it.

In my view, the desirable mode is "Bridged Networking", where the VM acts like a separate device on your network, bridging directly to your network adapter. Then it will be on the same subnet as any other machine on your network.

There are other use cases for the other networking modes, but I find that 99% of the time, bridged mode is what I want for the VM.

3

To get Centos to run on Virtual Box, in /etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

You might need to reboot.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like