winnfsd / vagrant-winnfsd

Manage and adds support for NFS for Vagrant on Windows.
Other
567 stars 62 forks source link

mklink and symlink #69

Closed HnLn closed 7 years ago

HnLn commented 9 years ago

I just discovered that my win10 has a mklink functionality (command line). Seems to work pretty much like a linux symlink, it's not a shortcut but actually shows the files within the folder.

Is it possible that such links get translated to symlinks on the guest system ? Of course this would be only possible if the linked folder is with the mounted nfs share. For the moment my vagrant box (ubuntu) seems to recognize the mklink as a symbolic link (it has a little arrow next to it's name, but nothing next to the arrow). I can cd into the directoty but it points to the parent dir.

I guess this is quite difficult or even impossible, but no harm in asking :-).

kadet1090 commented 8 years ago

Yes, it even works ;) Just run winnfsd as admin and voila.

HnLn commented 8 years ago

Ok I had it working on a test directory, using /d as the mklink parameter, but now I try it on my working dirs and winnfsd crashes. I tried with /j before, and that doesn't work (the symbolic link in my guest ubuntu just points to itself). What parameters do you use for the mklink command ?

HnLn commented 8 years ago

Ok, i know why I had it working on a test directory, the relative path was only 1 level down ../foo. When I create a windows symbolic link that is more then one level down (the one I want is actually 4 levels down), like mklink /d foo ........\foo, winnfsd crashes when I access that directory.

kadet1090 commented 8 years ago

First of all you should do ........\foo rather than ........\foo. And i'm not sure if winnfsd is capable of serving files from outside of shared directory, but it should if on one level deep it works well. And remember that even if you could symlink to things on your nfs client (vagrant guest) you won't be able to access them on your host.

HnLn commented 8 years ago

yeah my slashes got stripped out :-)

The linked directory is still within the nfs share.

kadet1090 commented 8 years ago

Hmm, have you turned on winnfsd logging? It would be really helpful.

HnLn commented 8 years ago

see also https://github.com/winnfsd/winnfsd/issues/10

(trying to get some logging going)

HnLn commented 8 years ago

First image is the crash, a makelink that goes down 2 (or more) levels. Second image works ok, a makelink that goes down one level. The crash happens the moment you try to access the directory (either from console, e.g. ls -l or also when accessing it from a webserver).

Both logs are from doing a ls -l from a ssh console. The shared directory is D:\www

winnfsd_crash winnfsd_no_crash

marcharding commented 8 years ago

Symlinks should be fixed with v1.2.0.

Symlinks must point somewhere in the mount, you cannot symlink into the native guest file system.