# WIndows directory of the linux subsystem #402

Closed
opened this Issue May 20, 2016 · 37 comments

Projects
None yet

### ducminhnguyen commented May 20, 2016

 I cant find the windows path of the linux subsystem which is inconvenient as I want to copy files into the directory from windows.

### tills13 commented May 20, 2016

 It's located under /mnt/ i.e. /mnt/c is your C drive.

### ducminhnguyen commented May 20, 2016

 What I mean is the subsystem path in the C directory. I want to access the subsystem path in WIndows Explorer.

### tills13 commented May 20, 2016

 My mistake.

### ddfznt commented May 20, 2016 • edited

 Under C:\Users\**user**\AppData\Local\lxss. You will find: root folder home folder and a hidden rootfsfolder (\bin, \boot, \dev, \etc...) DON'T CHANGE ANYTHINK INSIDE! SERIOUSLY! 🚨 Access Windows files via /mnt/**letter**/bla bla bla partition, then cp -R . ~ EDIT: symlinks are suported since 14342. you can try ln -s /mnt/**letter**/... ~/winFiles
Contributor

### aseering commented May 20, 2016 • edited

 @ducminhnguyen -- copying directly into the Linux subsystem from Windows is not supported, according to discussion on other tickets. There is a directory under AppData somewhere (I forget where) that appears to contain the files for the WSL filesystem. But if you put new files there, or modify existing files there, your changes are not reflected correctly inside WSL. My best guess is that Linux needs to store different metadata (and more caching information, etc, since its disk-buffering model is also different) about its files than Windows does, and that this is currently implemented by storing the master copy of the structure of the Linux filesystem in a database of some sort, and just using the Windows filesystem as a convenient BLOB-store for that database. If you really need to do this, a workaround would be to write a drag'n'drop .bat script or somesuch that does bash.exe -c "mv %1 /home/\$USER/". (You'll have to do some clever work with sed and tr, probably, to translate %1 to a valid WSL path.) Alternatively -- could you put your files in a Windows directory and, within WSL, do "cd ~; ln -s /mnt/c/path/to/my/files" to make them appear to be in your WSL homedir?

### ducminhnguyen commented May 20, 2016

 @ddfznt yeah I wont change anything. I am just tired of typing cp command. @aseering yeah that could work. I will try it later. Thanks for the suggestion.

Closed

### totalknowledge commented Jul 15, 2016

 Are there any best practices around file storage when installing tools or programs that you want to be available in the wls?

### voltagex commented Aug 3, 2016

 As of 1611, %localappdata%\lxss doesn't seem to exist

### DJviolin commented Aug 3, 2016 • edited

 What if someone is trashed his Ubuntu subsystem and wants a fresh start? Is it safe to remove C:\Users\**user**\AppData\Local\lxss then? Does this mean a "freash start" when I start again the Bash window?
Member

### benhillis commented Aug 3, 2016

 If you want a fresh start use lxrun.exe /uninstall /full Reinstall by running bash.exe when that completes.

### DJviolin commented Aug 3, 2016 • edited

 Thank You! Meanwhile I already found out this in the documentation. I'm using these commands: # Windows folder: # C:\Users\[user]\AppData\Local\lxss # Uninstall with keeping root dir # lxrun /uninstall # Uninstall completely: # lxrun /uninstall /full /y # New install (root user created): # lxrun /install /y Is there any way to make a backup from an actual state (like before package installs)? If I zipping the C:\Users\**user**\AppData\Local\lxss folder that's enough for actual state backups?

### onomatopellan commented Aug 3, 2016 • edited

 Only lxrun.exe can create that folder. It's a special folder with Extended Attributes so copying it manually won't work. I also like to have a "base" backup without any package installed. You can do this. close any bash window and go to %LocalAppData% enable see hidden and system folders rename folder lxss to lxss.base now from an admin CMD type lxrun /uninstall and lxrun /install and add same username as before. After finishing installing there will be lxss and lxss.base folders. If you want to use the "lxss.base" folder you just have to rename it back to lxss before launching bash.

### DJviolin commented Aug 3, 2016 • edited

 So what you saying is lxss folder can be copied but can't be zipped? I read somewhere symlinking this folder into a vmdk, which seems to be the best option if you cannot do any modification inside lxss from any windows text editors and you cannot copy any file into it. For creating a new dev environment, I use a massive shell script, which is not nice, but I think this is the nearest let's say for a Dockerfile. For a dev environment, BashOnWindows is great, but reading from so many people how many times they recreating this from scratch (including me), I definitely not want to store any database inside WSL. EDIT: Nope, you have to put the entire local folder into a new drive or a vmdk, which I definitely not want. Is there a way to put only lxss folder into a VMDK symlink? If this file system so restricted and basically you cannot do anything inside it from Windows, why not packaged into a VHD(X) on the first-place? For maintaining it would be much better.

### onomatopellan commented Aug 3, 2016 • edited

 lxss can't be a symlink anymore since build 14388. It will install but at launching bash it will show error 0x80070003. Before that it was easy attaching a VHDX file to the lxss folder for example. Anyway Microsoft knows about this problem and they are already thinking about different solutions. Windows 10 Image System backup can create an image of the entire system drive with lxss folder and its attributes intact but of course it will be a huge image file that also contains Windows.

Closed

### fjanoos commented Sep 28, 2016

 is there a way to change the windows folder into which lxss installs ? my c:/ is running very low on space, I am trying to move all my stuff on to my d:

Closed

### ghost commented Dec 27, 2016

 Hi, I use Win10 and went to C:\Users\[user]\AppData\Local but couldn't find lxss folder. I am able to see hidden files. Where is the lxss folder than? Thanks,
Member

### benhillis commented Dec 27, 2016

 It is marked as system as well. Keep in mind you should not modify anything in that directory.

### sourcevault commented Feb 2, 2017

 @benhillis use command line to access it. Or type it in the address bar
Member

### benhillis commented Feb 2, 2017

 @partially-applied - I don't follow your comment. I'm just warning people that they should not do it.

### davidalbertonogueira commented Feb 15, 2017

 I agree with @benhillis. Don't edit files there or add new ones (it wouldn't be visible/accessible from ubuntu anyway). Access to that folder should be read-only.

### iFreilicht commented Mar 17, 2017 • edited

 @partially-applied I think you meant to mention @Benosika. Thank you so much for this, I was going crazy over why I couldn't see this folder and the whole internet seemingly disagreeing with me on the existence of it.

Closed

### devloprs commented May 2, 2017 • edited

 how do I get a windows program that requires node.js to use the wsl installed version? :) To clarify I have node installed in wsl and would like my windows programs, like sublime text to see it. It needs it to run prettify js amongst other things.
Contributor

### aseering commented May 2, 2017

 Folks here may have suggestions (I know this is discussed on other tickets and others have made it work in some cases), but you might also want to ask the Sublime developers. Linux interpreters may have behavior or features that are different from their Windows counterparts, so a really feature-complete integration would require them to know to use the interpreter's Linux interface.

### dreamcat4 commented May 3, 2017

 @aseering I have commented on the Sublime issue today.

### oneduality commented Jul 19, 2017 • edited

 One option would be to install nfsd and export the rootfs on ubuntu, then you'd need to activate client for nfs under programs & features, configure the service and launch it.. well, you obviously need to know how to get the nfs daemon configured as well but there's plenty of documentation online for that. I have toyed around and got apache2 with PHP and MySQL running, you just have to manually start the services and then remember to shut them down before you exit or you could have some database corruption... but that's entirely unrelated =) UPDATE: I gave it a shot, it doesn't work because the ubuntu kernel doesn't support it

### f0ster commented Aug 11, 2017 • edited

 I have win10 Build 16241 , with ubuntu installed through the "store", and the lxss directory no longer exists in C:\Users\[user]\AppData\Local
Member

### benhillis commented Aug 11, 2017 • edited

 @f0ster - Each distribution you install through the store is installed to that application's appdata directory. For example: C:\Users\\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState

### AdrielleKiz commented Aug 24, 2017 • edited

 I'm using the linux subsystem in windows 10 with ubuntu installed Sorry,noob here How do I access the Desktop cd~/Desktop is not working for me My current dir is at /home/USERNAME Tried ls in the my current dir and it shows up nothing while ls -a got some hits but it seems that they're all hidden files ,not directories.
Member

### AdrielleKiz commented Aug 31, 2017

 @sunilmut Thanks !

### cec commented Jan 11, 2018

 @benhillis lifesaver

### danielschmitz commented Jan 29, 2018 • edited

 Open a windows terminal and: subst l: c:\Users\path\to\rootfs result: a L: drive mapping to your linux root

### r3lik commented Apr 13, 2018

 when I copy/move files in my home directory using the explorer, the changes aren't reflected in my terminal. Anyone know how to solve this?

### davidalbertonogueira commented Apr 13, 2018

 @r3lik , you are now allowed to do that. You should access that folder in a read-only scope.

### r3lik commented Apr 14, 2018 • edited

 @davidalbertonogueira it wasn't working for me when I wanted to edit things in c:\Users\path\to\rootfs. I ended up just setting HOME="/mnt/c/Users/r3lik" in my .profile as a workaround.

### shawnz commented May 31, 2018

 Changing your home variable like that is strongly not recommended @r3lik. Why don't you just copy your files from inside WSL as recommended in the docs?

### jcklpe commented Aug 7, 2018

 I can't answer for him @shawnz but I can say that at least for myself it's a pain in the ass. Learned a lot of Linux stuff using WSL, now I'm starting to think that I should just go fully Linux and drop the windows thing all together, haha