{"record":{"id":"b93f5b5f3711e3f5","repo":"hashicorp/vagrant","slug":"vagrant-is-unable-to-determine-the-location-of-thi","errorCode":null,"errorMessage":"Vagrant is unable to determine the location of this instance of the Windows\nSubsystem for Linux. If this error persists it may be resolved by destroying\nthis subsystem and installing it again.","messagePattern":"Vagrant is unable to determine the location of this instance of the Windows\nSubsystem for Linux\\. If this error persists it may be resolved by destroying\nthis subsystem and installing it again\\.","errorType":"exception","errorClass":"Vagrant::Errors::WSLRootFsNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/vagrant/util/platform.rb","lineNumber":457,"sourceCode":"                # You can create and simultaneously run multiple WSL instances,\n                # comment out the \"break\", run this script within each one and\n                # it'll return only single value.\n                break\n              rescue Errno::ENOENT\n                # Warn about data discrepancy between Winreg and file system\n                # states. For the sake of justice, it's worth mentioning that\n                # it is possible only when someone will manually break WSL by\n                # removing a directory of its base path (kinda \"stupid WSL\n                # uninstallation by removing hidden and system directory\").\n                logger.warn(\"WSL instance at `#{path} is broken or no longer exists\")\n              end\n              # All other exceptions have to be raised since they will mean\n              # something unpredictably terrible.\n            end\n\n            marker.close!\n\n            raise Vagrant::Errors::WSLRootFsNotFoundError if @_wsl_rootfs.nil?\n          end\n\n          # Attach the rootfs leaf to the path\n          if @_wsl_rootfs != lxrun_path\n            @_wsl_rootfs = \"#{@_wsl_rootfs}\\\\rootfs\"\n          end\n\n          logger.debug(\"detected `#{@_wsl_rootfs}` as current WSL instance\")\n\n          @_wsl_rootfs\n        end\n\n        # Convert a WSL path to the local Windows path. This is useful\n        # for conversion when calling out to Windows executables from\n        # the WSL\n        #\n        # @param [String, Pathname] path Path to convert\n        # @return [String]","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/util/platform.rb#L439-L475","documentation":"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.","triggerScenarios":"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.","commonSituations":"Manual cleanup of the lxss/AppData distro folders; aborted WSL distro moves; distro files relocated without updating the registry BasePath.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"begin\n  Vagrant::Util::Platform.wsl_rootfs\nrescue Vagrant::Errors::WSLRootFsNotFoundError\n  abort 'WSL install is broken; run: wsl --unregister <Distro> and reinstall it'\nend","preventionTips":["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"],"tags":["wsl","windows","environment","installation"],"backgroundTag":"broken-wsl-installation","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}