oracle / vagrant-projects

Vagrant projects for Oracle products and other examples
Universal Permissive License v1.0
945 stars 477 forks source link

Vagrant up error with Custom Network Configuration #465

Closed marcossilvestrini closed 1 year ago

marcossilvestrini commented 1 year ago

INFO interface: error: The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

/sbin/ifdown '' /sbin/ifdown '' mv -f '/tmp/vagrant-network-entry--1672706551-0' '/etc/sysconfig/network-scripts/ifcfg-' mv -f '/tmp/vagrant-network-entry--1672706551-1' '/etc/sysconfig/network-scripts/ifcfg-' (test -f /etc/init.d/NetworkManager && /etc/init.d/NetworkManager restart) || ((systemctl | grep NetworkManager.service) && systemctl restart NetworkManager) /sbin/ifup '' /sbin/ifup ''

Stdout from the command:

NetworkManager.service loaded active running Network Manager

Stderr from the command:

bash: line 4: /sbin/ifdown: No such file or directory bash: line 5: /sbin/ifdown: No such file or directory bash: line 9: /sbin/ifup: No such file or directory bash: line 10: /sbin/ifup: No such file or directory

The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

/sbin/ifdown '' /sbin/ifdown '' mv -f '/tmp/vagrant-network-entry--1672706551-0' '/etc/sysconfig/network-scripts/ifcfg-' mv -f '/tmp/vagrant-network-entry--1672706551-1' '/etc/sysconfig/network-scripts/ifcfg-' (test -f /etc/init.d/NetworkManager && /etc/init.d/NetworkManager restart) || ((systemctl | grep NetworkManager.service) && systemctl restart NetworkManager) /sbin/ifup '' /sbin/ifup ''

Stdout from the command:

NetworkManager.service loaded active running Network Manager

Stderr from the command:

bash: line 4: /sbin/ifdown: No such file or directory bash: line 5: /sbin/ifdown: No such file or directory bash: line 9: /sbin/ifup: No such file or directory bash: line 10: /sbin/ifup: No such file or directory INFO interface: Machine: error-exit ["Vagrant::Errors::VagrantError", "The following SSH command responded with a non-zero exit status.\nVagrant assumes that this means the command failed!\n\n/sbin/ifdown ''\n/sbin/ifdown ''\nmv -f '/tmp/vagrant-network-entry--1672706551-0' '/etc/sysconfig/network-scripts/ifcfg-'\nmv -f '/tmp/vagrant-network-entry--1672706551-1' '/etc/sysconfig/network-scripts/ifcfg-'\n(test -f /etc/init.d/NetworkManager && /etc/init.d/NetworkManager restart) || ((systemctl | grep NetworkManager.service) && systemctl restart NetworkManager)\n/sbin/ifup ''\n/sbin/ifup ''\n\nStdout from the command:\n\n NetworkManager.service loaded active running Network Manager\n\n\nStderr from the command:\n\nbash: line 4: /sbin/ifdown: No such file or directory\nbash: line 5: /sbin/ifdown: No such file or directory\nbash: line 9: /sbin/ifup: No such file or directory\nbash: line 10: /sbin/ifup: No such file or directory\n"]

Additional information

If I disable the network configuration (bridge) the error does not occur. These lines here:

ol9_lpic2_202.vm.network "public_network" ,ip: "192.168.0.135",mode: "bridge" ,bridge: "Marvell AQtion 5Gbit Network Adapter" ol9_lpic2_202.vm.network "private_network", ip: "172.36.12.220"

In version 8 this scenario does not occur using this same scenario

Attached I send the Vagrantfile and the vagrant log files.zip

Thanks

AmedeeBulle commented 1 year ago

TL;DR: ensure your bridge is configured with the virtio adapter.

Starting with UEK7 kernel (both OL8 and OL9), the kernel is packaged differently (see Changes to UEK Content Distribution and Packaging). For the vagrant boxes (as well as the other cloud images we provide), we only install the kernel-uek-core package which contains everything needed in a VM environment. This means that for the network adapter, only the virtio driver is packaged. If you configure Virtualbox to emulate anything else than virtio the interface won't come up, generating the errors you have while Vagrant tries to configure it.

There shouldn't be any reason for not using virtio as it is the driver with the least overhead; however should you absolutely want to use something else, you will have to install the kernel-uek-modules pacakge.

marcossilvestrini commented 1 year ago

TL;DR: ensure your bridge is configured with the virtio adapter.

Starting with UEK7 kernel (both OL8 and OL9), the kernel is packaged differently (see Changes to UEK Content Distribution and Packaging). For the vagrant boxes (as well as the other cloud images we provide), we only install the kernel-uek-core package which contains everything needed in a VM environment. This means that for the network adapter, only the virtio driver is packaged. If you configure Virtualbox to emulate anything else than virtio the interface won't come up, generating the errors you have while Vagrant tries to configure it.

There shouldn't be any reason for not using virtio as it is the driver with the least overhead; however should you absolutely want to use something else, you will have to install the kernel-uek-modules pacakge.

Thanks @AmedeeBulle . After set a nic_type my build finish with success.

NETWORK

ol9_lpic2_202.vm.network "public_network",ip: "192.168.0.135",mode: "bridge",bridge: "Marvell AQtion 5Gbit Network Adapter",nic_type: "virtio"

Regards,