I have clean installed windows 10 (build 1803). I have installed Ubuntu from the Microsoft Store and enabled Linux subsystem. I have done this several times in the past, and never have I had the following issue: my c
directory is all messed up thanks to symbolic links. Take for example the output of dir
in cmd
and ls
in WSL:
C:\Users\username>dir
Volume in drive C has no label.
Volume Serial Number is BC00-A6D5
Directory of C:\Users\username
05/25/2018 12:01 AM <DIR> .
05/25/2018 12:01 AM <DIR> ..
05/25/2018 12:01 AM <DIR> 3D Objects
05/25/2018 12:01 AM <DIR> Contacts
05/25/2018 01:19 AM <DIR> Desktop
05/25/2018 12:01 AM <DIR> Documents
05/25/2018 12:01 AM <DIR> Downloads
05/25/2018 12:01 AM <DIR> Favorites
05/25/2018 12:01 AM <DIR> Links
05/25/2018 12:01 AM <DIR> Music
05/25/2018 12:06 AM <DIR> OneDrive
05/25/2018 12:01 AM <DIR> Pictures
05/25/2018 12:01 AM <DIR> Saved Games
05/25/2018 12:01 AM <DIR> Searches
05/25/2018 12:01 AM <DIR> Videos
0 File(s) 0 bytes
15 Dir(s) 88,018,132,992 bytes free
name:/mnt/c/Users/username$ ls
ls: cannot read symbolic link 'Application Data': Permission denied
ls: cannot read symbolic link 'Cookies': Permission denied
ls: cannot read symbolic link 'Local Settings': Permission denied
ls: cannot read symbolic link 'My Documents': Permission denied
ls: cannot read symbolic link 'NetHood': Permission denied
ls: cannot read symbolic link 'PrintHood': Permission denied
ls: cannot read symbolic link 'Recent': Permission denied
ls: cannot read symbolic link 'SendTo': Permission denied
ls: cannot read symbolic link 'Start Menu': Permission denied
ls: cannot read symbolic link 'Templates': Permission denied
3D Objects NTUSER.DAT{c9e9d809-5fd7-11e8-a0cd-4e0bbe2b78ad}.TM.blf
AppData NTUSER.DAT{c9e9d809-5fd7-11e8-a0cd-4e0bbe2b78ad}.TMContainer00000000000000000001.regtrans-ms
Application Data NTUSER.DAT{c9e9d809-5fd7-11e8-a0cd-4e0bbe2b78ad}.TMContainer00000000000000000002.regtrans-ms
Contacts ntuser.dat.LOG1
Cookies ntuser.dat.LOG2
[...]
Comparing the same directory–Ubuntu on the left and cmd on the right–you see that ls
attempts to list symbolic links that aren't there! I have never had this issue and I have not altered any permissions or anything, so I have no idea what's happening. Can anyone help me with this?
Here is some possibly useful information:
Mount gives
mount
rootfs on / type lxfs (rw,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noatime)
C: on /mnt/c type drvfs (rw,noatime,uid=1000,gid=1000)
Then,
id -u
1000
id -g
1000
My /etc/wsl.conf
file was non-existent at first, so I created one; but, I don't think this is the key to solving the issue, since mount
has shown that c
is correctly mounted. Right now it's this
[automount]
enabled = true
My question in short: there seems to be NO symlinks
in my directories as confirmed from running dir
in cmd. Yet, the Ubuntu command line shows symbolic links. Why is that? Oh, also, I cannot delete them (even with sudo rm
) as permission is denied. This is sort of annoying!
Best Answer
This did not confirm anything of the sort. Use the
/a
option to thedir
command. How to use thedir
command on a non-Unix non-Linux operating system is really beyond the scope of this WWW site. So I'll stop here after pointing out that this fundamental premise of the question is wrong.