0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vagrant packageでVBoxManage: error: RTVfsFsStrmAdd failed for 'box.ovf' (VERR_ALREADY_EXISTS) というエラーの解決方法

0
Posted at

vagrant packageで VBoxManage: error: RTVfsFsStrmAdd failed for 'box.ovf' (VERR_ALREADY_EXISTS) というエラーが発生して若干ハマったため備忘録として残しました。
結論から言うと空き容量がない場合boxファイルを作成できずにこちらのエラーになるようです。

なので、
空き容量を増やすか外付けのストレージにVAGRANT_HOMEを移すことにより対処可能です。
今回は空き容量を増やすことができなかったので後者のやり方を採用して対応しました。

エラー内容

$ vagrant package
==> default: Clearing any previously set forwarded ports...
==> default: Exporting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["export", "49998b3d-dd24-49b2-afab-58653b3d74af", "--output", "/Users/hoge/.vagrant.d/tmp/vagrant-package-20210104-22105-1ry7egv/box.ovf"]

Stderr: 0%...
Progress state: VBOX_E_IPRT_ERROR
VBoxManage: error: Appliance write failed
VBoxManage: error: RTVfsFsStrmAdd failed for 'box.ovf' (VERR_ALREADY_EXISTS)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component ApplianceWrap, interface IAppliance
VBoxManage: error: Context: "RTEXITCODE handleExportAppliance(HandlerArg *)" at line 1686 of file VBoxManageAppliance.cpp

対応方法

空き容量を増やすことができなかったので外付けのSSDにVAGRANT_HOMEを一時的に移しました。

$ export VAGRANT_HOME=/Volumes/[SSD]/path/to/.vagrant.d
$ vagrant package
==> default: Exporting VM...
==> default: Compressing package to: /path/to/package.box

一時的にVAGRANT_HOMEを移したので元に戻さなければなりません。
もともとVAGRANT_HOMEが未設定であれば

$ unset VAGRANT_HOME

で削除すればOKですし、別の箇所に設定していたのであれば

$ export VAGRANT_HOME=/path/to/.vagrant.d

と元の箇所に設定しなおせばOKです。

参考

Resolving Ambiguous Vagrant VirtualBox Driver Errors

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?