-
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
VMCX file format #6102
Comments
I don't think Vagrant currently works on Windows 10, but this looks like a separate issue. Thanks for reporting! |
@sethvargo Before creating box myself, I successfully ran https://atlas.hashicorp.com/serveit/boxes/centos-7, so using boxes based on previous hyper-v version seems to work |
I've created simple PowerShell script that generates XML file that can be understood by vagrant. Source: https://gist.github.com/Novakov/c640d65f1bf4cc7d7b7a |
@Novakov I've run your script and many thanks but where does it go in the box file? Currently I have a the VHD and VM directories and a js manifest file. Tried replacing the js but doesn't work. Do I just put "boxname".xml in there too? |
@sopwithpup It should be in VIrtual Machines folder as box.xml. I've also removed vmcx & vmrs files |
This is fixed! |
I don't understand how the issue is fixed. The code still requires an XML configuration file when importing a new box. The problem is that Hyper V on Windows 10 does not create such a file, instead they've moved to a (maybe proprietary?) binary VMCX format for the configuration files exported in the Virtual Machines directory. |
Oh sorry. I thought this had to do with generation 2 VMs. Thanks for pointing out my mistake. We'll require someone with Hyper-V expertise to come help us fix this, as we don't currently have a maintainer for it. |
For knowledge sharing purposes, I just found this blog post on reading VMCX files with PowerShell http://blogs.msdn.com/b/virtual_pc_guy/archive/2015/04/10/using-powershell-to-look-at-a-vm-configuration.aspx . I'll have to play with it later when I'm at my computer again. |
+1, same issue with Win10 |
Well, it seems to me like a pretty localized problem. We'll just need to update |
I would like to work on this to add support for .vmcx files. I agree that most of the work can be done in import_vm.ps1 Also, it looks import.rb tried to raise an error, but that this call itself failed and didn't pass the right arguments. So there is something going wrong with that too. That should be fixed as well, and may be a good first step to get meaningful output. Will check the Hyper-V errors class and see what may be going wrong. Step 0: Fix the Raise Error call parameters (trivial) Before starting any work on this, I would like to know from the Vagrant maintainers that I'm going in the right direction :) My thoughts are to leverage MSFT's native Hyper-V VM cmdlets to analyze the newer VMCX-based VMs. That way, we will be transparent to VM Configuration File version changes going forward. We could leave the old code that directly parses the XML in place, as there should be no changes from MSFT for XML-based configuration files. Only newer VM's with .VMCX/.VMRS files will change. By using Compare-VM, and then taking the hypothetical VM output, as shown in the technet blog post, we should be able to operate on that object natively using all of the standard Get-VM* commands. So it would switch from a text-based approach of parsing XML file contents, to one that uses the native PS Hyper-V objects. Should be a win for future-compatibility, as the burden is now on MSFT to figure out how to parse any future VMs. If this is the direction that the Vagrant team is OK with, I can give fixing this a shot. Are there any test-cases targeting this code path? Would be good to beef this up too, including error scenarios which don't seem to be covered (thus the problem with the error call). Some other notes: Here's the stack trace
|
Sorry for highjacking this @evancox10, had some time on my hand, and seemed like a fun thing to do :) Hmm, i was just looking at this and i'm slightly confused. From what i understand from the script, it reads the format and if some options are set, use the ones configured by the user. Why not just load the file, and just overwrite the few values someone might set on their Vagrantfile. It seems that would result in a clean copy of the configuration, but then as a new VM. I feel that could make the import command quite a lot simpler. Also it would enable to show incompatibilities, should those be in the machine. I've started to have a look at importing the VM this way, and seems to work on my Windows 10. Just need to rename the vhd's so they wont collide in name. Currently they keep the old name. Fun little exercise. |
@chrisroberts Milestone 2.0? This seems like it really isn't that big an feature, any rationale on why you added the tag? |
Hi @bbrala! The milestone assignment isn't immutable. There are hundreds of issues in the back log that I am getting sorted and queued. Their placement will change over time based on discussions/importance/pull requests/etc. Based on everything else, that's just the bucket this issue is in right now. Cheers! 😃 |
Ok cool, thinking or will help a lot of people if this gets in. Also combined with the (hopefully) soon to come hyper v integration in packer. Next thing I might do is make the package command work for hyper v. |
@evancox10 I ended up not using Compare-VM, I had issues with adjusting certain parts of hardware, and vagrant seems to copy the vhd(x) itself, which made it a bit akward. The PR is ready to go. So now we are just waiting for it to go through process of getting merged. |
@bbrala Awesome, no problems by me that someone else stepped up. Anything I can do to help test it out? I'll try to checkout the code this weekend and give it a spin. |
Yeah sure, checking the two PR's (Import and Package of Hyper V) would help loads. Import VMCX: #7854 Made a gist with instructions with getting up and running on Windows (https://gist.github.com/bbrala/7e96be8a4e26f14834e8bbc21d246c38), but you might already have a running enviroment. :) |
@evancox10 did you have a go at the two PR's? |
meant to comment here - I tested these and they both work after my patches, what needs to happen to get these pulled? |
Fixed via: #7854 |
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. |
I'm not sure where I should create issue regarding Hyper-V provider, so this is the same issue as https://github.com/MSOpenTech/vagrant-windows-hyperv/issues/73
After installing Windows 10 I wanted to play with vagrant and hyper-v. After creating a box, doing
vagrant up
failed with error:In the box there is configuration file but not in vmc format but new VMCX format which seems to be unsupported.
Does it mean that it is no longer possible/supported to create Vagrant box from Hyper-V machine?
The text was updated successfully, but these errors were encountered: