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

Windows WSL error: VBoxManage.exe: error: Could not create the directory 'C:\WINDOWS\system32\C:\VMs\ubuntu-xenial-16.04-cloudimg-20180413' (VERR_INVALID_NAME) #20

Open
JLofgren opened this issue Apr 14, 2018 · 7 comments

Comments

@JLofgren
Copy link

Summary

Plugin fails with a path error when used in WSL.

Environment

Vagrant 2.0.1
VirtualBox 5.2.8
Windows 10 WSL with Ubuntu 16.04

Steps to reproduce

-Install Windows WSL with Ubuntu 16.04. Install vagrant therein. Setup is described here.
-vagrant init ubuntu/xenial
-use the disksize plugin in the VagrantFile

config.disksize.size = '20GB'

-vagrant up

Expected Behavior

Will successfully set the size of the disk.

Actual Behavior

==> default: Running 'pre-boot' VM customizations...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["clonemedium", "C:\\VMs\\ubuntu-xenial-16.04-cloudimg-20180413\\ubuntu-xenial-16.04-cloudimg.vmdk", "./C:\\VMs\\ubuntu-xenial-16.04-cloudimg-20180413\\ubuntu-xenial-16.04-cloudimg.vdi", "--format", "VDI"]

Stderr: 0%...
Progress state: VBOX_E_IPRT_ERROR
VBoxManage.exe: error: Failed to clone medium
VBoxManage.exe: error: Could not create the directory 'C:\WINDOWS\system32\C:\VMs\ubuntu-xenial-16.04-cloudimg-20180413' (VERR_INVALID_NAME)
VBoxManage.exe: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component VirtualBoxWrap, interface IVirtualBox
VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl handleCloneMedium(struct HandlerArg *)" at line 990 of file VBoxManageDisk.cpp
@BuhtigithuB
Copy link

I had this clone error while trying to manually convert vdi box to vmdk box, but I was supplying --variant ESX parameter... Which in the command display above passed from vagrant assuming there is nothing else occuring behind the scene is not the case...

In my case and base on what is discussed here :

https://apple.stackexchange.com/questions/271561/which-vboxmanage-clonehd-variant-corresponds-to-the-gui-selection-dynamically

I remove the --variant switch from the command and it clone successefully afterward...

Maybe not related, but it migth help finding the issue...

@BuhtigithuB
Copy link

Here I think it was mention : https://www.virtualbox.org/ticket/9673

Sorry

@JLofgren
Copy link
Author

JLofgren commented Jul 6, 2018

@BuhtigithuB Thanks, but pretty sure that is unrelated. The error I got is clearly a path issue: C:\WINDOWS\system32\C:\VMs\ubuntu-xenial-16.04-cloudimg-20180413 is clearly not a valid path. It looks to me like the plugin is making some assumptions about the environment that it is working in, and those assumptions don't align with the WSL.

@lotherk
Copy link

lotherk commented Oct 17, 2018

@JLofgren I've managed to make it work. It is a dirty fix and doesn't clean up the old disk. master...lotherk:fix_wsl_dst_file I currently don't have time to improve it but may be a starting point for someone else to write an actual fix.

henning-erlandsen added a commit to henning-erlandsen/vagrant-disksize that referenced this issue Jan 10, 2019
@henning-erlandsen
Copy link

Hi! Bumped into this issue as well. Made this fix that worked for me locally
#27

miikkij added a commit to miikkij/vagrant-disksize that referenced this issue May 28, 2019
@cdausmus
Copy link

cdausmus commented Dec 9, 2020

Any chance we can get a new release cut with this included?

@AsharLohmar
Copy link

AsharLohmar commented Jun 17, 2021

I'm not good with Ruby, even less with pull-requests, but here's my alternative solution:

# actions.rb
        def generate_resizable_disk(disk)
          src = "" + disk[:file]
          src_extn = File.extname(src)
          dst = src.delete_suffix!(src_extn) + '.vdi'
          disk.merge({ uuid: "(undefined)", file: dst })
        end

kumattau added a commit to kumattau/vagrant-disksize that referenced this issue Nov 5, 2023
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

No branches or pull requests

6 participants