Shared folders ALMOST working...

Discussions related to using VirtualBox on Windows hosts.
Post Reply
bleriot13
Posts: 8
Joined: 12. Jan 2009, 16:14

Shared folders ALMOST working...

Post by bleriot13 »

Hi,

I have set up an Ubuntu 8.04 guest on an up-to-date XP SP 3 host. I use VB 2.1.0 I have also installed the GA 2.0.6 in the Ubuntu guest.

Once the VM is running, I set up a shared folder using the Devices->Shared folders menu entry.

The directory in the host is c:\users\jnavarro
The public name is jnavarro.

I have created a folder in Ubuntu: /home/administrador/Windows

Then, inside an Ubuntu's terminal I mount the share:

Code: Select all

sudo mount -t vboxsf jnavarro /home/administrador/Windows
which succeeds.

Then, I open the shared folder in Ubuntu. I can see the files there. I can open a folder named 'arch' and then I can even create a file there named xxx.txt.

I open it using a text editor (gedit) and enter some text. The problem arises when I try to SAVE the file: I get the following error message:

Code: Select all

No se puede guardar el archivo /home/administrador/Windows/arch/xxx.txt.
(Translation from spanish: it is not possible to save file /home..../xxx.txt)

Surprisingly, after quitting the text editor, I can DELETE xxx.txt from the Ubuntu side!

On the other hand, I can edit and save changes to xxx.txt from the host (XP) side (remember: the file was created in Ubuntu). These changes are visible on the Ubuntu (guest) side.

Any ideas about what might be happening? Folder sharing is the only thing remaining to have my guest properly running...

Thanks alot.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Look at the uid, gid, mode and mask options. You need to set these so that the ownership and access of the share is what you want. Do a sudo mount.vboxsf --help to see the option list.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
bleriot13
Posts: 8
Joined: 12. Jan 2009, 16:14

Post by bleriot13 »

Terry,

thanks for the suggestion. Following your advice and the hints given by Sasquatch in

http://forums.virtualbox.org/viewtopic. ... 9ec16c2fa5

I modified my fstab file adding the following line

Code: Select all

jnavarro /home/administrador/Windows vboxsf  rw,auto,uid=1000,gid=1000,umask=0000 0 0
Previously, I found the gid and uid values typing

Code: Select all

echo $UID
echo $GROUPS
which returned 1000 and 1000 respectively.

Apparently, the situation hadn't changed. Looked like I could create and delete files from both sides (XP host, Ubuntu guest), but only edit these files from the XP side. Again, it looked like if Ubuntu refused to save any changes when editing a file.

But, the problem is not the shared folder but gedit, the text editor I was using to test the edit-save process!!! Permissions looked right, so, apparently, the user (not root) was the owner of the files and it could read & write files. So I, don't ask me why, decided to open the same file using OpenOffice.org writer and, after making some changes, I could save it to disk! The same happened when I used vim! I haven't checked other editors, as emacs, because these are not installed in my system. However, I have tested other OpenOffice programs and they work as a charm using the shared folder.

So the problem is produced by gedit, that, somehow, finds a problem when trying to save the file in the shared folder. Obviously, I checked whether gedit was able to edit / save files in other non shared folders and it works well.

So this still remains as a mystery for me. At least, I can use the shared folder.

Thanks a lot and excuse me for such a long post. I just wanted to provide with as much information as possible so other users may use it...
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Hi. You may also need to set a dmode and fmode.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
gantengx
Posts: 1
Joined: 23. Jan 2009, 10:25

Post by gantengx »

I can confirm this is a gedit problem. I am also having the exact same problem. Files can be edited with other applications (vim, gvim, kate, scribes) however, when using gedit, it will gives an error message saying that file is busy..

I hope someone will fix this.... I've updated to latest version of gedit (2.24.2) and still no luck
Post Reply