Vagrant: The executable 'bsdtar' Vagrant is trying to run was not found in the %PATH% variable

Created on 7 May 2014  ยท  79Comments  ยท  Source: hashicorp/vagrant

I just upgraded to Vagrant v.1.6.0 and now I'm getting this error when trying to add a box:

PS C:\Vagrant\packer-example-master> vagrant box add --name trusty-tahr-0.1b "C:\Vagrant\packer-example-master\boxes\virtualbox\ubuntu1404-provisionerless0.1b.box"
==> box: Adding box 'trusty-tahr-0.1b' (v0) for provider:
    box: Downloading: file://C:/Vagrant/packer-example-master/boxes/virtualbox/ubuntu1404-provisi
onerless0.1b.box
    box: Progress: 100% (Rate: 53.9M/s, Estimated time remaining: --:--:--)
The executable 'bsdtar' Vagrant is trying to run was not
found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path.

All 79 comments

I tried using bsdtar.exe from: https://code.google.com/p/i18n-zh/downloads/detail?name=bsdtar.exe&can=2&q= but, it resulted in a different error:

PS C:\Vagrant\packer-example-master> vagrant box add --name trusty-tahr-0.1b "boxes\virtualbox\ub
untu1404-provisionerless0.1b.box"
==> box: Adding box 'trusty-tahr-0.1b' (v0) for provider:
    box: Downloading: file://C:/Vagrant/packer-example-master/boxes/virtualbox/ubuntu1404-provisi
onerless0.1b.box
    box: Progress: 100% (Rate: 57.6M/s, Estimated time remaining: --:--:--)
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):

x Vagrantfile
x box.ovf
x metadata.json
x ubuntu1404-disk1.vmdk: Write failed
Packer/bsdtar.EXE: Error exit delayed from previous errors.

Is there a bsdtar.exe that is recommended for use with Vagrant v1.6.0?

I also tried the bsdtar from the MinGW package and now I get a different error.

PS C:\Vagrant\packer-example-master> vagrant box add --name trusty-tahr-0.1b "boxes\virtualbox\ubuntu1404-provisionerless0.1b.box"
==> box: Adding box 'trusty-tahr-0.1b' (v0) for provider:
    box: Downloading: file://C:/Vagrant/packer-example-master/boxes/virtualbox/ubuntu1404-provisi
onerless0.1b.box
    box: Progress: 100% (Rate: 53.6M/s, Estimated time remaining: --:--:--)
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):

I'll be downgrading back to v1.5.4 for now.

I am also hitting this issue with Vagrant 1.6.0 on Windows.

same thing with me when I try vagrant box add box_name local_path

there is bsdtar executable in c:HashiCorpVagrantembeddedmingwbin;
i just added it into my PATH variable

Actually, no... I thought that would do the trick, but I still get the same error. Removing my thumbs up post.

Relogin or just restart command prompt

I restarted powershell.

Sorry, i don't know then. worked for me.

After rebooting, I still get an error.

PS C:\Vagrant\packer-example-master> vagrant box add --name trusty-tahr-0.1b "boxes\virtualbox\ubuntu1404-provisionerless0.1b.box"
==> box: Adding box 'trusty-tahr-0.1b' (v0) for provider:
    box: Downloading: file://C:/Vagrant/packer-example-master/boxes/virtualbox/ubuntu1404-provisionerless0.1b.box
    box: Progress: 100% (Rate: 52.2M/s, Estimated time remaining: --:--:--)
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):

x Vagrantfile
x box.ovf
x metadata.json
x ubuntu1404-disk1.vmdk: Write failed
bin/bsdtar.EXE: Error exit delayed from previous errors.

So, I checked bsdtar --version:

PS C:\Vagrant\packer-example-master> bsdtar --version
bsdtar 2.8.3 - libarchive 2.8.3

Maybe your downloaded bsdtar binary prevent using from vagrant ones now
Just remove all of them

The output of bsdtar --version shows it's picking up the correct version embedded with Vagrant. But, I did delete the others just to make sure. Still same error.

+1, same error with 1.6 on windows. Going back to 1.5.4

Well... taking @Guria's advice, I added C:\HashiCorp\Vagrant\embedded\mingw\bin to my PATH variable. It didn't work initially even after removing the other bsdtar.exe files I had downloaded while trying to get it to work.

To make things even more confusing, I was encountering a different error when trying to run packer build -only virtualbox-iso packer.json:

==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Error creating VM: VBoxManage error: VBoxManage.exe: error: Machine settings file 
'C:\VirtualBox VMs\ubuntu1404\ubuntu1404.vbox' already exists
==> virtualbox-iso: VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Machine, interface I
achine, callee IUnknown

So, that would seem to indicate that the vbox file already exists, and it does. So, some of this is likely user error. But, I ended up uninstalling Vagrant v1.6.0 and then I installed Vagrant v1.5.4. But, I still got the same errors when trying to do the things I had been doing for the past 3 days without any issues. So, I reinstalled Vagrant v1.6.0 and rebooted again.

Long story short, I ended up getting it to work. But, I had to remove all of my vagrant created machines from Virtual Box, then at some point I also did a vagrant box remove whatever for any that showed up in vagrant box list. Then, I was able to add the two machines back in with the command that was failing initially (i.e. vagrant box add --name trusty-tahr-0.1b "boxes\virtualbox\ubuntu1404-provisionerless0.1b.box").

I can't reproduce this. The bsdtar.exe is in embeddedgnuwin32bin. I've deleted and installed Vagrant from scratch and box adding still works. I need a repro case to be able to fix this or more debugging.

You should not have to download bsdtar manually.

Is bsdtar.exe at C:\HashiCorp\Vagrant\embedded\gnuwin32\bin?

I believe somehow people are getting this but I've tried on 3 sep windows machiens now as an upgrade and as a fresh install and haven't repro'd this. Please provide more info.

Did I mention I'm using Packer v0.60 too.

@mitchellh - Did you clear out the PATH entry when you uninstalled and reinstalled?

It seems 1.5.4 doesn't require a PATH entry for bsdtar, but 1.6 does.

@dcarrith Yep, no PATH set at all actually except C:\HashiCorp\Vagrant\bin. Still can't repro, because Vagrant sets its own PATH toinclude gnuwin32.

@mitchellh - I noticed something that might be helpful. I completely uninstalled vagrant from my system and ensured that it's installation directory was gone. (I also deleted the contents of my .vagrant.d folder). I then installed 1.6.0 from scratch, and noticed that the error stopped happening. After that, I once again completely uninstalled vagrant, and then installed 1.5.4, followed by an upgrade to 1.6.0, and the error came back.

@keiths-osc That did help! I was able to see the bsdtar.exe disappear from that directory. VERY odd. I'll try to figure out more but at least right now there is a workaround to reinstall Vagrant from scratch.

@mitchellh, I'm glad that helped! I double checked and found that when my system was getting the error, bsdtar.exe was in fact missing from the gnuwin32bin directory (but still exists in mingwbin). When everything was working, bsdtar.exe existed in both gnuwin32bin and mingwbin. Even though there appears to be a work-around, would it be appropriate to re-open this issue since you have been able to reproduce?

I've spent about half an hour trying to figure it out and can't. If someone with more WIndows MSI building experience wants to take a look at the "package" directory in the "vagrant-installers" repo and offer help, I'd apprecaite it.

+1, same error with 1.6.2 on windows.

+1 same error with vagrant 1.6.2 on Windows 7. We are going to try to do a clean install and see if this error reoccurs.

So this was a clean install of Vagrant on a Windows system. Removing vagrant, reboot, install vagrant, reboot cleared the issue. Unclear what causes this problem. Trying to help folks to use vagrant and telling them they will have to install twice will not be great.

Got the same error here upgrading from 1.5, the bsdtar executable is not present in the C:HashiCorpVagrantembeddedgnuwin32bin folder, on Windows x64 :(

Also for me a uninstall + reboot + fresh install worked, it seems that the update it's broken.

Any new hints? @ingro, _uninstall + reboot + fresh_ did not work for you? We have here the same problems (windows 8.1, 64bit)

@wiesson It did work for me, now the file is present in the correct directory.

Worked fine for by removing the upgraded installation and installing it fresh, even without restart.
Using Win8.1, 64bit

Also had the "bsdtar not found"-issue (using Win 8.1, 64bit) after upgrade from 1.4.x to 1.6.2.
Uninstall + reinstall of vagrant 1.6.2 worked for me.

Had to manually add vboxmanage to the path, however. Did previous vagrant installations find vb from registry?

Native support for Hyper-V (1.5) and Windows (1.6) are awesome, btw.

Like several others said, I had the same issue when I did an upgrade from 1.5.x, but complete removal and reinstallation worked properly.

In my case, I checked and saw that the bsdtar executable _was_ in the correct place, but was not found anyway.

Encountered same problem. Updating from 1.5.3 to 1.6.2:

C:\GitHub\vcloud-win>vagrant box add --name windows_2008_r2 dummy_box\dummy.box
==> box: Adding box 'windows_2008_r2' (v0) for provider:
    box: Downloading: file://C:/GitHub/vcloud-win/dummy_box/dummy.box
    box: Progress: 100% (Rate: 10240/s, Estimated time remaining: 0:00:01)
The executable 'bsdtar' Vagrant is trying to run was not
found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path.

C:\GitHub\vcloud-win>dir \HashiCorp\Vagrant\embedded\gnuwin32\bin
 Volume in drive C is Windows 2012 R2
 Volume Serial Number is 846D-14D6

 Directory of C:\HashiCorp\Vagrant\embedded\gnuwin32\bin

19.05.2014  21:11    <DIR>          .
19.05.2014  21:11    <DIR>          ..
29.04.2014  22:48         1.209.161 libarchive.dll
               1 File(s)      1.209.161 bytes
               2 Dir(s)  72.935.911.424 bytes free

C:\GitHub\vcloud-win>

I will checkout the vagrant-installers repo and have a look at it...

We could definitely solve this problem by uninstalling and deleting the whole C:\HashiCorp\* folder and reinstalling the latest available version of vagrant.

@mitchellh, I first have created a small repo test-vagrant-update to replicate the problem, and indeed, the bsdtar.exe is also missing after the update. Thanks to your vagrantcloud and thanks to @ferventcoder I found a win7 box, so everyone could replay the problem in a save win7 box. Tomorrow I will look into the msi logs.

I have found two messages in the msi log while updating 1.5.3 to 1.6.2:

MSI (s) (78:78) [22:33:36:533]: Disallowing installation of component: {57FD6298-3821-4E4A-AF50-4DFF89B48142} since the same component with higher versioned keyfile exists
MSI (s) (78:78) [22:33:36:533]: Disallowing installation of component: {8C99AA3D-1415-419C-834D-E4B4766EDEBD} since the same component with higher versioned keyfile exists

And then I have found this link at stackoverflow wix major upgrade not installing all files which seems to be the same problem here.

And the possible solution seems to be:

To work around the problem, you need to move your RemoveExistingProducts action later. If you're using the MajorUpgrade element then Schedule='afterInstallExecute' or Schedule='afterInstallFinalize' should do the trick. You'll need to be more careful with the Component Rules.

I cannot test this as I can't build the installer for windows. Just pointing to the right direction.

Problem seems to be that the old bsdtar.exe and bsdcpio.exe of Vagrant_1.5.3.msi both have a version info in the exe: 2.4.12.3100
The bsdtar.exe and bsdcpio.exe of Vagrant_1.6.2.msi don't have such a FileVersion. This is then also missing in the MSI File entry.

I don't know how to get around of the automatic version check of MSI in this case. A cleaner way would be that the new bsdtar.exe/bsdcpio.exe also have a version info that should be 3.1.2.0 or something like that.

I have patched my Vagrant_1.6.2.msi with SuperOrca with at least 2.4.10.3100 and the update 1.5.3 to 1.6.2 was successful.

Or you may use the bsdtar.exe in the mingwbin directory which has version 2.8.3 and also will be installed with the current update. But I don't know how vagrant builds its internal PATH to these embedded directories.

I had the exact same issue, after upgrading (not sure which version), to the latest. Uninstalling + installing again fixed the issue.

Updating from 1.6.1 to 1.6.2 and rebooting was enough for me to fix the issue, on a Win7 64bit.

I had gone from 1.5.3 to 1.6.1.

(And thank you for a great tool :)

Just upgraded to version 1.6.2 from version 1.5.4. Vagrant version 1.6.2 doesn't seem to come with bsdtar.exe. Doing the the following solves it for me:

  • Downloaded bsdtar.exe from here
  • Drop bsdtar.exe in a folder that's included in your PATH variable

The downloaded archive file ironically is compressed with both tar and lzma. I have left an unpacked version here. On Ubuntu, you may use the following commands to extract bsdtar.exe from the downloaded basic-bsdtar-2.8.3-1-mingw32-bin.tar.lzma.

unlzma basic-bsdtar-2.8.3-1-mingw32-bin.tar.lzma
tar xvf basic-bsdtar-2.8.3-1-mingw32-bin.tar

Hope it helps someone.

Same problem here. Unfortunately for me, uninstalling and reinstalling didn't help, neither did rebooting.

Edit: manually adding \path\to\Vagrant\embedded\gnuwin32\bin to my PATH did the trick.

As users still struggling upgrading from 1.5 to 1.6, I thought about adding a version resource to the two missing binaries bsdtar.exe and bsdcpio.exe so that the MSI installer does install the current versions.

I found a small tool to patch a version info into exe files at codeplex: verpatch

A sample call would look like this:

verpatch.exe bsdtar.exe /va 2.8.3.0 /pv 2.8.3.0

@mitchellh what do you think about doing it that way?

I know it is some kind of monkey-patch, but I don't know where these binaries are maintained to ask to add the version infos there. So it might be better to have it fixed for Vagrant 1.6.3 this way.

Another idea is to patch the vagrant-files.wxs file generated by heat.exe, but I do not have a working WiX environment to check it out.

I will send a PR into vagrant-installerrs repo so you can have a look at it. I don't know how to build a windows machine to build vagrant for windows to run the package.ps1 by myself. Perhaps you can give me some hints to build it from scratch.

Same here. No bsdtar found in C:\HashiCorp\Vagrant\embedded\gnuwin32\bin. Maybe the Vagrant upgrade process has a bug? (I am upgraded from 1.5)

@gsbabil has the right solution. But I don't even need to add it to my PATH. Just make sure bsdtar.exe is in C:\HashiCorp\Vagrant\embedded\gnuwin32\bin

I had the same issue when upgrading from 1.5.x to 1.6.3. Can this issue please be reopened? There's clearly a bug in the upgrade path here.

I had the same issue when upgrading from 1.5.x to 1.6.3. Uninstalling, deleting C:HashiCorp and reinstalling worked as well.

This issue is not resolved :( I'm on Windows 7 and still cant get it working. I upgraded from 1.5.x to 1.6.3 and got the bsdtar missing error. Checked C:HashiCorpVagrantembeddedgnuwin32bin and only libarchive.dll was present. So I uninstalled, removed the folder, and reinstalled 1.6.3. Now bsdtar.exe and bsdcpio.exe are present, but they throw an application error:
image

I had the same error after upgrading from an older version of Vagrant (1.3 if I remember correctly).
My C:\HashiCorp\Vagrant\embedded\gnuwin32\bin path only contained libarchive.dll

I re-ran the installer (without deleting the HashiCorp directory first), but clicked "Repair" instead of "Remove". That added the missing bsdtar.exe and bsdcpio.exe files to the gnuwin32bin directory. Not sure if it fixed anything else, but everything is working now.

Adding C:\HashiCorp\Vagrant\embedded\mingw\bin to my PATH worked for me.

I had this problem on windows 8 with vagrant 1.6.3

I then ran the installer again and "repaired" the install and it fixed the problem.

Running the repair from the Windows Control Panel also resolves the problem.

Upgraded from 1.5.4 to 1.6.3 on Windows 7 x64 and ran into this on installing a new box.

To update with Chocolatey, my way to update from 1.4.2 to 1.6.3 was

cinst vagrant
cinst vagrant -force

Then the c:\HashiCorp\Vagrant\embedded\gnuwin32\bin\bsdtar.exe reappears after the second installation.

I'll have a look at the vagrant-installers again to suggest another fix without verpatch tool.

Doing what @Aethylred suggested, running the Repair function under, solved the problem for me too.

upgrade to 1.6.3 got same issue, reinstall Vagrant fixed this issue

Running the repair function solved the problem.

I had same issue.
Uninstalling previous version then install new version fixed it. I didn't have to set any PATH variable manually.

If it helps! Had this issue and repairing fixed it for me. My embedded\gnuwin32\bin folder only contained 1 file which was libarchive.dll. This is on vagrant_1.6.3.msi. I did not need to reboot or modify my path after the repair (I did restart command prompt)

The solution provided by vmichnowicz worked for me :)
Thanks!

@StefanScherer bsdtar.exe and bsdcpio.exe were added to C:\HashiCorp\Vagrant\embedded\gnuwin32\bin (vagrant v1.6.3) after executing cinst vagrant -force. (+1) Thank you.

@vmichnowicz Same thing here.

@hyperfocus1337 @viion I can confirm this

There seem to be different ways to resolve this, the easiest one probably being the one mentioned by vmichnowicz. Since I have cygwin installed on Windows, I just installed bsdtar via cygwin and that fixed the issue for me.

Same issue, fresh install, Windows 7, Vagrant installer 1.6.5. Running repair did not work. Installing bsdtar (libarchive) independently also did not work.

Repairing Vagrant via 'Programs and features' on Windows 8.1 worked for me

Same problem. Programs and Features Repair tool worked for me. Windows 7.

I solved it by adding C:/Hashicorp/Vagrant/embedded/bin and C:/Hashicorp/Vagrant/embedded/gnuwin32/bin to my PATH manually.

I can vouch for djberg's reply - it would be good if the Vagrant installation does this automatically (if not already).

Had this issue in Windows, first I verified I could run bsdtar by adding this to my path:

C:\Dev>set PATH=c:\HashiCorp\Vagrant\embedded\mingw\bin\;%PATH%
C:\Dev>bsdtar /?
Usage:
  List:    bsdtar -tf <archive-filename>
  Extract: bsdtar -xf <archive-filename>
  Create:  bsdtar -cf <archive-filename> [filenames...]
  Help:    bsdtar --help

Then verified the box is not corrupted:

C:\Dev>bsdtar -v -t -f centos64mini2.box
-rw-------  0 g staff 890792448 Aug 29 13:48 ./box-disk1.vmdk
-rw-------  0 g staff     13189 Aug 29 13:45 ./box.ovf
-rw-r--r--  0 g staff       505 Aug 29 13:48 ./Vagrantfile

I used procmon and found the command to run bsdtar.exe was:
PID: 4232
Command line: "C:HashiCorpVagrantembeddedgnuwin32bin/bsdtar.EXE" -v -x -m -C C:/Dev/VAGRANTD/tmp/vagrant-box-add-temp-20141022-3884-6yipz0 -f C:/Dev/VAGRANTD/tmp/box2c103f8c5685a2e4f28dddae40f6dc372f86f240

And when attempting to execute bsdtar.EXE manually from gnuwin32 path I get this error:
"The procedure entry point _mkgmtime64 could not be located in the dynamic link library msvcrt.dll"
which might imply an issue with Microsoft Visual C redistributable libraries. As a workaround, I rename
C:HashiCorpvagrantembeddedgnuwin32bin to C:HashiCorpvagrantembeddedgnuwin32bin.old and create a new "bin" directory where I copy bsdtar.exe and bsdcpio.exe from C:HashiCorpVagrantembeddedmingwbin.

Hope this saves you some trouble!

Encountered the same problem, as @djberg96 stated, repairing the install worked perfectly.

I fix problem "The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):" in Windows XP 32.

Rename "C:HashiCorpVagrantembeddedgnuwin32bin" in "C:HashiCorpVagrantembeddedgnuwin32bin.old"
Create folder "C:HashiCorpVagrantembeddedgnuwin32bin"
Download:
http://downloads.sourceforge.net/gnuwin32/libarchive-2.4.12-1-bin.zip
http://gnuwin32.sourceforge.net/downlinks/bzip2-bin-zip.php
http://gnuwin32.sourceforge.net/downlinks/zlib-bin-zip.php
Unpacked all. Copy files from all bin/_.exe and bin/_.dll in to "C:HashiCorpVagrantembeddedgnuwin32bin".

Anyway, It would be better to check bsdtar.exe befor downloading.

I was unable to run "bsdtar --version" ... adding the zlib1.dll to gnuwin32bin directory as @tatarinov mentioned fixed the problem.

@mitchellh I'm still seeing this issue with vagrant 1.7.2 on Windows 7 with a limited rights user account. Manually adding the C:HashiCorpVagrantembeddedgnuwin32bin folder to my path as admin resolved the issue. As to why I'd have this setup...corporate rules. Is it possible for vagrant to set the path for bsdtar in a way that doesn't require admin escalation other than at install time perhaps an additional environment variable?

On Windows 8.1. It seems I only get this message when I try to vagrant up from git bash. It did not happen for me on cmd. If you get this message in WIndows, please try running vagrant up from a cmd window.

Just add C:HashiCorpVagrantembeddedmingwbin in your PATH solved this issue on Windows 10 with vagrant 1.7.1

Faced this problem with git bash. Used windows cmd for vagrant box add and it works properly.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rhencke picture rhencke  ยท  3Comments

tomhking picture tomhking  ยท  3Comments

StefanScherer picture StefanScherer  ยท  3Comments

janw-me picture janw-me  ยท  3Comments

lebogan picture lebogan  ยท  3Comments