hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.02k stars 4.42k forks source link

Virtualbox vagrant provider not detecting host's network adapters on vagrant up #13297

Open youngturk2 opened 7 months ago

youngturk2 commented 7 months ago

So, I am not sure why this is happening, as vagrant was working perfectly prior to installing the most up-to-date version that is currently released, but, for some reason, when I attempt to boot one of my vagrant boxes using "vagrant up" using the VirtualBox provider. vagrant is unable to identify/find/list the network adapters available on my host machine.

image

Oh. I should also mention that I have already attempted to repair the installation

Debug output

https://gist.github.com/youngturk2/0203dc2fe13ae61280ef58080a814ccb

Gist also has the test Vagrantfile

Expected behavior

Vagrant should have, and has in previous versions of the program, successfully configure and launch the vagrant virtual machine using the virutalbox provider

Actual behavior

Vagrant fails to identify network adapters on my host machine, and I am prompted to select an adapter I want to use as a bridge from an empty list

Reproduction information

Vagrant version

vagrant -v Vagrant 2.4.0

Host operating system

image

x64 architecture

Guest operating system

Windows server 2019 datacenter

Steps to reproduce

  1. run "vagrant up" using supplied vagrantfile located at gist page with the debug log

Vagrantfile

Vagrant.configure("2") do |config|
    config.vm.box = "StefanScherer/windows_2019"
    config.vm.box_check_update = true
    config.vm.provider :virtualbox do |v|
        process = `"#{ENV["VBOX_MSI_INSTALL_PATH"]}vboxmanage.exe" -v`
        v.gui = true
        v.customize ["modifyvm", :id, "--memory", "4096"]
        v.customize ["modifyvm", :id, "--cpus", "2"]
        v.customize ["modifyvm", :id, "--vram", 32]
        v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
        v.customize ["modifyvm", :id, "--audio", "none"]
        v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
        if process[0,5] >= '6.1.0' then
            v.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]
        else
            v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
        end
        v.customize ["modifyvm", :id, "--draganddrop", "hosttoguest"]
        v.linked_clone = true if Vagrant::VERSION >= '1.8.0'
    end
    config.vm.guest = :windows
    config.vm.communicator = "winrm"
    config.vm.boot_timeout = 500
    config.winrm.transport = :plaintext
    config.winrm.basic_auth_only = true
    config.vm.network "public_network", use_dhcp_assigned_default_route: true, bridge: "Intel(R) Ethernet Connection (4) I219-LM"
    config.vm.network "forwarded_port", guest: 5985, host: 55985
    config.vm.synced_folder "packages", "/packages"
    config.vm.provision "shell", privileged: true, powershell_elevated_interactive: true, inline: <<-EOH
$ErrorActionPreference = "SilentlyContinue"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
$env:PATH +=";$($env:SystemDrive)\\ProgramData\\chocolatey\\bin"
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory private

EOH
end
chrisroberts commented 6 months ago

Hi there,

Would you please provide the output from:

VBoxManage.exe list bridgedifs

Thanks!