hashicorp/vagrant · error · Vagrant::Errors::WSLRootFsNotFoundError
Vagrant is unable to determine the location of this instance
Error message
Vagrant is unable to determine the location of this instance of the Windows Subsystem for Linux. If this error persists it may be resolved by destroying this subsystem and installing it again.
What it means
During WSL detection, Vagrant locates the distro's rootfs via a marker/registry walk; exceptions from a missing or broken base path are swallowed (only a logger.warn is emitted), and if @_wsl_rootfs is still nil afterwards it raises WSLRootFsNotFoundError (lib/vagrant/util/platform.rb). It means the running WSL installation itself is broken — its base path directory was deleted or moved out from under it.
Source
Thrown at lib/vagrant/util/platform.rb:457
# You can create and simultaneously run multiple WSL instances,
# comment out the "break", run this script within each one and
# it'll return only single value.
break
rescue Errno::ENOENT
# Warn about data discrepancy between Winreg and file system
# states. For the sake of justice, it's worth mentioning that
# it is possible only when someone will manually break WSL by
# removing a directory of its base path (kinda "stupid WSL
# uninstallation by removing hidden and system directory").
logger.warn("WSL instance at `#{path} is broken or no longer exists")
end
# All other exceptions have to be raised since they will mean
# something unpredictably terrible.
end
marker.close!
raise Vagrant::Errors::WSLRootFsNotFoundError if @_wsl_rootfs.nil?
end
# Attach the rootfs leaf to the path
if @_wsl_rootfs != lxrun_path
@_wsl_rootfs = "#{@_wsl_rootfs}\\rootfs"
end
logger.debug("detected `#{@_wsl_rootfs}` as current WSL instance")
@_wsl_rootfs
end
# Convert a WSL path to the local Windows path. This is useful
# for conversion when calling out to Windows executables from
# the WSL
#
# @param [String, Pathname] path Path to convert
# @return [String]View on GitHub (pinned to 35f3160f4a)
Solutions
- Re-register the distro: `wsl --unregister <Distro>` then reinstall from Microsoft Store or `wsl --install -d <Distro>`
- Verify health first: `wsl -l -v` lists it and a shell starts cleanly
- After reinstalling, re-run vagrant so WSL paths are re-detected
Defensive patterns
Strategy: try-catch
Try / catch
begin Vagrant::Util::Platform.wsl_rootfs rescue Vagrant::Errors::WSLRootFsNotFoundError abort 'WSL install is broken; run: wsl --unregister <Distro> and reinstall it' end
Prevention
- Never delete WSL distro directories by hand — use wsl --unregister
- After Windows upgrades, verify `wsl -l -v` still lists the distro as healthy
- Keep the WSL distro and Windows-side Vagrant managed together
When it happens
Trigger: Running vagrant inside WSL when the distro's installation directory was removed manually (the 'uninstall by deleting hidden/system directories' scenario the adjacent comment describes), relocated by registry edits, or partially migrated by a Windows upgrade.
Common situations: Manual cleanup of the lxss/AppData distro folders; aborted WSL distro moves; distro files relocated without updating the registry BasePath.
Related errors
- Vagrant cannot currently enable access to manage machines wi
- The provider '%{provider}' that was requested to back the ma
- Vagrant attempted to acquire a lock named '%{name}', but thi
- Vagrant is missing plugins required by the currently loaded
- A Vagrant environment or target machine is required to run t
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/b93f5b5f3711e3f5.
Report an issue: GitHub.