I have installed Ubuntu subsystem on Windows 10 (after enabling feature in settings), but where is the Ubuntu file system root directory located in the drive?
I have installed Ubuntu subsystem on Windows 10 (after enabling feature in settings), but where is the Ubuntu file system root directory located in the drive?
For Ubuntu installed from the Windows store:
For WSL2 you can access to home directory from windows (Windows 10 build 18342) like this :
In earlier iterations of Windows Subsystem for Linux, the Ubuntu file system was at
%localappdata%\Lxss
(e.g.,C:\Users\Username\AppData\Local\Lxss
- replace the Username with your Username on Windows). See the WSL blog post on File System Support:CAUTION
Creating/modifying any files within the Linux subsystem using Windows apps & tools can cause Data corruption and data loss in Ubuntu subsystem! (Thanks to Rich Turner for suggesting these words of caution!) This is absolutely not supported. From the same blog post:
Your Windows file system is located at
/mnt/c
in the Bash shell environment.Source: Dustin Kirkland's blog, howtogeek
This seems to have changed since Bash was originally introduced, and does not apply to distributions from the Windows Store, or maybe it is not consistent for all systems as my home directory is located in another location:
or:
Where
{user}
is your Windows Username and{username}
is your UNIX Username set during install.So the root directory would be:
Note that the root directory may not be visible in Windows Explorer from the
%localappdata%
directory. You should be able to access it anyways by typing it in the 'address bar' of Explorer.If you install Linux from MS Market:
they placed distros under:
Default distro defined by:
Linux root is deeper:
PS. I used Cygwin to explore registry keys.
If using PowerShell for the same goal, the commands would be:
PPS. https://blogs.msdn.microsoft.com/commandline/2016/11/17/do-not-change-linux-files-using-windows-apps-and-tools/
You can quickly open Bash from a File Explorer window of the opened folder by typing
bash
in the location bar.It's enough.
Also you can add a context menu item. I personally don`t recommend it if not needed, because adding shortcuts to the context menu uses more RAM.
https://www.howtogeek.com/270810/how-to-quickly-launch-a-bash-shell-from-windows-10s-file-explorer/
The only thing that worked for me was
%localappdata%\lxss\home\{username}
, where the{username}
is your BASH username you gave it during the installation. For some reason, after showing hidden folder's lxss refuses to appear inC:\Users\WINDOWS-USER\AppData\Local\
, and also giving the fullC:\
path with windows and BASH username does not work either.And please create a desktop shortcut for what works.
For those who are looking for the image location: C:\Users\[username]\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\ext4.vhdx