-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Locked .vhdx files after vagrant up #8754
Comments
Anyone, anything about this issue? Am I the only one struggling with this problem? |
We faced the same problem. Omitting the mentioned files during bootstrapping was the only workaround we applied so far. |
I am running Vagrant 2.1.5 on Win10 Enterprise build 16299.309 and running into the above issue. When trying to run vagrant destroy: My Vagrantfile is:
The virtual machine is not present in Hyper-V anymore but something is preventing it from being deleted completed, how can I fix this? I noticed @kpatryk mentioned omitting files, I am new to Vagrant, how would I do that? |
Are these Vagrant environments being interacted with from WSL at all? |
@chrisroberts Sorry, I am not sure what WSL stands for? I am using PowerShell and Hyper-V. A |
WSL stands for Windows Subsystem for Linux. Regarding my modification - this is my version of machine.rb. This is not based on the latest version of machine.rb. Changed part is 343:368. But remember it is not a solution but a dirty workaround. |
@Owdaan Thank you and understood regarding it being a dirty workaround. That said, I edited my @chrisroberts I am not using a WSL, this is directly on a windows machine. |
I spent some time attempting to reproduce this behavior but was unable to. Vagrant was able to cleanly destroy all guests that I created. Some things that may help with being able to reproduce this and determine the underlying cause of the issue:
Thanks! |
Yes, I've experienced that on systems that were up to date. Right now there is Windows Defender running with Real-time protection on and also Cisco AMP. However, I had the same issue without Cisco AMP in background.
|
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. |
Vagrant version
Vagrant 1.9.6 (on 1.9.5 problem was exactly the same)
Host operating system
Windows 10 1703
Guest operating system
Does not matter - checked with several (Ubuntu, CentOS, Suse)
Vagrantfile
Tested with several Vagrantfiles, and this does not matter. Example Vagrantfile:
Debug output
Log after VM was destroyed half manually
Log after machine.rb modification
For details about non standard lines "Ommiting (...)" and half manually removing VM refer to actual behavior section.
Expected behavior
VM created only needed .vhdx files (for example .vagrant\machines\default\hyperv\Virtual Hard Disks\generic-debian9-hyperv.vhdx). Both up and destroy should work and all VM data should be easy to remove.
Actual behavior
More files are created during VM reation. All are named randomly (in pattern: [\w]{8}.[\w]{3}.vhdx ). It's not possible to remove those files before restart of whole host. I have made some changes in machine.rb to be able to restart VM (simple added a regexp to ommit those files).
It happens on every .box which was exported in new MS standard (with vmrs and vmcx files instead of old xml). Old boxes are imported properly.
Without my modification in machine.rb, it is not possible to start again a vm only. Even after manual cleanup (see in gist).
I've also checked that file is holded by System process - however it's not visible with PackageExplorer (LockHunter finds this file as locked).
Checked on more than one computer.
Steps to reproduce
The text was updated successfully, but these errors were encountered: