Vagrant: Vagrant attempted to execute the capability 'configure_networks' on the detect guest OS 'linux'

Created on 21 Oct 2015  ·  55Comments  ·  Source: hashicorp/vagrant

When upgrading vagrant 1.6 to 1.7, I encountered this:

 INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x007f87f04a1eb8>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::GuestCapabilityNotFound: Vagrant attempted to execute the capability 'configure_networks'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.>
ERROR vagrant: Vagrant attempted to execute the capability 'configure_networks'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.
ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/guest.rb:45:in `rescue in capability'

It had worked with Vagrant 1.6.5 and VirtualBox 4, but then upgraded to VirtualBox 5 which forced an upgrade of Vagrant to 1.7.4. The OS (box) being installed was Ubuntu 14.04

https://gist.github.com/psi29a/3ebe806cfc01bb15bc6d <-- the VagrantFile used.

Is there anything I can do to work-around this?

bug core hoslinux

Most helpful comment

Ok, so apparently, there's no /etc/os-release file in Ubuntu 12.04, which Vagrant 1.8.5 relies on to detect Ubuntu.
As a workaround one can borrow a version from Ubuntu 12.04.5 with minor tweaks:

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="12.04 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04 LTS)"
VERSION_ID="12.04"

No idea what proper permanent solution would be.

All 55 comments

I´m having the same problem here right after update OSX to 10.11.

With Vagrant 1.7.4 and VirtualBox 5.

I have the same problem,but my os is windows 7.

 INFO interface: error: Vagrant attempted to execute the capability 'configure_networks'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.
Vagrant attempted to execute the capability 'configure_networks'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.
 INFO interface: Machine: error-exit ["Vagrant::Errors::GuestCapabilityNotFound", "Vagrant attempted to execute the capability 'configure_networks'\non the detect guest O
S 'linux', but the guest doesn't\nsupport that capability. This capability is required for your\nconfiguration of Vagrant. Please either reconfigure Vagrant to\navoid thi
s capability or fix the issue by creating the capability."]

This happens on ubuntu images that don't have the lsb-release package installed.
The following patch works even when the command is not installed:

heyvaerm@mdesktop:/opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/guests/ubuntu⟫ diff guest.rb.orig guest.rb
7c7
<         machine.communicate.test("[ -x /usr/bin/lsb_release ] && /usr/bin/lsb_release -i 2>/dev/null | grep Ubuntu")
---
>         machine.communicate.test("grep Ubuntu /etc/lsb-release")

Same issue for me but patch doesn't seem to work michaelheyvaert. I'm have Vagrant 1.7.4 with VBox 5.0.8 running Kali 2.0. Thanks ahead of time!

Edit: Despite the warning I can still ssh into the machine and have checked that lsb-release is installed.

can you paste the content of /etc/lsb-release and the output of lsb_release -i ?

it would probably be better to try the lsb-release command first and fall back to reading the etc file directly.

I have the same issue on my end .. vm.network and vm.hostname won't work. If i comment out those parts from my vagrantfile the machine boots fine.

vagrant@vagrant:~/ansible$ [ -x /usr/bin/lsb_release ] && /usr/bin/lsb_release -i 2>/dev/null | grep Ubuntu
Distributor ID: Ubuntu

The command works fine so don't think its the lsb-release which isn't installed.

I have this on my own box but also got it when using the ubuntu/trusty64 box.

all the commands from change_host_name.rb work fine on my box as well so no clue why it thinks it's not supported.

Hi @psi29a

Thank you for opening an issue and I am sorry you are having issues with Vagrant. I just tried your Vagrantfile using the ubuntu/trusty64 image and it works as-expected against the master branch. I am going to go ahead and close this. Vagrant 1.8 will be out shortly! :smile:

I am still having this issue in Vagrant 1.8.1
My host OS is Mac OS X 10.11.14
and the guest OS is ubuntu14. I can bring the box up fine the first time with 'vagrant up'
but when I halt or suspend it, trying to restart it again with 'vagrant up' yields this error.
Meaning I need to destroy and recreate it every time, which is sub-optimal.

I'm having the same issue with OSX 10.11.5 and vagrant 1.8.5. My conf was private network with statically assigned IP

I'm having same issue with OSX 10.11.6 and Vagrant 1.8.5, Ubuntu 12.04 as guest. Also static IP.

Ok, so apparently, there's no /etc/os-release file in Ubuntu 12.04, which Vagrant 1.8.5 relies on to detect Ubuntu.
As a workaround one can borrow a version from Ubuntu 12.04.5 with minor tweaks:

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="12.04 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu precise (12.04 LTS)"
VERSION_ID="12.04"

No idea what proper permanent solution would be.

Thanks @z4y4ts, that solved this for me.

@z4y4ts Could you please explain more how to use your workaround - where to include those properties?

@vaspoz you need to create a /etc/os-release file manually and put the contents I provided. See my updated comment above. It sould make more sense now.

Hi,

the error persists on my Windows host with static private_network IP configuration.
My Vagrant Version is 1.8.5 and I've also checked the os-release file:

vagrant@vagrant-ubuntu-trusty-64:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04.4 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.4 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

I further updated the guest-addition but without any success. Still got:

==> default: Configuring and enabling network interfaces...
Vagrant attempted to execute the capability 'configure_networks'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.`

Vagrant still uses the default NAT conf with 10.0.2.15. :(
Any ideas?

Thanks @z4y4ts, helped me get back up and running 👍

Thanks @sethvargo, that solved this for me.
I was resolved by editing the .otto/compiled/app/dev/Vagrantfile.

When i ran "vagrant up" i got this error:

Vagrant attempted to execute the capability 'configure_networks'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

My vagrant --version is

Vagrant 1.8.5

And my lsb_release is showing:

LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch

And cat /etc/os-release is showing:

NAME="Ubuntu"
VERSION="14.04.4 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.4 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

Now how should i resolve this.

And i am also getting the following error with vagrant up:

default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default: 
default: Guest Additions Version: 5.0.10
default: VirtualBox Version: 4.3

Now i am running ubuntu 14.04 LTS version and for that we do not have VirtualBox version 4.3.
I want to get the shared folder in my computer from vagrant, how can i achieve that so that i can edit code in pycharm?

Same issue on Ubuntu 16.04 with Vagrant 1.8.5 and /etc/os-release:

NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial

Since there are multiple reports of this issue, can it be re-opened and investigated again? Or should we open a new one?

Thanks a lot!

Vagrant 1.8.5, VirtualBox 5.
Uncomenting

  config.vm.network "private_network", ip: "192.168.33.10"

in Vagrantfile from first example (vagrant init; vagrant up) produce same error.

Why are we closing this issue if there's no clear solution without patching the lsb file?

+1, Vagrant 1.8.5, VirtualBox 5.1.2, Windows 10
@z4y4ts solution help me to setup config.vm.network "private_network", ip: "192.168.33.10"

+1 Vagrant 1.8.5, VirtualBox 5.0.24_Ubuntu r108355, Ubuntu 16.04.1

michaelheyvaert solution worked for me :
https://github.com/mitchellh/vagrant/issues/6426#issuecomment-156745777

vagrant 1.8.5 & Mac OS.

Solved problem by michaelheyvaert's solution https://github.com/mitchellh/vagrant/issues/6426#issuecomment-156745777

Why is this issue closed? it's still broken as far as I can tell.

I was getting the Vagrant attempted to execute the capability 'configure_networks' error on OS X with Vagrant 1.8.5 when using the 'hashicorp/precise32' (12.04) box.

I think @z4y4ts correctly identified the issue in his comment on #6426.

An easy workaround seems to be switching from the hashicorp to the ubuntu/precise32 box, which has been updated to 12.04.5:

config.vm.box = "ubuntu/precise32"

@jcowley There are workarounds, but the bug still exists, so should not be closed. Particularly given that vagrant's own documentation leads people to use hashicorp's box.

@eduvik: Well, sure. I'm not suggesting that there isn't a bug. Just providing another workaround that's a bit simpler.

Modified my comment to remove any confusion that my suggestion might be a "fix". ;)

@eduvik As far as I can see this has been fixed over a month ago, just couple days after 1.8.5 release - https://github.com/mitchellh/vagrant/commit/00fa49191dba2bb7c6322fa8df9327ca505c0b41

The only thing's left is to make this fix available to public.

This is NOT fixed. Same issue .. OSX 10.11, vagrant 1.8.5 and a Kali Linux 2.0 instance. The issue appears tied to the fact that Vagrant doesn't recognize kali as a valid distro. The following will resolve this and allow the guest to be managed correctly.

cd /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests
sudo cp -R debian kali
perl -pi -e 's/debian/kali/g; s/Debian/Kali/g;' kali/guest.rb kali/plugin.rb kali/cap/configure_networks.rb

@sethvargo still failing in vagrant 1.8.5

OSX and Vagrant 1.8.4 , fixed by @michaelheyvaert 's patch!

Guys I fixed this problem and one more ( which is described here using a solution with creating an additional file on a guest machine. which file needs to be created is also described here but I would put here all the steps what I did)

Please note I am a very new guy with Vagrant so if I messed something up or did something incorrectly - that was only because I am a real newbie in this world. Also, I am sorry for such a detailed list of steps I did but that is oriented on same category Vagrant users as I am, but at least it helped me so I hope it might be helpful for someone else.

So in a brand new "hashicorp/precise64" vm I could not either set config.vm.host_name nor config.vm.network "private_network"....

Here is what I did to make it work in my case (hopefully it would help out someone else):

1) I initialized a new vm by doing vagrant init hashicorp/precise64
2) I updated a Vagrantfile with this (basically kept an absolute basic there) content

Last login: Wed Sep  7 16:29:16 2016 from 10.0.2.2
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"
  config.vm.box_version = "1.1.0"
end

3) Inside of the current box directory I created a file called os-release and placed this content there

NAME="Ubuntu"
VERSION="12.04.1 LTS, Precise Pangolin"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 12.04.1 LTS"
VERSION_ID="12.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

4) I did vagrant up and waited until the machine boots up

5) I did vagrant ssh and once I ssh-ed in I saw a default host name and an ip address

vagrant@precise64:~$ ifconfig
.....
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0

6) I copied os-release to /etc folder (by default the directory where you are running your vm from is mounted to /vagrant on your guest machine

sudo cp /vagrant/os-release /etc

7) I exit from guest to host

8) on a host machine I updated the Vagrantfile and add there host name and an ip address

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"
  config.vm.box_version = "1.1.0"
 # Next two lines were not here in the basic version of the Vagrantfile
  config.vm.network "private_network", ip: "192.168.40.10"
  config.vm.host_name = 'server-provision-test02'
end

9) I did vagrant provision , vagrant halt and vagrant up

10) when it finished I did vagrant ssh again and I saw a proper hostname and an ip address

vagrant@server-provision-test02:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:88:0c:a6
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
........
eth1      Link encap:Ethernet  HWaddr 08:00:27:91:6e:4f
          inet addr:192.168.40.12  Bcast:192.168.40.255  Mask:255.255.255.0
......         

Good luck!

UBUNTU 16.04 host. Using the suggested hashicorp/precise64 box
I experienced the same bug/error, network error.

Latest VirtualBox, latest vagrant which I believe is 1.8.5

the grep hack did not fix it, and the required files were in place already anyway. The Grep Ubuntu command in machine.communicate.test("grep Ubuntu /etc/lsb-release")
returns 2 lines. The file is not missing in my 16.04 release either. So it should have been fine to begin with.

I had the same error after upgrading to Vagrant 1.8.5 on a setup that was working fine prior to the upgrade.

To FIX I updated my Vagrantfile from this:

config.vm.network "private_network", ip: "192.168.33.10"

to this:

config.vm.network "private_network", ip: "192.168.33.10", type: "dhcp", auto_config: false

@andrewmiro 's solution works for me, thank you

I had this issue, above-mentioned fixes didn't work.

This fix worked: http://stackoverflow.com/questions/38636023/vagrant-not-supported-the-capability-change-host-name

The change above worked for me on OSX 10.11.6 with Vagrant 1.8.5 and Ruby from Homebrew. FYI the file I had to change was /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/ubuntu/guest.rb.

Thanks @z4y4ts that solved this for me.

@z4y4ts how to create /etc/os-release inside the VM if running vagrant up directly? I tried synced_folder but the "configure_network" error appears before synced_folder runs. The only way I can do this now is to ssh in and add /etc/os-release, and then vagrant reload it.

I currently use @michaelheyvaert 's fix on vagrant 1.8.5 with precise64 and the problem is fixed.

Thanks @andrewmiro . I was running the vagrant up for the first time and your solution worked for me.

My Environment details are:
OS: Ubuntu Precise 12.04
VirtualBox version: 5.1
Vagrant: 1.8.5

@terpsho yeah, it may be a bit tricky to get inside the box. If I recall correctly, in my case I was able to vagrant ssh despite the network error. And then create the file inside the box.

Have had the same problem macOS Sierra 10.12
VirtualBox version: 5.1
Vagrant: 1.8.5
box precise32

@z4y4ts solution helped me, thanks

vagrant 1.8.5 & Mac OS.

Solved problem by michaelheyvaert's solution #6426 (comment)

@sandinak There are uncaptured files in your perl snippet

sudo perl -pi -e 's/debian/kali/g; s/Debian/Kali/g;' *.rb ./cap/*.rb

Hi, I still having the same problem, I tried different options you posted.

macOS Sierra 10.12.2
VirtualBox version: 5.1.12
Vagrant: 1.9.1
custom boot2docker from 1.12.6

I recently updated from vagrant 1.8.6 and VB 5.1.6

Any idea?

Edit:
I fixed it changing in the Vagrantfile
from:
config.vm.network "private_network", ip: "192.168.10.10", id: "default-network", nic_type: "virtio"

to:
config.vm.network "private_network", ip: "192.168.10.10", id: "default-network", nic_type: "virtio", type: "dhcp", auto_config: false

This problem dont happen in vagrant version 1.8.1. This version is stable of Ubuntu 16.04

What is status of this? copying templates/guest/debian and plugins/guest/debian to same location with modification of name to kali and text substitution solves this.

@okovalov I followed your solution and it worked for me. Thanks.

vagrant up terminal message _before_ the fix:

default: Configuring and enabling network interfaces...
Vagrant attempted to execute the capability 'configure_networks'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

vagrant up terminal message _after_ the fix:

==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => F:/VBoxDir
==> default: Machine already provisioned. Run vagrant provision or use the --provision
==> default: flag to force provisioning. Provisioners marked to run always will still run.

==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:55985
default: WinRM username: IEUser
default: WinRM execution_time_limit: PT2H
default: WinRM transport: plaintext
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
Vagrant attempted to execute the capability 'mount_nfs_folder'
on the detect guest OS 'windows', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

My startup error

Thanks to @ehernandez-xk
solve the problem perfectly

Although closed, this is almost the only resource one can find while looking for that problem...

I've got this problem still with the alpine/alpine64 image, although /etc/os-release exists. I tried it with maier's vagrant plugin vagrant-alpine, still no luck because eth1 just is not being created.

```
alpine:~# cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.7.0
PRETTY_NAME="Alpine Linux v3.7"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"

alpine:~# lsmod|grep vbox
vboxguest 287321 0

alpine:~# ls /lib/modules
4.9.73-0-virthardened

alpine:~# uname -a
Linux alpine 4.9.73-0-virthardened #1-Alpine SMP Tue Jan 2 16:48:59 UTC 2018 x86_64 Linux

alpine:~# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:9E:9E:E5
inet addr:10.0.2.15 Bcast:0.0.0.0 Mask:255.255.255.0
...
````

The mentioned steps on this page https://wiki.alpinelinux.org/wiki/VirtualBox_guest_additions are not working either.

Since alpine is the smallest solid distribution (~51MB), I am in favour of this - or can anybody tell a comparable small OS for just running nginx, for example?

Still seeing this issue, even when specifically specifying the 'libvirt' provider:


bash-4.4$ vagrant up --provider=libvirt
Bringing machine 'default' up with 'libvirt' provider...
==> default: Uploading base box image as volume into libvirt storage...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default:  -- Name:              vagrant_default
==> default:  -- Domain type:       kvm
==> default:  -- Cpus:              1
==> default:  -- Memory:            512M
==> default:  -- Management MAC:    
==> default:  -- Loader:            
==> default:  -- Base box:          kbi/ubuntu16.04
==> default:  -- Storage pool:      default
==> default:  -- Image:             /var/lib/libvirt/images/vagrant_default.img (40G)
==> default:  -- Volume Cache:      default
==> default:  -- Kernel:            
==> default:  -- Initrd:            
==> default:  -- Graphics Type:     vnc
==> default:  -- Graphics Port:     5900
==> default:  -- Graphics IP:       127.0.0.1
==> default:  -- Graphics Password: Not defined
==> default:  -- Video Type:        cirrus
==> default:  -- Video VRAM:        9216
==> default:  -- Keymap:            en-us
==> default:  -- TPM Path:          
==> default:  -- INPUT:             type=mouse, bus=ps2
==> default:  -- Command line : 
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for SSH to become available...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Configuring and enabling network interfaces...
Vagrant attempted to execute the capability 'configure_networks'
on the detect guest OS 'linux', but the guest doesn't
support that capability. This capability is required for your
configuration of Vagrant. Please either reconfigure Vagrant to
avoid this capability or fix the issue by creating the capability.

...is vagrant assuming that linux guests run in a Virtual Box environment?

My Vagrantfile is very simple:

 -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "kbi/ubuntu16.04"
  config.vm.guest = :linux
end

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hesco picture hesco  ·  3Comments

dorinlazar picture dorinlazar  ·  3Comments

tomhking picture tomhking  ·  3Comments

rhencke picture rhencke  ·  3Comments

OtezVikentiy picture OtezVikentiy  ·  3Comments