vagrantでbridge接続でエラーがでたときの対処法

Windows10を使っていて、vagrant+virtualBOXでbridge接続をしようとしたらエラーとなりました

エラー箇所

PS D:\vm\centos7> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos/7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/7' version '2004.01' is up to date...
==> default: Setting the name of the VM: buildree-dev
==> default: Clearing any previously set network interfaces...
==> default: Specific bridge 'VirtualBox Host-Only Ethernet Adapter' not found. You may be asked to specify
==> default: which network to bridge to.
==> default: Available bridged network interfaces:
==> default: When choosing an interface, it is usually the one that is
==> default: being used to connect to the internet.
==> default:
    default: Which interface should the network bridge to?
    default: Which interface should the network bridge to?
    default: Which interface should the network bridge to?
    default: Which interface should the network bridge to?

default: Which interface should the network bridge to? となり、この後何も進みません。しょうがないのでCtrl+Cでキャンセルします

マシンの状態

マシンのスペックなどは以下になります

  • OS:Windows10
  • エディション:Pro
  • バージョン:21H1
  • ビルド番号:19043.1055
  • vagrantバージョン:2.2.14
  • バーチャルBOXバージョン:6.1.14
  • LAN:192.168.1.x

となります。インストールしようとしたOSはCentOS7となります

原因:バーチャルBOXのバージョンが古かった?

バーチャルBOXのバージョンを最新の6.1.22にしたところ、問題なく動作しました

PS D:\vm\centos7> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos/7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/7' version '2004.01' is up to date...
==> default: Setting the name of the VM: buildree-dev
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Specific bridge 'VirtualBox Host-Only Ethernet Adapter' not found. You may be asked to specify
==> default: which network to bridge to.
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: bridged
==> default: Forwarding ports...
    default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
==> default: Rsyncing folder: /cygdrive/d/vm/centos7/ => /vagrant

vagrantのファイル

vagrantはブリッジ接続は以下のようにしてます

 config.vm.network "public_network", ip: "192.168.1.200"

個人支援・寄付について

サイトラボではBuildreeの開発などのため、現在個人支援・寄付を受けております。ご協力いただける方はお願いいたします。当サイトではkyashというサービスをつかっております。ビットコインでも受け付けております。