LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > elementary OS
User Name
Password
elementary OS This forum is for the discussion of elementary Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 11-13-2016, 02:46 AM   #1
Drusilla
LQ Newbie
 
Registered: Nov 2016
Posts: 6

Rep: Reputation: Disabled
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.
 
Old 11-13-2016, 03:22 AM   #2
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
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.
 
Old 11-13-2016, 04:04 AM   #3
Drusilla
LQ Newbie
 
Registered: Nov 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hello Goumba,

thanks for your reply.

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?
 
Old 11-13-2016, 04:38 AM   #4
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
This: sudo usermod -a -G vboxsf <user> (Log out and in again to pickup the change!)
 
Old 11-13-2016, 05:37 AM   #5
Drusilla
LQ Newbie
 
Registered: Nov 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
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).
 
Old 11-17-2016, 11:15 PM   #6
Drusilla
LQ Newbie
 
Registered: Nov 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Drusilla View Post
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.
 
Old 11-18-2016, 05:19 AM   #7
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
Strange... 'shouldn't happen' Here's some ideas to try in a terminal (Ctrl-Alt-T):
(Your directory will be different from mine!)
Code:
user@user-VirtualBox ~ $ cd /media/sf_tmpw/
user@user-VirtualBox /media/sf_tmpw $ echo hi > myfile
user@user-VirtualBox /media/sf_tmpw $ ls -l myfile
-rwxrwx--- 1 root vboxsf 3 Nov 18 03:14 myfile
user@user-VirtualBox /media/sf_tmpw $ df myfile
Filesystem     1K-blocks      Used Available Use% Mounted on
tmpw           232419324 150630356  81788968  65% /media/sf_tmpw

============= on PC host: ================

C:\tmpw>dir myfile

 Directory of C:\tmpw

18/11/2016  03:14                 3 myfile
               1 File(s)              3 bytes
               0 Dir(s)  83,751,903,232 bytes free

C:\tmpw>type myfile
hi

C:\tmpw>
The `df myfile` is 'unorthodox' but an important 'sanity check' (of: PC disk for sure?)!

Last edited by Jjanel; 11-18-2016 at 05:25 AM.
 
Old 11-19-2016, 12:54 AM   #8
Drusilla
LQ Newbie
 
Registered: Nov 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Ok, now I am confused

I followed your steps and it works out fine:

jay@Elementary:/media$ cd sf_share/
jay@Elementary:/media/sf_share$ echo hi > myfile
jay@Elementary:/media/sf_share$ ls -l myfile
-rwxrwx--- 1 root vboxsf 3 nov 19 07:45 myfile
jay@Elementary:/media/sf_share$ df myfile
Filesystem 1K-blocks Used Available Use% Mounted on
share 123706364 87131284 36575080 71% /media/sf_share
jay@Elementary:/media/sf_share$

--------------------------
And on the host:
--------------------------

Directory of D:\70 VirtualBox\share

19-11-2016 07:45 <DIR> .
19-11-2016 07:45 <DIR> ..
13-11-2016 12:29 46 .goutputstream-UFUOQY
19-11-2016 07:45 3 myfile
19-11-2016 07:43 <DIR> temp
2 File(s) 49 bytes
3 Dir(s) 37.452.881.920 bytes free

D:\70 VirtualBox\share>type myfile
hi

D:\70 VirtualBox\share>


----------------------------------------
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/ )
 
Old 11-19-2016, 03:13 AM   #9
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
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

Last edited by Jjanel; 11-20-2016 at 10:25 PM.
 
Old 11-19-2016, 08:09 AM   #10
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by Drusilla View Post
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.
 
Old 11-19-2016, 09:56 AM   #11
Drusilla
LQ Newbie
 
Registered: Nov 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
from a terminal session this works fine. But from the app scratch not.
Maybe this is something with rights?
 
Old 11-19-2016, 10:05 AM   #12
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by Drusilla View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Puzzled by Virtualbox shared folders sundialsvcs Linux - Virtualization and Cloud 1 03-03-2016 10:43 AM
[SOLVED] Shared folders on virtualbox 5 techdude Linux - Software 1 11-01-2015 08:00 PM
VirtualBox shared folders speedygeo Linux - Software 11 10-15-2011 05:21 PM
VirtualBox and Windows Shared folders Ishkabibble Linux - Software 2 04-22-2010 04:41 PM
[SOLVED] VirtualBox-no shared folders patostevens Slackware 7 12-29-2009 08:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > elementary OS

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration