WinRb / vagrant-windows

Other
444 stars 83 forks source link

Windows-7 setting host name fails with 'Invalid Verb Switch. #14

Closed hh closed 11 years ago

hh commented 11 years ago

Vagrant file from https://github.com/chef-azure/azure-cookbook/blob/master/Vagrantfile#L56

I'm not sure what it's setting the hostname to here

  config.vm.define :windows7 do |windows7_config|
    windows7_config.vm.host_name = "azure-windows7-workstation"
    windows7_config.vm.box = "windows-7-enterprise"
    windows7_config.vm.box_url = "./windows-7-enterprise.box" # github/opscode/bento
    windows7_config.vm.network :hostonly, "33.33.33.11"
    #...
  end

With a basebox build from https://github.com/opscode/bento/blob/master/definitions/windows-7-enterprise/definition.rb

[windows7] Importing base box 'windows-7-enterprise'...
[windows7] Matching MAC address for NAT networking...
[windows7] Clearing any previously set forwarded ports...
[windows7] Fixed port collision for 22 => 2200. Now on port 2201.
[windows7] Forwarding ports...
[windows7] -- 22 => 2201 (adapter 1)
[windows7] -- 3389 => 3390 (adapter 1)
[windows7] -- 5985 => 5985 (adapter 1)
[Berkshelf] installing cookbooks...
[Berkshelf] Using azure (0.1.0) at path: '/home/user/azure/azure-cookbook'
[windows7] Creating shared folders metadata...
[windows7] Clearing any previously set network interfaces...
[windows7] Preparing network interfaces based on configuration...
[windows7] Running any VM customizations...
[windows7] Booting VM...
[windows7] Waiting for VM to boot. This can take a few minutes.
vagrant-win7ent
[windows7] VM booted and ready for use!
[windows7] Configuring and enabling network interfaces...

[windows7] Setting host name...
Invalid Verb Switch.
translation missing: en.vagrant.errors.winrm_bad_exit_status
pmorton commented 11 years ago

I think that the following commit will solve the problem. Can you confirm?

https://github.com/BIAINC/vagrant-windows/pull/6/files#L3R15

hh commented 11 years ago

I'm trying to figure out how to use http://files.vagrantup.com/packages/476b19a9e5f499b5d0b9d4aba5c0b16ebe434311/vagrant_x86_64.deb and eventually https://opscode-omnitruck-release.s3.amazonaws.com/ubuntu/11.04/x86_64/chef_10.18.2-2.ubuntu.11.04_amd64.deb as it sounds like Vagrant will no longer be distributed as a gem. I've been playing with paths and such to get it all working together but it is frustrated. Which ruby should I be installing this gem into? /opt/chef or /opt/vagrant? I tried /opt/vagrant but it over-writes vagrant 1.0.6 (which is what I download and install via .deb).

hh commented 11 years ago
hh@M18xR2:~/chef/vagrant-windows (for-upstream)] 
☺ ➔  sudo dpkg -i /home/hh/Downloads/vagrant_x86_64.deb 
Selecting previously unselected package vagrant.
(Reading database ... 154615 files and directories currently installed.)
Unpacking vagrant (from .../Downloads/vagrant_x86_64.deb) ...
Setting up vagrant (1.0.6) ...
[hh@M18xR2:~/chef/vagrant-windows (for-upstream)] 
☺ ➔  git remote -v
origin  git://github.com/leftathome/vagrant-windows.git (fetch)
origin  git://github.com/leftathome/vagrant-windows.git (push)
[hh@M18xR2:~/chef/vagrant-windows (for-upstream)] 
☺ ➔ /opt/vagrant/embedded/bin/gem build vagrant-windows.gemspec 
WARNING:  no homepage specified
  Successfully built RubyGem
  Name: vagrant-windows
  Version: 0.1.3
  File: vagrant-windows-0.1.3.gem
[hh@M18xR2:~/chef/vagrant-windows (for-upstream)] 
☺ ➔   sudo /opt/vagrant/embedded/bin/gem install vagrant-windows-0.1.3.gem  --no-rdoc --no-ri
Building native extensions.  This could take a while...
Fetching: gssapi-1.0.3.gem (100%)
Fetching: nokogiri-1.5.6.gem (100%)
Building native extensions.  This could take a while...
Fetching: httpclient-2.2.0.2.gem (100%)
Fetching: rubyntlm-0.1.1.gem (100%)
Fetching: uuidtools-2.1.3.gem (100%)
Fetching: builder-3.1.4.gem (100%)
Fetching: nori-1.1.4.gem (100%)
Fetching: rack-1.5.1.gem (100%)
Fetching: httpi-0.9.7.gem (100%)
Fetching: wasabi-1.0.0.gem (100%)
Fetching: gyoku-1.0.0.gem (100%)
Fetching: akami-1.2.0.gem (100%)
Fetching: savon-0.9.5.gem (100%)
Fetching: little-plugger-1.1.3.gem (100%)
Fetching: logging-1.6.2.gem (100%)
Fetching: winrm-1.1.2.gem (100%)
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Fetching: childprocess-0.3.7.gem (100%)
Fetching: erubis-2.7.0.gem (100%)
Fetching: i18n-0.6.1.gem (100%)
Fetching: log4r-1.1.10.gem (100%)
Fetching: net-ssh-2.2.2.gem (100%)
Fetching: net-scp-1.0.4.gem (100%)
Fetching: vagrant-1.0.6.gem (100%)
Fetching: highline-1.6.15.gem (100%)
Successfully installed ffi-1.3.1
Successfully installed gssapi-1.0.3
Successfully installed nokogiri-1.5.6
Successfully installed httpclient-2.2.0.2
Successfully installed rubyntlm-0.1.1
Successfully installed uuidtools-2.1.3
Successfully installed builder-3.1.4
Successfully installed nori-1.1.4
Successfully installed rack-1.5.1
Successfully installed httpi-0.9.7
Successfully installed wasabi-1.0.0
Successfully installed gyoku-1.0.0
Successfully installed akami-1.2.0
Successfully installed savon-0.9.5
Successfully installed little-plugger-1.1.3
Successfully installed logging-1.6.2
Successfully installed winrm-1.1.2
Successfully installed archive-tar-minitar-0.5.2
Successfully installed childprocess-0.3.7
Successfully installed erubis-2.7.0
Successfully installed i18n-0.6.1
Successfully installed log4r-1.1.10
Successfully installed net-ssh-2.2.2
Successfully installed net-scp-1.0.4
Successfully installed vagrant-1.0.6
Successfully installed highline-1.6.15
Successfully installed vagrant-windows-0.1.3
27 gems installed
[hh@M18xR2:~/chef/vagrant-windows (for-upstream)] 
☺ ➔  cd ../windows-fromscratch/
[hh@M18xR2:~/chef/windows-fromscratch (master)] 
☺ ➔  git remote -v
origin  git@github.com:hh/windows-fromscratch.git (fetch)
origin  git@github.com:hh/windows-fromscratch.git (push)
[hh@M18xR2:~/chef/windows-fromscratch (master)] 
☺ ➔  /opt/vagrant/bin/vagrant  up
/opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/config/top.rb:29:in `method_missing': undefined method `winrm' for #<Vagrant::Config::Top:0x00000001eb8a88> (NoMethodError)
    from /home/hh/chef/windows-fromscratch/Vagrantfile:6:in `block in <top (required)>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/config/loader.rb:83:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/config/loader.rb:83:in `block (2 levels) in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/config/loader.rb:79:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/config/loader.rb:79:in `block in load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/config/loader.rb:76:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/config/loader.rb:76:in `load'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/environment.rb:387:in `block in load_config!'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/environment.rb:392:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/environment.rb:392:in `load_config!'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/lib/vagrant/environment.rb:327:in `load!'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.0.6/bin/vagrant:40:in `<top (required)>'
    from /opt/vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
    from /opt/vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'
pmorton commented 11 years ago

@hh #25 addresses this issue. This has been merged into the 1.0 branch. Ping me if you are still having problems.