VMware Communities
sshanson
Contributor
Contributor

Is there a fix for broken symbolic links from Ubuntu to Mac Snow Leopard?

I have just upgraded my VMWare Fusion from version 3 to version 4.1.1. My Mac is running Snow Leopard version 10.6.8. I am running Ubuntu 11.10 desktop in a virtual machine and I have shared my Mac home directory on the Ubuntu machine over hgfs.

If I access a symbolic link on my Mac home directory from the Ubuntu file system the symbolic link does not work.

To reproduce:

On the Mac side, create a directory ~/tmp.

Make the Mac home directory a shared directory to the Ubuntu virtual machine

On the Ubuntu VM,

cd /mnt/hgfs/<username>/tmp

echo "This is a test over hgfs" >foo

ln -s foo bar

tail bar

tail: cannot open `bar' for reading: No such file or directory
Tags (2)
Reply
0 Kudos
2 Replies
sshanson
Contributor
Contributor

Nearly one year later, and now with Mac OSX Mountain Lion 10.8.2, Ubuntu 12.04 and VMWare 5.0.2, the same problem still exists. Can someone at VMWare please at least acknowledge the problem and offer a fix?

Reply
0 Kudos
steve_goddard
VMware Employee
VMware Employee

Hi there,

Sorry for the long delay in getting to reply to you on this.

The short answer here is that there were design decisions about symlinks creation and following of symlinks through shared folders that means you cannot do both at the same time on the same share.

That is to say, both create a symlink and follow it or in your example read the target file. So you can happily create symlinks on your share by default, but following the symlink and accessing the target will fail by default.

This decision is under review. Following symlinks can add a large performance overhead as the code has to check where the target goes to and ensure that it remains inside the share and does not go elsewhere on the host otherwise it is a security flaw.


However to allow following symlinks for a share, you can create a separate share that will overlap where your host folder is on the Mac side.

Then edit the VM's VMX file and add a new setting for that new share you created (see editing the VMX file below).

To edit the VM's VMX file. You should stop the VM and Fusion then edit the file and save it (back it up first for good measure) with the new setting.

Restart Fusion and the VM.

Use the new share for reading the target file's contents of the symlink (tail bar in your example), and use the original share to create symlinks.

Editing the VMX file:

In Finder go to the folder and it if it is a vmwarem then highlight it and bring up the context menu and select show package contents.

In that folder of the VM, find the file with the .vmx extension and edit it in TextEdit for example.

Scroll down the file and locate the

sharedFolderX.present = "TRUE"

and the other sharedFolder lines where X is just the number of the shared folder.

There could be many depending on how many you use and have created.

Add the following line for the shared folder you want to enable following of symlinks on:

sharedFolderX.followSymlinks = "TRUE"

X is the number of the shared folder you want to modify.

You can always change this to "FALSE" or delete the line (once Fusion is not active) if you want to revert the setting.

I hope this helps.

Thanks. Steve
Reply
0 Kudos