Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant commands not working for Hyper-V provisioner #9775

Closed
oldluke92 opened this issue May 4, 2018 · 2 comments · Fixed by #9784
Closed

Vagrant commands not working for Hyper-V provisioner #9775

oldluke92 opened this issue May 4, 2018 · 2 comments · Fixed by #9784

Comments

@oldluke92
Copy link

Vagrant version

2.1.0

Host operating system

Windows 10 v1803 (April Update)

Guest operating system

Ubuntu 16.04

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "generic/ubuntu1604"
end

Debug output

vagrant destroy log

Expected behavior

Vagrant command should be executed

Actual behavior

Error occures:

C:/HashiCorp/Vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/machine.rb:164:in `action': undefined method `fire_triggers' for nil:NilClass (NoMethodError)
[...]

Steps to reproduce

  1. Get a pc with Windows 10 pro x64 and HyperV
  2. Install Vagrant 2.1.0
  3. Place the contents of the mentioned Vagrantfile above in a Vagrantfile in some directory
  4. Repair the 'vagrant up' Command (see Vagrant up with Hyper-V fails on -switchname for import_vm_vmcx.ps1 script #9774 )
  5. Start powershell as administrator (Click on the windows logo on your windows taskbar, type "powershell", right-click the "Windows Powershell" entry and click the "Run as Administrator" option.
  6. Navigate to the directory with the above mentioned Vagrantfile in the powershell window
  7. type 'vagrant up', hit enter and wait for the VM to be created and booted
  8. try using 'vagrant halt', 'vagrant destroy', 'vagrant ssh' or 'vagrant provision' (I'm pretty sure any other command will fail too, but these are the ones I tested)
@chrisroberts chrisroberts added this to the 2.1.1 milestone May 4, 2018
@briancain briancain self-assigned this May 4, 2018
briancain added a commit to briancain/vagrant that referenced this issue May 4, 2018
Prior to this commit, the hyper-v provider called an action on a machine
that hadn't fully finished initializing. This commit fixes that by
moving up the initialization of the triggers object next to the rest of
the instance variables of the machine object.
briancain added a commit to briancain/vagrant that referenced this issue May 4, 2018
Prior to this commit, the hyper-v provider called an action on a machine
that hadn't fully finished initializing. This commit fixes that by
moving up the initialization of the triggers object next to the rest of
the instance variables of the machine object.
briancain added a commit to briancain/vagrant that referenced this issue May 4, 2018
Prior to this commit, the hyper-v provider called an action on a machine
that hadn't fully finished initializing. This commit fixes that by
moving up the initialization of the triggers object next to the rest of
the instance variables of the machine object.
@josenk
Copy link

josenk commented May 7, 2018

Also a problem with vagrant-vmware-esxi.
josenk/vagrant-vmware-esxi#39

I can confirm the problem is resolved in Vagrant 2.1.1.dev.

@ghost
Copy link

ghost commented Mar 30, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants