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

96 views
Skip to first unread message

suraj muthreja

unread,
Jul 3, 2017, 8:20:56 AM7/3/17
to Vagrant
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.
Reply all
Reply to author
Forward
0 new messages