vagrant up failed to get the IP address for Ubuntu16.04 boxes -- How to provision the custom Ubuntu16 box to have default Ethernet interface of type ethX

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

vagrant up failed to get the IP address for Ubuntu16.04 boxes -- How to provision the custom Ubuntu16 box to have default Ethernet interface of type ethX

suraj muthreja
Hi Team,

Need some help here..
I want to provision the VM using libvirt provider with Ubuntu 16.04 box.
There are Ubuntu 16 boxes available on the internet but I don't want to use that. My aim is to create the Ubuntu16 box first and then use that box to create VM.

I followed the below recipe:

  1. Create a VM using virt-install with Ubuntu16.04 ISO using libvirt (Dont use Oracle VM Box). Command used:
    sudo virt-install -n Ubuntu16_Test -r 1024 --vcpus=2 --disk size=50 -c ubuntu-16.04.2-server-amd64.iso --accelerate --network network=default,model=virtio --connect=qemu:///system --vnc --noautoconsole -v

  2. Then install Ubuntu16 OS on this VM.

  3. Now create the custom box image using this VM and add into vagrant box.

  4. Use this box and provision the VM using vagrant up now.

  5. It failed at step: "Waiting for domain to get an IP address..."

I know that there is issue with interface assignment with Ubuntu16. 

My question is can I create a Ubuntu 16 box which will have default interface type as ethX instead of ensX. I followed below procedure but that also does not seem to work..
  • Create a VM using virt-install with Ubuntu16.04 ISO using libvirt (Dont use Oracle VM Box). Command used:
    sudo virt-install -n Ubuntu16_Test -r 1024 --vcpus=2 --disk size=50 -c ubuntu-16.04.2-server-amd64.iso --accelerate --network network=default,model=virtio --connect=qemu:///system --vnc --noautoconsole -v
  • Then install Ubuntu16 OS on this VM.
  • Now updated the "/etc/default/grub" for "GRUB_CMDLINE_LINUX= "net.ifnames=0 biosdevname=0" " so that default Ethernet interface type ethX can be obtained.
  • Updated the /etc/network/interfaces file also for interface type ethX.
  • Verified that default interface has been changed to ethX now after reboot the VM.
  • Shutdown the VM.
  • Now created the custom box image using this VM and add into vagrant box.
  • When I am using this box and provision the VM using vagrant up, it still stuck at same step "Waiting for domain to get an IP address.."
  • When checked in console, it is looking for IP on interface "ensX"
How can I build the custom Ubuntu16 box which should always look for ethX type of interface..
When I used the existing Ubuntu16 boxes on internet e.g. "lxb/ubuntu-16.04-amd64" it always bring up the VM with ethX type interface..

Any help here is appreciated.

Note: I don't have to use Oracle Virtual Box here.


Thanks,
Suraj Muthreja.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/6d8aef9e-18a3-459e-808b-3441b9128a6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.