VMware Communities
KarstenGresch
Contributor
Contributor

How to create symlinks on a Linux guest's shared folder (VM WS 7.1.x)?

Trying to create a symlink with ln -s [target path] [symlink name] on Ubuntu 10.04 and 11.04 guests:

user@ubuntu:/mnt/hgfs/db-win/dev/ws$ sudo ln -s /home/user/develop/ws /mnt/hgfs/db-win/develop/ws/ubu_vm
ln: Creating symbolic link „/mnt/hgfs/db-win/develop/ws/ubu_vm“: Operation not supported
This is independent of whether I run with root permissions (sudo) or as normal user.
Host is Windows 7 64bit.

My question: Is it possible to create symbolik links on hgfs shares at all???

I saw http://communities.vmware.com/thread/297284 as well as http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1007277&sl..., but they don't really match.

So - is there a way to create symlinks on a Linux guest's shared folder and - if so - which one?

Thanks,

Karsten

Reply
0 Kudos
38 Replies
mbeierl
Enthusiast
Enthusiast

HGFS is a presentation of the host file system to the guest operating system.  As the Windows and Linux concept of links are quite different, it is not possible to create a Linux symbolic link on the Windows file system.  The posts you read were about having a symbolic link on the host being usable by the guest.  Your problem is trying to make a symbolic link on the guest using the host's file system, which in the case of Windows, does not appear to work at this time.

I know that Microsoft is working on actual link support but I do not know what level of maturity it has reached or if VMware has plans to make the feature available through the HGFS.

continuum
Immortal
Immortal

you should create the links on the Windows fileszstem directly
use junction.exe or fsutil.exe


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

KarstenGresch
Contributor
Contributor

Hi mbeiert,

thanks for your reply!

>I know that Microsoft is working on actual link support but

>I do not know what level of maturity it has reached

Actually the link support on Windows 7 is quite alright, concepts like hard or soft links do exist.

The sort of symlink support I am looking for is nevertheless independent from the host's symlink support:

Assume you have a folder

/guest/folder

on your Linux guest.

And assume you could create a symlink to it, e.g.

/mnt/hgfs/share/guestslink

pointing to that folder.

What I initially wished was that the content of /guest/folder would have been exposed to the host without the need to copy the content to the hgfs folder.

Cheers,

Karsten

Reply
0 Kudos
KarstenGresch
Contributor
Contributor

Hi continuum,

thanks also for your reply! There's even a quite handy UI integration, Link Shell Extension,  http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html,

Nevertheless, the link support at the host side is not what I am looking for, but a way to expose the content of a symlinked guest folder to the host.

Thanks a bunch,

Karsten

JohnPeterson
Contributor
Contributor

Which Linux guests support symlinks in a Windows 7 VMware Workstation host NTFS share?

This artifact https://sourceforge.net/tracker/index.php?func=detail&aid=2531303&group_id=204462&atid=989708 seems to say that Gentoo guests support "ln -s".

In Ubuntu the operation
cd /mnt/hgfs/shared; touch foo; ln -snf foo fum
return
ln: failed to create symbolic link `fum': Permission denied
and if
sharedFolder0.followSymlinks = "FALSE"
(in the .vmx) it returns
ln: failed to create symbolic link `fum': Operation not supported

The share is mounted with

mount -t vmhgfs .host:/ /mnt/hgfs

# cat /etc/issue
Ubuntu 12.04 LTS \n \l
# sudo dpkg -s open-vm-tools
Version: 2011.12.20-562307-0ubuntu1
VMware Workstation 8.0.2 build-591240

Reply
0 Kudos
MartinLizon
Contributor
Contributor

Where can I track resolution of this high priority issue? This is a problem on Mac OS X as well, a host OS with native support for hard/soft links.

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee

Hi there

Sorry for the long delays here. Smiley Happy

However, symlinks are now fixed in WS 10 coming out shortly.

I will try to get the fix back ported to supported releases too.

This will not fix OS X VMs but all Linux VMs.

I hope this belatedly helps.

Steve

Thanks. Steve
Reply
0 Kudos
JohnPeterson
Contributor
Contributor

## Symlink

> symlinks are now fixed in Fusion 6 coming out shortly

>This will fix all Linux VMs

Does this patch enable symlink support for a Windows VMware Workstation NTFS shared folder mounted with Host/Guest File System in a Linux guest?

Is the symlink file identical to an existing symlink format described at [Wikipedia](http://en.wikipedia.org/wiki/Symbolic_link#Microsoft_Windows)?

What's the file name of the first `VMwareTools-9.?.?-?.tar.gz` that contain this patch?

When is the patch committed to [open-vm-tools](http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/raring/open-vm-tools/raring/changes)?

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee

Hi there,

Does this patch enable symlink support for a Windows VMware Workstation NTFS shared folder mounted with Host/Guest File System in a Linux guest?

Unfortunately no, I have not been given the time to address Windows hosts and support symlinks there. That would be an interesting feature to implement which I would love to have time to do I hope in the future.


I assume the reason you ask is that you have a need for this. Can you either state your use case either here or to me in a private message if you don't feel comfortable making that public.

If I have more details I will file a feature request and track it and can add it in to the schedule.

Is the symlink file identical to an existing symlink format described at [Wikipedia](http://en.wikipedia.org/wiki/Symbolic_link#Microsoft_Windows)?

We would have to map the linux guest implementations of symlinks to those of the Windows hosts - namely Microsoft formats, so yes if and when we implement it.

What's the file name of the first `VMwareTools-9.?.?-?.tar.gz` that contain this patch?

I am not allowed to say what the version number will be and even when as times and numbering can always change. But 9.something whatever that next number happens to be. Sorry I can't be more specific on that.

When is the patch commited to [open-vm-tools](http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/raring/open-vm-tools/raring/changes)?

Again I am prevented from stating any times and dates, but yes it will be included in the open vm tools builds too at some point soon.

Thanks for your patience, and your inputs,

Steve

Thanks. Steve
Reply
0 Kudos
JohnPeterson
Contributor
Contributor

## Symlink

>no, I have not been given the time to address Windows hosts and support symlinks there

Does this patch enable symlink support for a OS X VMware Fusion HFS+ shared folder mounted with Host/Guest File System in a Linux guest?

### Use

>state your use case for symlink support in Windows VMware Workstation

Symlink support for a Linux guest in a Windows host is useful because

* it allow building projects stored in NTFS that use a Linux build script that create symlinks

* this has meaning because some projects, around 10 of the [top 100](https://www.ohloh.net/p), use symlinks in the build script

* storing code in a NTFS volume mounted in the Windows host (rather than the guest) allow

  * better file organisation because all projects can be stored in the same NTFS volume

  * faster file access when changing and searching in code than the alternative NFS or CIFS

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee

Does this patch enable symlink support for a OS X VMware Fusion HFS+ shared folder mounted with Host/Guest File System in a Linux guest?

Yes. The Linux guest was at fault here not the Server side.

* it allow building projects stored in NTFS that use a Linux build script that create symlinks

* this has meaning because some projects, around 10 of the [top 100](https://www.ohloh.net/p), use symlinks in the build script

* storing code in a NTFS volume mounted in the Windows host (rather than the guest) allow

  * better file organisation because all projects can be stored in the same NTFS volume

  * faster file access when changing and searching in code than the alternative NFS or CIFS

Thanks I will add this to bug to track this feature request and the rationale for it. Also if anyone else has other reasons doing so, please add here or send me a private message and I will add to the tracking bug.

Thanks. Steve
Reply
0 Kudos
JohnPeterson
Contributor
Contributor

## Symlink

>Yes. The Linux guest was at fault here not the Server side.


Describe the reason for not supporting symlinks in a NTFS shared folder when it's supported for a HFS+ shared folder

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee

Describe the reason for not supporting symlinks in a NTFS shared folder when it's supported for a HFS+ shared folder

It is not a black and white question of not supporting a feature.

It is simply a question of prioritization of new features, existing fixes, performance improvements, and resources available to do the work.

Current resources == me!

That is the current level of resources for this feature (Fusion and Workstation and all the platforms that go with those), also I have to consider what our PMs tell us about the number of users and the most common environments too.

So some things would be nice to add for sure, but given the number of users who will benefit might actually mean that it a feature is given less of a priority than a feature which benefits all or significantly more of the community.

That is why I ask about use cases and people to come forward and evangelize these things.

Please be assured, this is a feature I would like to add, I just have to put it on the to do list at what seems like a sensible priority and I will get to it as soon as I can.

Thanks again for all your interest.

Steve

Thanks. Steve
Reply
0 Kudos
JohnPeterson
Contributor
Contributor

## Symlink

The purpose of this question is to obtain knowledge about the implementation so that it's clear what's required to support symlinks in a NTFS shared folder too

Is the HGFS symlink stored as a file (i.o.w. compatible with any shared folder file system) or a symlink in the HFS+ shared folder?

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee

JohnPeterson wrote:

The purpose of this question is to obtain knowledge about the implementation so that it's clear what's required to support symlinks in a NTFS shared folder too

My first response here is why do you need to know/care about what the host side file system does for symlink implementation?

I'll try and explain why I think you should not need to know but your setup might mean you do.

Anyway, the main goal of the VMware Shared Folders file sharing feature is to present to the virtual machine (VM) applications a view of the host file system with VM OS file system semantics so that any application being run in that VM can use the file system as it would if it was operating on the local disk to the VM. In other words, if the host OS is Windows and the VM OS is Linux, the Linux HGFS client will provide Linux OS file system semantics even though the underlying file system on the host is probably NTFS. So for example symlinks support would be implemented on the host server side making the Win32 API calls and implemented by the Windows NTFS (or FAT) file systems. However, the Linux VM running the VMware Linux HGFS client would provide the Linux OS symlink support and semantics to the applications running and accessing files under /mnt/hgfs. The mapping of any differences in implementation would be handled internally between the HGFS server on the host and the HGFS client running in the VM OS.

The reason for this is that we can expect all applications in the VM OS to run unmodified and without issue. Also we must do this to enable the ability of VMs to be copied from one machine to another, even ones where the host OS will be different. This can really only be done when clients are agnostic to the host OS and its file system semantics.


Obviously, there are differences that do occur between different OS's file system semantics and when these do occur we do our best to either hide them or handle them or provide workarounds so that applications continue to work as is. E.g. file names have different sets of characters that are legal.

To achieve mappings between host OS features and virtual machine OS features another of our goals is to not put any proprietary data or assumptions to files stored on the host. This can and probably would create issues with other host native applications that also have access to those files. Furthermore, if we did store any private data in those files, chances it would be lost when a host application accessed it and modified the file in any way.

So unless you have a need for the host side application to handle Windows symlink support aside from the Linux OS VM build environment, you should not need to care about the Windows symlink implementation. Even then you should be able to expect that using the Win32 API symlink support is all you would need to use just as any other Windows application would do and create links in parts of the NTFS file system that could be shared to VMs.

I hope this answers your question.

Steve

Thanks. Steve
Reply
0 Kudos
JohnPeterson
Contributor
Contributor

## Symlink

The message don't answer this question

>Is the HGFS symlink stored as a file in the HFS+ shared folder?

I.o.w. does this Linux guest command

  ln -s /home/user/folder /mnt/hgfs/shared/link

when the HFS+ shared folder is

  path: /Users/user/shared

  name: shared

  mounted in the guest at: /mnt/hgfs/shared

create the file

  /Users/user/shared/link

with the content

  /home/user/folder

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee

The symlink is created on the host file system. Same as if you modified the files, the data on the file itself is modified on the host file.

So the native host applications can also see and access and use the symlink.

We don't copy files but you have complete access to the host file system component of the volume that the share provides access to.

(Within the limits of the user account running the Workstation application.)

So that kind of operation will fail as one of the constraints we have to place is that you cannot create links out of the share.

The link is created on the host file system and then if we followed the link we would follow it on the host not the VM's file system.

That would also be a security issue.

Steve

Thanks. Steve
Reply
0 Kudos
JohnPeterson
Contributor
Contributor

## Symlink

>The symlink is created on the host file system

>So that kind of operation will fail as one of the constraints we have to place is that you cannot create links out of the share.

Is this true

I.o.w. this Linux guest command

  ln -s /mnt/hgfs/shared/folder /mnt/hgfs/shared/link

when the HFS+ shared folder is

  path: /Users/user/shared

  name: shared

  mounted in the guest at: /mnt/hgfs/shared

create the HFS+ symlink

  /Users/user/shared/link

that point to

  /Users/user/shared/folder

Creating a link that point to a folder outside the HFS+ shared folder return "Operation not supported"

f.e. this command in the Linux guest

  ln -s /home/user/folder /mnt/hgfs/shared/link

  ln: failed to create symbolic link ‘/mnt/hgfs/shared/link’: Operation not supported

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee

The absolute link would be created on the host side and would be accessible from the guest.

However, as absolute paths were specified the symlink would NOT be able to be followed on the host side.

E.g the link would contain the /mnt/hgfs/shared/folder

Yes, creating links out of the share would create an error, either not supported or maybe a permissions error.

As it would be not a permitted to do so - I would have to verify that exactly.

Steve

Thanks. Steve
Reply
0 Kudos