How can I write, modify, and delete files on mounted file system yet not able to create link.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

How can I write, modify, and delete files on mounted file system yet not able to create link.

Post by mpack »

<NOTE: The "poster id" tag on this post was reassigned to me (mpack) after it turned out that the original poster was a spammer (with ad in profile). This became clear when identical posts popped up under different names, all with a spam link in the profile. I could delete the topic, but I think the conversation is useful and should be kept>

Hello

I'm running Xubuntu in a Virtual Machine (VirtualBox) on a Windows 10 host. I've mounted a directory from the Windows file system as a vboxsf in the guest. This background is provided in case it's necessary, but I believe it to be a linux issue.
This directory and all of its files are accessible to me in the write mode (everything is -rwxrwxrwx). I have the ability to add, edit, and remove files and directories there.
However, attempting to chown a fikgh.le or directory to a different owner or build a soft link (ln -s) results in the following message:
ln: read-only file system; unable to create symbolic link'myLink'
Including unmounting and remounting, I've tried everything I can think of .



Any help will be appreciated.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How can I write, modify, and delete files on mounted file system yet not able to create link.

Post by mpack »

That's correct. Apparantly GA shared folders can't contain softlinks. I struggle to get them working even on a full network share. That would be because softlinks are a Linux feature, and while NTFS does support them, I rarely see them used.

You understand I hope that a shared folder is a view on a host folder, so it can't have features unless the host filesystem supports them.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: How can I write, modify, and delete files on mounted file system yet not able to create link.

Post by fth0 »

See LG - Shared Folder following symlinks for how to allow the guest to follow symlinks on the host. I don't know if it also allows you to create a symlink, though, but I'm sure you'll tell us. ;)
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: how I able to write and delete files on mounted file system yet not create links

Post by mpack »

<The following was posted to a topic which turned out to be spam prep, but I think the post is useful so I moved it here, to the topic I reference in the text>

It's really quite simple. Softlinks are a feature of Linux filesystems. A shared folder is not a filesystem, it's a software interface - like a web page. Could you store symlinks in a field on a web page? Can you upload symlinks without dereferencing them? I don't see how.

Behind the software interface is an NTFS folder. It don't do symlinks.

It might be different if Linux stored symlinks like Windows stores shortcuts, but it doesn't. There is no physical file, it's just a flag in a Linux directory entry.

Volunteer Fth0 contradicted a similar statement I made a couple of days ago, but I still don't see how any of the above can be wrong.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: How can I write, modify, and delete files on mounted file system yet not able to create link.

Post by fth0 »

TL;DR: From a Linux guest to a Windows host, creating links does not work, following links does.

To investigate what works and what not, I've just done a few tests creating and following symlinks:

1. On a Windows 10 host with an NTFS file system, I opened a command prompt with user privileges, and created a file Test.txt and a folder Test in the Documents folder. Then I opened a command prompt with administrator privileges, went to the Test folder and created an NTFS symbolic link to the Test.txt file using mklink ..\Test.txt 2Test.txt (preparation for following symlinks).

2. In the VM configuration of a Linux Mint VM, I shared the folder Test, and allowed the creation of symlinks using VBoxManage setextradata "Linux Mint" VBoxInternal2/SharedFoldersEnableSymlinksCreate/Test 1 (preparation for creating symlinks).

3. After starting the VM, I changed the vboxsf module configuration using echo "options vboxsf follow_symlinks=1" | sudo tee /etc/modprobe.d/vboxsf.conf > /dev/null and rebooted the guest OS (preparation for following symlinks).

Test 1 (creating symlinks): In the VM in the shared folder Test, I created a new local file Test2.txt and tried to create a symlink using ln -s Test2.txt 2Test2.txt without success. This is consistent with the VirtualBox User Manual stating that the creation of symlinks inside a shared folder only works on Linux, macOS and Solaris hosts.

Test 2 (following symlinks): In the VM in the shared folder Test, I opened the 2Test.txt symlink in a text editor and successfully modified the Test.txt file, which was located in the otherwise unreachable Documents folder. This means that the guest can follow symlinks on the host that were created from within the host OS.
Post Reply