Vagrant: Unable to add a box from another drive under Windows

Created on 26 Aug 2013  路  8Comments  路  Source: hashicorp/vagrant

The console below is quite explicit:

        D:\travail\rmanTest>vagrant box add oracle C:\oracle.basebox
        Downloading or copying the box...
        鈫怺0KAn error occurred while downloading the remote file. The error
        message, if any, is reproduced below. Please fix this error and try
        again.

        Couldn't open file /oracle.basebox

Gotta love working with VMs on a 128Gb SSD drive -_- ...

bug

Most helpful comment

For some reason in my setup, the syntax file://drive:/whatever only worked if the command prompt was in the drive being used... If it was outside it didn't work... Worse, this behaviour seemed to depend whether curl was download a box or a metadata file

Use file:////fileserver/directories/file, it always works.

All 8 comments

Can you get me the VAGRANT_LOG=debug for this and gist it?

I can't reproduce this oddly enough. However, does this work if you do a vagrant box add with the path to the box as file:///C:/oracle.basebox?

As I deleted the previous homemade basebox, I downloaded the vagrant provided lucid64 and tried again. Here is the first reproduction, using windows's cmd as usual.

D:\travail\testVagrant>vagrant box add test c:\lucid64.box
Downloading or copying the box...
鈫怺0KAn error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file /lucid64.box

Then I tried your proposition, it's OK

D:\travail\testVagrant>vagrant box add test file:///C:/lucid64.box
Downloading or copying the box...
鈫怺0KExtracting box...ate: 126M/s, Estimated time remaining: --:--:--)
Successfully added box 'test' with provider 'virtualbox'!

Which reminded me of one other possibility. I have cygwin installed and its bin dir added to my PATH. I dunno about the way it works but I sometimes felt he is meddling with cmd's path. Whatever. I tried this

D:\travail\testVagrant>ls /cygdrive/c/lucid64.box
/cygdrive/c/lucid64.box
D:\travail\testVagrant>vagrant box add test /cygdrive/c/lucid64.box
Downloading or copying the box...
鈫怺0KAn error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file /cygdrive/c/lucid64.box

file:///... does the trick after a persistent struggle...

I'm not sure if this helps but I've been using a directory hack like this https://gist.github.com/Lightsword1942/7611354 to add data drives to VM's on separate drive letters. That generates a 300gb empty data drive in the current directory which can be on the D drive or any other, I imagine the same method would be useable for the primary image.

This is finally fixed in the f-boxes-2 branch. Native windows paths will work.

For some reason in my setup, the syntax file://drive:/whatever only worked if the command prompt was in the drive being used... If it was outside it didn't work... Worse, this behaviour seemed to depend whether curl was download a box or a metadata file

Use file:////fileserver/directories/file, it always works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OtezVikentiy picture OtezVikentiy  路  3Comments

barkingfoodog picture barkingfoodog  路  3Comments

tomhking picture tomhking  路  3Comments

dorinlazar picture dorinlazar  路  3Comments

bbaassssiiee picture bbaassssiiee  路  3Comments