{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/vagrant/issues/9298","repository_url":"https://api.github.com/repos/hashicorp/vagrant","labels_url":"https://api.github.com/repos/hashicorp/vagrant/issues/9298/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/vagrant/issues/9298/comments","events_url":"https://api.github.com/repos/hashicorp/vagrant/issues/9298/events","html_url":"https://github.com/hashicorp/vagrant/issues/9298","id":284382497,"number":9298,"title":"WSL rootfs on newer OS builds is no longer \"%LOCALAPPDATA%\\lxss\"","user":{"login":"BR0kEN-","id":2760616,"avatar_url":"https://avatars2.githubusercontent.com/u/2760616?v=4","gravatar_id":"","url":"https://api.github.com/users/BR0kEN-","html_url":"https://github.com/BR0kEN-","followers_url":"https://api.github.com/users/BR0kEN-/followers","following_url":"https://api.github.com/users/BR0kEN-/following{/other_user}","gists_url":"https://api.github.com/users/BR0kEN-/gists{/gist_id}","starred_url":"https://api.github.com/users/BR0kEN-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BR0kEN-/subscriptions","organizations_url":"https://api.github.com/users/BR0kEN-/orgs","repos_url":"https://api.github.com/users/BR0kEN-/repos","events_url":"https://api.github.com/users/BR0kEN-/events{/privacy}","received_events_url":"https://api.github.com/users/BR0kEN-/received_events","type":"User","site_admin":false},"labels":[{"id":610713628,"url":"https://api.github.com/repos/hashicorp/vagrant/labels/WSL","name":"WSL","color":"666622","default":false},{"id":283683436,"url":"https://api.github.com/repos/hashicorp/vagrant/labels/has-pr","name":"has-pr","color":"fef2c0","default":false},{"id":218286867,"url":"https://api.github.com/repos/hashicorp/vagrant/labels/host/windows","name":"host/windows","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-12-24T21:12:32Z","updated_at":"2018-02-13T10:23:45Z","closed_at":null,"author_association":"NONE","body":"### Vagrant version\r\nVagrant 2.0.1\r\n\r\n### Host operating system\r\nWindows 10 (version `1709`, build `16299.125`).\r\n\r\n### Expected behavior\r\nVagrant is to detect current WSL container and compute a proper path to it.\r\n\r\n### Actual behavior\r\nVagrant handles only the WSL that is installed via `lxrun`.\r\n\r\n### References\r\n\r\n- https://github.com/Microsoft/WSL/issues/2578\r\n- https://github.com/berkshelf/vagrant-berkshelf/issues/323\r\n- https://github.com/BR0kEN-/cikit/tree/issues/52/docs/vagrant/wsl\r\n- https://github.com/RoliSoft/WSL-Distribution-Switcher/issues/69\r\n\r\n### Additional information\r\nBefore the `16215` build of Windows, there was a way to install a WSL using `lxrun`. After mentioned build this way has been deprecated and, since then, it's recommended to use Microsoft Store for installing a WSL. Moreover, since that version, you can have multiple instances of Linux subsystem.\r\n\r\nWhen the installation is done by `lxrun /install` then `rootfs` of a WSL will be in `%LOCALAPPDATA%\\lxss` and Vagrant will operate correctly since its codebase relies on this location (https://github.com/hashicorp/vagrant/blob/v2.0.1/lib/vagrant/util/platform.rb#L286-L289).\r\n\r\n![lxrun installation](https://github.com/BR0kEN-/cikit/raw/issues/52/docs/vagrant/wsl/images/16215-lxrun.png)\r\n\r\nWhen the installation is done from the Microsoft Store, then `rootfs` of a WSL will be in `%LOCALAPPDATA%\\Packages\\<WSL_ID>\\LocalState`. Pay your attention at the `<WSL_ID>` token in the path which is completely dynamic.\r\n\r\n![installation from store](https://github.com/BR0kEN-/cikit/raw/issues/52/docs/vagrant/wsl/images/16215-store.png)\r\n\r\nThe path of the particular container can be obtained from the registry at `HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss` - a listing of installed subsystems.\r\n\r\nFor instance, using the following PowerShell script, the path of default subsystem can be gained.\r\n\r\n```powershell\r\n$WSLREGKEY=\"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Lxss\"\r\n$WSLDEFID=(Get-ItemProperty \"$WSLREGKEY\").DefaultDistribution\r\n$WSLFSPATH=(Get-ItemProperty \"$WSLREGKEY\\$WSLDEFID\").BasePath\r\nNew-Item -ItemType Junction -Path \"$env:LOCALAPPDATA\\lxss\" -Value \"$WSLFSPATH\\rootfs\"\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/vagrant/issues/comments/365219651","html_url":"https://github.com/hashicorp/vagrant/issues/9298#issuecomment-365219651","issue_url":"https://api.github.com/repos/hashicorp/vagrant/issues/9298","id":365219651,"user":{"login":"AsharLohmar","id":4039805,"avatar_url":"https://avatars0.githubusercontent.com/u/4039805?v=4","gravatar_id":"","url":"https://api.github.com/users/AsharLohmar","html_url":"https://github.com/AsharLohmar","followers_url":"https://api.github.com/users/AsharLohmar/followers","following_url":"https://api.github.com/users/AsharLohmar/following{/other_user}","gists_url":"https://api.github.com/users/AsharLohmar/gists{/gist_id}","starred_url":"https://api.github.com/users/AsharLohmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AsharLohmar/subscriptions","organizations_url":"https://api.github.com/users/AsharLohmar/orgs","repos_url":"https://api.github.com/users/AsharLohmar/repos","events_url":"https://api.github.com/users/AsharLohmar/events{/privacy}","received_events_url":"https://api.github.com/users/AsharLohmar/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T10:23:45Z","updated_at":"2018-02-13T10:23:45Z","author_association":"NONE","body":"Try adding VirtualBox's folder to the PATH\r\n`export PATH=\"${PATH}:/mnt/c/Program Files/Oracle/VirtualBox\"`"}}
{"actor":{"display_login":"AsharLohmar"}}