You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vagrantfile created by vagrant init centos/atomic-host and private network enabled:
Vagrant.configure("2") do |config|
config.vm.box = "centos/atomic-host"
config.vm.network "private_network", ip: "192.168.33.10"
end
Result:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos/atomic-host'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/atomic-host' is up to date...
==> default: Setting the name of the VM: centos-atomic_default_1490027763982_65539
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
# Down the interface before munging the config file. This might
# fail if the interface is not actually set up yet so ignore
# errors.
/sbin/ifdown 'enp0s8'
# Move new config into place
mv -f '/tmp/vagrant-network-entry-enp0s8-1490027783-0' '/etc/sysconfig/network-scripts/ifcfg-enp0s8'
# attempt to force network manager to reload configurations
nmcli c reload || true
# Restart network
service network restart
Stdout from the command:
Restarting network (via systemctl): [FAILED]
Stderr from the command:
usage: ifdown <configuration>
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
This is long time unattended issue by RedHat/CentOS teams...
STOCK CentOS vagrant box has following ifcfg preventing network.service from being restarted even WITHOUT private network configured...
-bash-4.2# systemctl restart network
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
Workaround (not so flexible)...
Rebuild and repackage Stock Box by adding:
config.vm.provision "shell", privileged: true,
inline: "[[ -s /etc/sysconfig/network-scripts/ifcfg-eth0 ]] && rm -rf /etc/sysconfig/network-scripts/ifcfg-eth0"
Usual box packaging steps...e.g: deploying Insecured vagrant SSH key...etc..
Then reference your repackaged box as source for your Local Vagrantfile's.
Vagrantfile created by
vagrant init centos/atomic-host
and private network enabled:Result:
Network interfaces:
Error messages:
Vagrant Box
The text was updated successfully, but these errors were encountered: