hashicorp/vagrant · error · VagrantPlugins::Chef::Provisioner::Base::ChefError
Shared folders that Chef requires are missing on the virtual
Error message
Shared folders that Chef requires are missing on the virtual machine. This is usually due to configuration changing after already booting the machine. The fix is to run a `vagrant reload` so that the proper shared folders will be prepared and mounted on the VM.
What it means
Raised by verify_shared_folders in chef_solo: before running, the provisioner mounts cookbook/roles/nodes/data_bags folders into the guest and checks each with `test -d <folder>` over the communicator (sudo). If any guest path is missing, it aborts with this error and the standard advice: the synced-folder set changed after boot, so `vagrant reload` remounts everything. Chef-solo cannot run without these mounts.
Source
Thrown at plugins/provisioners/chef/provisioner/chef_solo.rb:230
next if data.empty?
@machine.ui.info(data, color: color)
end
# There is no need to run Chef again if it converges
return if exit_status == 0
end
end
# If we reached this point then Chef never converged! Error.
raise ChefError, :no_convergence
end
def verify_shared_folders(folders)
folders.each do |folder|
@logger.debug("Checking for shared folder: #{folder}")
if !@machine.communicate.test("test -d #{folder}", sudo: true)
raise ChefError, :missing_shared_folders
end
end
end
protected
# Extracts only the remote paths from a list of folders
def guest_paths(folders)
folders.map { |parts| parts[2] }
end
end
end
end
end
View on GitHub (pinned to 35f3160f4a)
Solutions
- Run `vagrant reload` (or `vagrant reload --provision`) so the new synced-folder set is mounted
- If mounts fail at boot, fix guest tools: install/vagrant-vbguest for VirtualBox, open-vm-tools for VMware
- Inside the guest, check `mount | grep vagrant` and `dmesg` for mount errors, free disk space
- Confirm no `config.vm.synced_folder` entry disables or shadows the Chef paths
Example fix
# Terminal - before (after changing synced_folder config) vagrant provision # -> missing_shared_folders # Terminal - after vagrant reload --provision # remounts folders, then provisions
Defensive patterns
Strategy: validation
Validate before calling
# Host-side pre-flight: every Chef folder must exist before vagrant provision
required = %w[cookbooks roles data_bags]
missing = required.reject { |d| Dir.exist?(File.expand_path(d, __dir__)) }
abort "Missing Chef folders: #{missing.join(', ')} - run vagrant reload after creating them" unless missing.empty? Prevention
- After any synced_folder or chef *_path change, use `vagrant reload --provision`, never plain provision
- Keep guest additions current (vagrant-vbguest) so mounts never silently fail
- Check `mount | grep vagrant` inside the guest when provisioning acts weird after boot
When it happens
Trigger: Calling chef_solo provision where any of its folders is absent in the guest: synced folder config changed since the VM booted, mount failed at boot (missing/incorrect guest tools), or a custom `disabled` synced folder overlaps Chef's paths.
Common situations: Editing Vagrantfile synced_folders then running `vagrant provision` instead of reload; VirtualBox Guest Additions version mismatch after kernel update (vbguest plugin absent); VMware/OpenBSD folders unsupported; disk full preventing mount.
Related errors
- Chef never successfully completed! Any errors should be visi
- Shared folders that Chef requires are missing on the virtual
- This Vagrant environment has specified that it requires the
- The box '%{name}' could not be found or could not be accesse
- Vagrant could not detect Chef on the guest! Even after Vagra
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/59efdc7502b6f1df.
Report an issue: GitHub.