Open poma opened 6 years ago
For more precise and general way the PowerShell could be used.
$WSLREGKEY="HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss"
$WSLDEFID=(Get-ItemProperty "$WSLREGKEY").DefaultDistribution
$WSLFSPATH=(Get-ItemProperty "$WSLREGKEY\$WSLDEFID").BasePath
New-Item -ItemType Junction -Path "$env:LOCALAPPDATA\lxss" -Value "$WSLFSPATH\rootfs"
After investigating I can confirm the problem this issue describes. WSL's rootfs
will be in %LOCALAPPDATA%\lxss
only if it has been installed via lxrun /install /y
. This way of installation is not recommended if OS build number is equal or later than 16215 (check https://docs.microsoft.com/en-us/windows/wsl/install-win10).
It seems to me like Vagrant issue (https://github.com/hashicorp/vagrant/blob/v2.0.1/lib/vagrant/util/platform.rb#L286-L289).
When Ubuntu is installed from the App Store it gives the following error:
Which is likely caused by the fact that VirtualBox mounts
folder which does not exist because now Windows supports multiple Linux installations and path to this folder is different
Temporary workaround - create a directory junction in the old location
Should be executed from elevated command prompt
Maybe instead of trying to detect where the new linux filesystem is located it is better to vendor cookbooks to
/mnt/c/Users/%username%/.berkshelf/....
? It is generally a bad practice to access WSL filesystem from within windows.