Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can you access files in folders that are links, on a shared folder in VirtualBox?

For instance, I've got a folder named

/home/mrlister/misc

on my host computer, which is shared as /media/sf_misc in my (Linux) VB guest OS. Now I can read the files in /media/sf_misc/ just fine, but I've also got a link in there, docs, that points to /home/mrlister/Documents.
And the problem is, when I try to access /media/sf_misc/docs I get an error saying

This link cannot be used, because its target "/home/mrlister/Documents" doesn't exist.

Now under other circumstances, I'd conclude that it's simply impossible for programs in the VB to gain access to linked material that I haven't shared explicitly in the settings.
However, I have another virtual computer, which is running Windowx XP, and that one can access said link in the same shared folder just fine! That is, it can look at file://///VBOXSVR/misc/docs and not try to follow the link, it just treats docs as an ordinary directory.

So, what do I have to do in order to achieve the same functionality on a virtual Linux machine? I'm not sure what to try.

share|improve this question
1  
I would hazard a guess that Windows guest is seeing the Link as a folder, whereas your Linux guest is seeing the link as a link to /home/mrlister/Documents ON THE LOCAL FILESYSTEM inside the guest, which doesn't exist of course. I hope I explain myself –  Keith Oct 13 '13 at 13:42
    
That's a possible explanation. But is there a solution? –  Mr Lister Oct 13 '13 at 13:53
    
Well, trawling the virtualbox forums leads mostly to discussion of the problems with creating links on shared folders, apart from that in the past, accessing symlinks failed also on windows guests, and that was "fixed". I can't find a discussion of a samba style "follow symlinks" option. What happens with a hard link? If the problem is in fact as you have defined it, and not an example you wrote to describe something else, then what about a simple workaround? Out of interest, how does a hardlink behave? –  Keith Oct 13 '13 at 14:48
    
Not to start a discussion here, but I can confirm the same behaviour on a windows host with windows and linux guests. With a windows guest the link is followed host side and with a linux guest the link is resolved guest side. virtualbox.org/ticket/10085#comment:7 has some clarification. You might do best to bring this up on the virtualbox forums and once you have researched everything there, possibly open a ticket, but read virtualbox.org/wiki/Bugtracker first. I am going to answer your question. –  Keith Oct 13 '13 at 16:05
    
OK, I'll dive into that. As to your question if a hard link works: yes, but only with normal files, not with folders. So I'd have to make links to all the files in the desired folder, and add new links as I create new files. No, then I'd be better off turning it into a new shared folder. –  Mr Lister Oct 13 '13 at 16:56
add comment

1 Answer

The simple answer is it cannot be done, not with the current version of VirtualBox anyway. Please see my comments on your question for more details.

share|improve this answer
    
VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1 ;) –  Rinzwind Apr 11 at 7:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.