Fix/disk resize on wsl - #13799
Open
thabich wants to merge 2 commits into
Open
Conversation
Author
|
@taru-garg-hashicorp sorry to bother, is there still active development on Vagrant? Is it worth to create another bug fix for another broken WSL feature? (it seems that it's not possible to use cloud-init, due to path issues with the iso build). Is there any chance to get my PR merged? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without the fix Vagrant will first fail due to an added ./ in front of the file names.
This command adds a ./ in front of destination (WSL only).
destination = File.join(File.dirname(source), File.basename(source, ".*")) + ".vdi"
I have tried in the least invasive way to avoid this for WSL, by simply removing it again.
At the point when a backup is being performed, there are larger path issues. The simple mv command, doesn't work on WSL, so I am using:
machine.provider.driver.clone_disk(defined_disk[:location], backup_disk_location, "VMDK")
to create a copy of the VMDK file. As this copy will receive a new UUID in case it's require, the UUID will be restored and the file will be moved back to it's old position. At this point we've reached the same situation as for non WSL setups.
The main approach is to fix the issue for WSL, while leaving the rest of the procedure untouched.