Today I was planning to get the latest Ubuntu release into my virtual box using vagrant. After loading the image and running vagrant up
, I got an error as reported below, which relates to the network configuration of the virtual box.
Interestingly, there are already some posts online (mainly on GitHub, e.g.: https://github.com/mitchellh/vagrant/issues/7155), but also on AskUbuntu (https://askubuntu.com/questions/760871/network-settings-fail-for-ubuntu-xenial64-vagrant-box), StackOverflow (vagrant up command giving error and eth1 not showing a resolvable ip address) and StackExchange (https://unix.stackexchange.com/questions/188413/not-able-to-resolve-ip-address-for-eth1-in-vagrant-vm). However these issues relate to either xenial64
(i.e. not bento
) or use a public_network
configuration.
As reported in https://askubuntu.com/questions/760871/network-settings-fail-for-ubuntu-xenial64-vagrant-box, this issue does not exist for ubuntu/trusty64
or ubuntu/wily64
, but seems to be an issue for both ubuntu/xenial64
and bento/ubuntu-16.04
(i.e. both Ubuntu 16 boxes).
As you will see in my Vagrantfile
below, I have a simple setup for bento/ubuntu-16.04
and use private_network
only. To be clear, I can't really use this post (vagrant up command giving error and eth1 not showing a resolvable ip address) since it suggests to comment out the public_network
part of the vagrant configuration. Also, I should mention that there are no other VM's running at the time this error occurs.
From the error log it seems obvious that there is an issue with the netowrk interface eth1
, but what exactly the problem is, is unclear to me. I have previously successfully started the hashicorp/precise32
and ubuntu/trusty64
Ubuntu boxes with the same vagrant configuration and the same Oracle VB and have not encountered this problem.
Any help is appreciated. My technical setup and reference files are listed below.
Cheers AHL
Setup:
Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "private_network", ip: "192.168.33.10"
end
Output:
C:\Users\AHL\workspace>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> 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: private key
==> default: Machine booted and ready!
GuestAdditions 5.0.16 running --- OK.
==> 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/ifdown eth1 2> /dev/null
Stdout from the command:
Stderr from the command:
mesg: ttyname failed: Inappropriate ioctl for device
C:\Users\AHL\workspace>
I think in your list, you need to add https://github.com/mitchellh/vagrant/issues/6871
The issue is still open - There are some users who reported they could fix the issue (https://github.com/mitchellh/vagrant/issues/6871#issuecomment-223290622 or https://github.com/mitchellh/vagrant/issues/6871#issuecomment-222348226)
If you can build your box yourself using packer, there are some fixes on the network issue.