Vagrant: 自分のミスで仮想マシン作成に失敗していた
症状
長く使っていた仮想マシンを軽い気分でいじって壊してしまいました。
仮想マシンを作りなおそうとしてvagrant destroy
の後でvagrant up
と入力すると、下記のようにエラーとなりました。
どうも、LAN内の別のPC(\\Y-V3360
)のフォルダに仮想マシンを作ろうとしているものの、そのPCの電源はOFFになっているためアクセスできずにエラーとなっているようです。
なぜこんな設定になっているのか分からず、Vagrantを再インストールしたものの解決しません。
C:\Users\Yuusaku\Dropbox\vagrant\vm1>vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'centos65-x86_64-20140116'... There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. Command: ["import", "C:/Users/Yuusaku/.vagrant.d/boxes/centos65-x86_64-20140116/0/virtualbox/box.ovf", "--vsys", "0", "--vmname", "centos65-x86_64_1435453514785_86985", "--vsys", "0", "--unit", "6", "--disk", "\\\\Y-V3360\\VirtualBox VMs\\centos65-x86_64_1435453514785_86985\\box-disk1.vmdk", "--vsys", "0", "--unit", "7", "--disk", "\\\\Y-V3360\\VirtualBox VMs\\centos65-x86_64_1435453514785_86985\\box-disk2.vmdk"] Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Interpreting C:\Users\Yuusaku\.vagrant.d\boxes\centos65-x86_64-20140116\0\virtualbox\box.ovf... OK. 0%... Progress state: VBOX_E_IPRT_ERROR VBoxManage.exe: error: Appliance import failed VBoxManage.exe: error: Could not create the directory '\\Y-V3360\VirtualBox VMs\centos65-x86_64_1435453514785_86985' (VERR_NET_HOST_NOT_FOUND) VBoxManage.exe: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component Appliance, interface IAppliance VBoxManage.exe: error: Context: "int __cdecl handleImportAppliance(struct HandlerArg *)" at line 779 of file VBoxManageAppliance.cpp
解決
調べたところ、Command:
以下の文はVagrantからVirtualBoxへ渡している命令のようです。
それならばとVirtualBoxの設定を確認すると、すぐに原因が判明しました。
デフォルトの仮想マシンフォルダー
が別のPC内に指定されていました。
(※ 写真は正常な設定)
おそらく、以前Sambaを試していた時などに一時的に変更して、元に戻すのを忘れてしまったのだと思います。
バカみたいな凡ミスでした orz
まあでも、VagrantがVirtualBoxを制御する実態をほんの少し理解することができてよかった…と思います。