How to use shared folders with Elementary OS on Virtualbox
elementary OSThis forum is for the discussion of elementary Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to use shared folders with Elementary OS on Virtualbox
Hi All,
i am just started to use elementary os in a virtualbox environment. The version of Virtualbox is: 5.1.8 r111374 (Qt5.5.1)
The version of ElementaryOS is 0.4 Loki (64 bits)
Since I want to share files between the host and guest system I've created a shared folder in Virtualbox. I checked both the options mount automatically and make permanent. After that I rebooted the guest system to be sure the shared folder will be available.
Ok, so now I do see at the right bottom of the (virtualbox) screen an icon of a folder, which displays the activity of the shared folder.
But, my question is: where do I find the shared folder in ElementaryOS and how am I able to access the shared folder.
Ugh, I had typed a reply and the thing got borked. Let's try again, shall we?
IIRC Elementary is Ubuntu based. So, if you haven't already, install guest additions. On my Debian system, it's virtualbox-guest-dkms. Yours should be similar, if not the same.
Code:
apt-get install virtualbox-guest-dkms
as root.
Log off and back in. That share may now be available in your file manager, but I doubt it.
If not, as is likely, then,
Code:
mount -t vboxsf -o rw,uid=1000,gid=1000 <share name> <mount point>
again as root, with <share name> and <mount point> replaced as appropriate. Unfortunately VBox's option has a misleading name, it only automatically makes that share point available, it does not automatically mount it, last I used VBox.
I succesfully installed the guest additions and rebooted the system. Now I see the shared folder in my file manager.
There is sf_share in the devices section. (I named the folder in my windows environment: share).
Unfortunately when I click on the folder I get the following message: This folder does not belong to you. You don't have permission to view this folder.
Will this be solved with the second command which you placed before? I didn't execute that one, because I'm not sure what to use as mount point. And I assume that <share> will be the name, so this can be just a name, right?
Ok, I executed the last command and now I do see the share and have access.
But...
I did a test and made a test.txt file. I can see and open the file in both windows and Elementary, however on my Windows host I am able to change the file and see the changes in te Linux guest. When I open the file in Elementary and make a change, this change is not saved to the file. (also tested this in the folder Documents and there I can create and change files).
When I open the file in Elementary and make a change, this change is not saved to the file. (also tested this in the folder Documents and there I can create and change files).
I am wondering what the solution to this would be.
----------------------------------------
So when I use the elementaryOS app scratch to create or edit a file on my guest system in the shared directory the changes are not saved (it works fine at standard user directories such as /Home/Documents/ )
The VBox sf stuff is working. (maybe try running scratch&all as root)
I don't use the Linux 'GUI' (like scratch), so I wouldn't be able to help there.
Maybe there's another (other than scratch) program that you could try.
(maybe there's something about scratch that doesn't work over vboxsf)
A workaround would be to: edit files in your home, then `cp` them to /media/sf_share
Since this 'should' work, there's probably something we're overlooking.
Sorry that I don't have a better answer. Best wishes...
Obscure thought: just before you save/write, strace -f -o junkfile -p <PID of scratch>
Ctrl-C, then look for write to sf in junkfile
When I open the file in Elementary and make a change, this change is not saved to the file. (also tested this in the folder Documents and there I can create and change files).
Are you getting any error messages? Have you done so with a text editor in a terminal? Perhaps the GUI is hiding any error or warning, so try with something like:
Code:
echo "dummy" > delete.me
And see if the problem happens with this file, and note any errors.
from a terminal session this works fine. But from the app scratch not.
Maybe this is something with rights?
Perhaps. There are some apps that have problems with things like network shares and the like. Perhaps the way VB's shared folders are implemented may produce similar behavior.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.