For me... the issue was related to the time it takes for the network 
devices to be configured and the execution of the inline shell command

so What I did, before running any command which might present the scenario 
you are facing.. I add a delay before running the command.. 

in your case you should probably want to add in your vagrantfile the 
following


*# config.vm.provision "shell", inline: "echo \"Sleeping 5 seconds - 
Allowing Network Devices to start...\";sleep 5 && /sbin/ip -o -0 addr | 
grep -v LOOPBACK | awk '{print $2}' | sed 's/://'*
On Monday, November 4, 2019 at 10:58:28 AM UTC+4, Howling Sails wrote:
>
> This is a virtualbox machine made directly from the ISO image of 18.04 
> following the instructions from hashcorp.
>
> On Sunday, November 3, 2019 at 10:19:12 PM UTC-8, Howling Sails wrote:
>>
>> After I run vagrant up I get this strange error
>>
>> ====================================================
>>
>> Bringing machine 'default' up with 'virtualbox' provider...
>> ==> default: Importing base box 'devHowlingSails'...
>> ==> default: Matching MAC address for NAT networking...
>> ==> default: Setting the name of the VM: dev_ubuntu_box
>> ==> default: Clearing any previously set network interfaces...
>> ==> default: Preparing network interfaces based on configuration...
>>     default: Adapter 1: nat
>>     default: Adapter 2: bridged
>> ==> default: Forwarding ports...
>>     default: 22 (guest) => 2222 (host) (adapter 1)
>> ==> default: Running 'pre-boot' VM customizations...
>> ==> 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: password
>>     default:
>>     default: Inserting generated public key within guest...
>> ==> default: Machine booted and ready!
>> ==> default: Checking for guest additions in VM...
>> ==> 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!
>>
>> /sbin/ip -o -0 addr | grep -v LOOPBACK | awk '{print $2}' | sed 's/://'
>>
>>
>> ====================================================
>>
>>
>> When I run it on the import box directly I get  the following
>>
>> ====================================================
>>
>> vagrant@devHowlingSails:~$ /sbin/ip -o -0 addr | grep -v LOOPBACK | awk 
>> '{print $2}' | sed 's/://'
>> enp0s3
>> enp0s8
>>
>> ====================================================
>>
>>
>> I've played with the network settings on the box many different ways but 
>> can't get it to work.
>>
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/8865b7d0-9fde-41f2-b2e6-390b3149f3ba%40googlegroups.com.

Reply via email to