3

So I have virtualbox with shared folder

linux host:

/home/www/shared
/home/www/shared/storage -> /home/www-storage/

what linux guest sees:

/var/vb-share
/var/vb-share/storage -> /home/www-storage (i want virtualbox to follow symlink instead)

How to make virtualbox follow host machine symlink?

I can mount --bind folders and it works ok but I would rather use symlinks.

I also can just use /home/www-storage as second share but symlink would be more convenient for me.

There is plenty of questions related to creating symlink on linux guest from windows host but I think this is different. I don't want to create symlinks in guest OS. I want virtualbox to follow symlink in host OS.

I found this answer but it doesn't seem to work (I use vagrant) and I don't need to create links on guest. I want host follow symlink in shared folder.

Another user says "Short answer is it cannot be done." but the answer is from 2014.

0

2 Answers 2

3

I've just spent ages trying to figure this out, linux host/guest with 2 shared folders.

1 shared folder contains host created symlinks to the other shared folder, guest is trying to resolve the links but couldn't follow them as the path was incorrect for the guest (ie symlink points to /media/folder/file.aaa (which exists on the host) instead of /media/sf_folder/file.aaa (which is where the folder is mapped to on the guest).

So I was about to go down the samba route but there is a much simpler soluition, if you create a drop in file: /etc/modprobe.d/vboxsf.conf on the guest with this single line in it:

options vboxsf follow_symlinks=1

then reboot the guest, the host will now resolve symlinks so that the guest can follow them!

source: https://www.virtualbox.org/ticket/17491?cversion=0&cnum_hist=7

1

You want the symlink resolution to be done on the host and not on the client. To do that you can use a network file system like Samba running on the host. The clients will mount the file system via CIFS.
Some notes:

1) you want to make sure the the target is on the same share OR that wide links are enabled on the share with the symlink.

2) you want to make sure that "unix extensions" are disabled on the server or that the symlink's target is on the same 'share'.

If you need unix extensions AND wide links, you need to set the "allow insecure wide links" option to true.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .