hashicorp / vagrant

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

Vagrant is crashing if SMB synced folder is defined, but there no CIFS installed and no Internet is available #13238

Open acidumirae opened 12 months ago

acidumirae commented 12 months ago

Vagrant is crashing if SMB synced folder is defined, but there no CIFS installed and no Internet is available.

There was a workaround back ago for Vagrant's team long inability to implement synced_folder functionality properly, when you could omit the mount point and vagrant would not attempt mounting the share.

It looks like currently there is a terrible hack which seems to try to install CIFS unsolicited, if it is missing in the guest system.

Can we please hack this hack to give an option to NOT execute the capability: smb_install whe we do not want to and just create a share without mounting it?

Is it possible to create SMB share and mount it later on without unwanted intrusion in the guest?

Debug output

https://gist.github.com/acidumirae/437a09d024b6fb21caf264bf73141e91

Expected behavior

SMB shares created, but not mounted

Actual behavior

Vagrant is attempting to install CIFS and crashing.

Reproduction information

Vagrant version

Vagrant 2.3.7

Host operating system

OS Name: Microsoft Windows 10 Pro OS Version: 10.0.19045 N/A Build 19045

Guest operating system

Alpine 3.17.2 https://app.vagrantup.com/generic/boxes/alpine317

Steps to reproduce

  1. vagrant up
  2. select a VM switch without internet access
  3. observe crash

Vagrantfile

Vagrant.configure("2") do |config|

  config.vm.box = "generic/alpine317"

  config.vm.provider "hyperv" do |hv|
    hv.memory = "1024"
    hv.maxmemory = "2048"
    hv.cpus = 2

    hv.enable_virtualization_extensions = true
    hv.linked_clone = true

    hv.vmname = "SMBBUG"
  end

  config.vm.network "private_network"

  config.vm.synced_folder ".", name:"vagrant", type: "smb"

end