In order for the CentOS virtual function in the VirtualBox to connect to the network, the virtual machine needs to be assigned a NAT-enabled network card:
In order to connect the virtual machine via SSH, a network card is allocated to bridge to a network card of the physical machine. Create a new loopback network card here:
Enter devmgmt.msc in the runtime to open the Device Manager and select "Add Outdated Hardware":
Install the hardware I selected manually from the list-network adapter-microsoft-loopback Adapter
This adds a loopback network adapter that mezzanine bridge the virtual machine to the network:
After the physical connection is complete, you also need to assign an IP address. Assign the 2nd NIC of the virtual machine to the same network segment as the host loopback network card, for example: 192.168.100.0
To configure the/etc/sysconfig/network-scripts/ifcfg-eth1 for a virtual machine:
Device=eth1hwaddr= ,:xx: -: 4e:b1:f0type=Ethernetuuid=d67efa45-ca55-49c2-836d-De6e8e771166onboot=yesnm_controlled=Yesbootproto=staticipaddr=192.168.100.2NETWORK=192.168.100.0NETMASK=255.255.255.0Broadcast=192.168.100.255
To turn off SELinux for a virtual machine:
Vi/etc/selinux/config Change selinux=enforcing to selinux=disabled
To turn off Windows Firewall:
1, if unable to modify the network location, first control Panel-management tools-Local Security policy-network list policy management, the "Unrecognized network" network location changed to private;
2, Firewall-Advanced settings-operation-Properties, status column of the custom, cancel the relevant network card before the tick:
Complete, you can now access the system on the virtual machine via SSH
Linux Virtual Machine Network configuration