LoginSignup
0
0

More than 1 year has passed since last update.

【苦戦した時の対処】仮想マシン動かない、vagrant upできない

Posted at

はじめに

仮想マシンを使ってWordPressの構築を行う際に、
なかなかvagrant upできない問題でしたので、
解決した内容を書きたいと思います。

環境

ホスト環境
mac OS Monterey (12.5)
Vagrant:2.2.6
VirtualBox:6.1.0

エラー内容

ターミナル
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 95 of file VBoxManageHostonly.cpp

最近, macOSアップデートしたのですが、vagrantがうまく動かない原因はmacOSをアップデートしたからでした。
他参考にさせてもらった記事もアプデが原因で起こったという記事が多くそこに問題を感じた。

VagrantとVirtualBoxを最新版にする

まずはアンインストールをします

brew cask uninstall virtualbox
brew cask uninstall vagrant

もしくは

brew uninstall virtualbox --cask  
brew uninstall vagrant --cask  

次にインストールをします。

brew cask install virtualbox
brew cask install vagrant

もしくは

brew reinstall --cask virtualbox
brew reinstall --cask vagrant

でアップデート出来ましたが、
またも同じエラーが出てしまいます。

そこで行ったのが、

仮想マシンの削除

Virtualboxを開いて、使用中の仮想マシンを削除

スクリーンショット 2022-08-06 21.41.51.png

右クリック→除去!!

そして再度vagrant up

これが表示されたらオッケー!
  default: SSH auth method: private key
.
.

最後に

vagrant sshで接続してログインすることができました。
スクリーンショット 2022-08-06 21.48.23.png

filezillaの使用もでローカルで触ることが出来ます。

また忘れた頃にやってくるので、その時の自分に記しておきます。^^

## 参考記事
https://qiita.com/akane_kato/items/c103332729e3d0ac39e6

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