Windows 10 Ubuntu Bash home directory location and access Drive in Bash

Windows 10 Anniversary Update brings a Ubuntu-based Bash shell subsystem for developers to run Linux software directly on Windows. Unlike other virtual machine, it is based on Microsoft’s abandoned Project Astoria and used to run Android apps. I have enabled the Bash feature in settings and install an entire Ubuntu user space environment on my Surface Pro 4 tablet, but don’t know where the Shell Files are stored and how to access the Windows system drive in Bash.

Where is the actual location of Windows 10 Ubuntu Bash Shell mode’s home folder and its related files?
First configure to show hidden folders
* Within the File Explorer, on the ribbon bar at top, go to the View tab, click Options > Change Folder and Search Options, and
* In the Folder Options, go to View tab, check “Show Hidden Files, Folders, and Drives” box, and click Apply > OK button.

Now navigate to the directory below:

C:\Users\Your-Username\AppData\Local\lxss

You need to replace Your-Username with your full account name on Windows 10.
Or you can copy the code line into address bar

%localappdata%\Lxss\rootfs

and press Enter to access it.

The lxss is the Linux/Ubuntu file system root directory. Open the lxss and there are many folders listing within this directory.

The rootfs folder stores the Ubuntu system files.
The root folder stores the root account’s data files.
Go inside the home folder, you can find your Ubuntu user account’s home folder.

How can I access the Windows System Drive in Bash?
In the Linux/Ubuntu Bash directory structure, the Windows 10 system drive and other connected drives are mounted and exposed in the /mnt/ directory.
Within the Bash environment, type the command

cd /mnt/c

and press Enter to go to the C: drive. If you want to access the D: drive, execute the cd /mnt/d command.
If you run the command to access the Windows system files (like C:\Users\Administrator folder) and get the “cannot access *** file: Permission denied” error message, you can not use “sudo” and must launch the Bash shell with Windows Administrator privileges.

test2

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>