Building a Simple Ubuntu 18.04 desktop Vagrant image

28 views
Skip to first unread message

Howling Sails

unread,
Nov 4, 2019, 1:19:12 AM11/4/19
to Vagrant
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.

Howling Sails

unread,
Nov 4, 2019, 1:58:28 AM11/4/19
to Vagrant
This is a virtualbox machine made directly from the ISO image of 18.04 following the instructions from hashcorp.

Gabo Kete

unread,
Nov 4, 2019, 7:00:37 AM11/4/19
to Vagrant
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/://'

Howling Sails

unread,
Nov 4, 2019, 3:08:38 PM11/4/19
to vagra...@googlegroups.com
Currently I don't have any provisioning step. Just trying to bring up the another copy of the box I just created.

The only configuration around networking is...

   #https://www.vagrantup.com/docs/networking/public_network.html
   config.vm.network "public_network",  use_dhcp_assigned_default_route: true, bridge: "en0: Wi-Fi (AirPort)"

--
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 a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/GovqVDP6yPQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/8865b7d0-9fde-41f2-b2e6-390b3149f3ba%40googlegroups.com.

Gabo Kete

unread,
Nov 4, 2019, 11:58:30 PM11/4/19
to Vagrant
The command you are reporting is failing must be somewhere, either a script, within the vagrantfile... 

If you can share your vagrantfile and the box image you are using that could be a good start 
To unsubscribe from this group and all its topics, send an email to vagra...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages