virtualbox - Vagrant - Not Supported the capability 'change_host_name' -
the problem capability 'change_host_name' isn't supported guest when try execute following command line:
vagrant
it gives me error following:
vagrant attempted execute capability 'change_host_name' on detect guest os 'linux', guest doesn't support capability. capability required configuration of vagrant. please either reconfigure vagrant avoid capability or fix issue creating capability.
note os is: os x yosemite 10.10.5
guest additions version: 4.2.0 , virtualbox version: 5.0
i've tried many solutions of others face issue, couldn't fix it.
this https://github.com/mitchellh/vagrant/issues/7625. fixed in next release, until if blocking you, can patch vagrant yourself
if want patch yourself
method1 :
- search
plugins/guests/ubuntu/guest.rb
file in vagrant installation- e.g.
/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/guests/ubuntu/guest.rb
on mac/linux default install - or
/opt/vagrant/embedded/gems/vagrant-1.8.5/plugins/guests/ubuntu/guest.rb
- windows :
c:\hashicorp\vagrant\embedded\gems\gems\vagrant-1.8.5\plugins\guests\ubuntu\guest.rb
- e.g.
- replace https://raw.githubusercontent.com/carlosefr/vagrant/1c631c18d1a654405f6954459a42ac19a1a2f096/plugins/guests/ubuntu/guest.rb (make sure correct rights if install admin, must admin user save file)
alternatively edit file , replace contents by
module vagrantplugins module guestubuntu class guest < vagrant.plugin("2", :guest) def detect?(machine) # command detects if running on ubuntu. /etc/os-release # available on modern ubuntu versions, not exist on 14.04 , # previous versions, fall lsb_release. # # gh-7524 # gh-7625 # machine.communicate.test <<-eoh.gsub(/^ {10}/, "") if test -r /etc/os-release; source /etc/os-release && test xubuntu = x$id elif test -x /usr/bin/lsb_release; /usr/bin/lsb_release -i 2>/dev/null | grep -q ubuntu else exit 1 fi eoh end end end end
method2 : alternative method patch file using patch
command :
save following file under vagrant-guest.patch
commit 00fa49191dba2bb7c6322fa8df9327ca505c0b41 author: seth vargo <sethvargo@gmail.com> date: sat jul 23 11:40:36 2016 -0400 guests/ubuntu: revert detection - semi-reverts gh-7524 - fixes gh-7625 diff --git a/plugins/guests/ubuntu/guest.rb b/plugins/guests/ubuntu/guest.rb index 9aeb7aa..f60108e 100644 --- a/plugins/guests/ubuntu/guest.rb +++ b/plugins/guests/ubuntu/guest.rb @@ -2,7 +2,22 @@ module vagrantplugins module guestubuntu class guest < vagrant.plugin("2", :guest) def detect?(machine) - machine.communicate.test("test -r /etc/os-release && . /etc/os-release && test xubuntu = x$id") + # command detects if running on ubuntu. /etc/os-release + # available on modern ubuntu versions, not exist on 14.04 , + # previous versions, fall lsb_release. + # + # gh-7524 + # gh-7625 + # + machine.communicate.test <<-eoh.gsub(/^ {10}/, "") + if test -r /etc/os-release; + source /etc/os-release && test xubuntu = x$id + elif test -x /usr/bin/lsb_release; + /usr/bin/lsb_release -i 2>/dev/null | grep -q ubuntu + else + exit 1 + fi + eoh end end end
and run following command apply patch
sudo patch -p1 --directory /opt/vagrant/embedded/gems/gems/vagrant-1.8.5/ < vagrant-guest.patch
just replace /opt/vagrant/embedded/gems/gems/vagrant-1.8.5
(or /opt/vagrant/embedded/gems/vagrant-1.8.5/plugins/guests/ubuntu/guest.rb
) vagrant folder installation
Comments
Post a Comment