Posts Tagged ‘Vista’

Symbollic Links on Vista and Windows 2008

// July 5th, 2009 // 1 Comment » // Windows Server Core 2008

After changing jobs years ago and focusing more time on Windows and less on Linux I had nearly forgotten how handy symbolic linking is.  I’ve played with using junctions with NTFS, but didn’t have to use them often.  Now that I’m running Vista and Server 2008 I’m remembering why I used to love symbolic links.  We now have the mklink command in both operating systems, and it’s pretty simple (although it’d be hard to mess something so basic up):

C:\>mklink /?
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

/D      Creates a directory symbolic link.  Default is a file
symbolic link.
/H      Creates a hard link instead of a symbolic link.
/J      Creates a Directory Junction.
Link    specifies the new symbolic link name.
Target  specifies the path (relative or absolute) that the new link

However, after creating my symbolic link and sharing it I experienced a strange issue on my remote Vista machine.  I received the error message: “The symbolic link cannot be followed because its type is disabled.”

I immediately thought it was a Vista security issue and I could probably find something to change under secpol.msc.  After a little digging I found one policy for symbolic links under Local Policies > User Rights Assignment > Create Symbolic Links
secpol_1

That was great to know, but I was already an admin so creating the link wasn’t an issue.  After digging around there I checked out gpedit.msc:
gpedit - Symbolic Link EvaluationBingo.  That setting can be tweaked to:

  • Local Link to a Local Target
  • Local Link to a Remote Target
  • Remote Link to Remote Target
  • Remote Link to Local Target

Needless to say that’s very helpful setting to have if you’re going to have Vista or Server 2008 clients access the symlinks.  I also discovered that because this is considered part of the NTFS file system that you can use the handy fsutil command to tweak this.  If you’re not in a domain environment and experiencing this issue you can simply run these commands:

  1. fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
  2. fsutil behavior query symlinkevaluation

The second of which should have output like this:

  • Local to local symbolic links are enabled
  • Local to remote symbolic links are enabled.
  • Remote to local symbolic links are enabled.
  • Remote to Remote symbolic links are enabled.

Try it again and you should be able to access your data.