Skip to content

Fix/disk resize on wsl - #13799

Open
thabich wants to merge 2 commits into
hashicorp:mainfrom
thabich:fix/disk-resize-on-wsl
Open

Fix/disk resize on wsl#13799
thabich wants to merge 2 commits into
hashicorp:mainfrom
thabich:fix/disk-resize-on-wsl

Conversation

@thabich

@thabich thabich commented Mar 31, 2026

Copy link
Copy Markdown

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"

image

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.

@thabich
thabich requested a review from a team as a code owner March 31, 2026 16:11
@hashicorp-cla-app

hashicorp-cla-app Bot commented Mar 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@thabich

thabich commented Apr 7, 2026

Copy link
Copy Markdown
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant