Shared folder on Ubuntu (Guest) with Windows (Host) stops working after shutdown of Guest

Discussions about using Linux guests in VirtualBox.

Shared folder on Ubuntu (Guest) with Windows (Host) stops working after shutdown of Guest

Postby lrdrad » 3. Nov 2017, 15:43

So I have been trying to setup a shared folder between by Windows [H] and Ubuntu[G] and can get it set up working properly (following directions from youtube and/or forums). But when I go back to the shared folder after a shutdown of the G and/or H the shared folder no longer works.

I'd prefer not to have to setup the shared folder every single time I start up my systems.

Also note: I am very very inexperienced with Linux terminal commands so I do not even know where to begin to test for the possible problems.
lrdrad
 
Posts: 3
Joined: 3. Nov 2017, 15:38

Re: Shared folder on Ubuntu (Guest) with Windows (Host) stops working after shutdown of Guest

Postby mpack » 3. Nov 2017, 15:53

What does "no longer works" mean? Has the folder disappeared from the host?
mpack
Site Moderator
 
Posts: 25497
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Shared folder on Ubuntu (Guest) with Windows (Host) stops working after shutdown of Guest

Postby lrdrad » 3. Nov 2017, 16:03

So the folder is still present on both H and G but a file saved or put into the folder does not appear on the other system.

For example: Create a new file on Host and save it to the shared folder, the file does not appear into the guest shared folder.
lrdrad
 
Posts: 3
Joined: 3. Nov 2017, 15:38

Re: Shared folder on Ubuntu (Guest) with Windows (Host) stops working after shutdown of Guest

Postby mpack » 3. Nov 2017, 18:11

lrdrad wrote:For example: Create a new file on Host and save it to the shared folder, the file does not appear into the guest shared folder.

Implies that guest OS is not checking for changes in folder.

What happens when you try it the other way?

And are we talking Guest Additions Shared Folders or a true network share?

I think we need to see a VM log too: with the VM fully shut down, right click and "Show Log" in the GUI, save "VBox.log" (no other file) to a zip, and attach the zip here.
mpack
Site Moderator
 
Posts: 25497
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Shared folder on Ubuntu (Guest) with Windows (Host) stops working after shutdown of Guest

Postby lrdrad » 3. Nov 2017, 20:12

The same thing the other way. No file transfer from H to G or G to H.

I have been using Guest Additions Shared Folders.

I have attached the VBox.log
Attachments
Ubuntu-2017-11-03-14-10-01.zip
(30.81 KiB) Downloaded 3 times
Last edited by socratis on 3. Nov 2017, 20:15, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
lrdrad
 
Posts: 3
Joined: 3. Nov 2017, 15:38

Re: Shared folder on Ubuntu (Guest) with Windows (Host) stops working after shutdown of Guest

Postby mpack » 4. Nov 2017, 10:22

Then I'll need to leave you to a Linux expert, because AFAIK it is impossble (*) to copy a file into a shared folder, for the copy to proceed and complete without error, and yet the Windows folder host can't see the file. You are directly using the host, right? I.e. it isn't a network connection and you aren't sharing a share?

(*) Actually, there are configuration errors which can affect how often Windows refreshes a network share to make the contents visible to its own filesystem browser. But, this only applies to network shares. Not local, physical folders. So a Windows host should always be able to report the contents of its own local folders.
mpack
Site Moderator
 
Posts: 25497
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Shared folder on Ubuntu (Guest) with Windows (Host) stops working after shutdown of Guest

Postby Perryg » 4. Nov 2017, 13:54

I would like to know what the procedure was that you used to mount the shared folders? The log file shows auto-mount but it sounds like you are manually mounting the shared folder to get it to work.
Personally I don't use the auto-mount because it mounts the shared folder as media and not a typical mount and sometimes does weird things like what the OP is seeing.

Steps I use to mount shared folders:
    1) create the shared folder in VirtualBox ( use simple words and no characters ).
    2) in a guests terminal I create the mount point, sudo mkdir /mnt/share
    3) create the mount ( sudo mount -t vboxsf -o rw,uid=1000,gid=1000 share /mnt/share )
    4) to make this mount at boot I place mount -t vboxsf -o rw,uid=1000,gid=1000 share /mnt/share in /etc/rc.local so it runs at boot.

Special notes:
uid and gid may be different on your guest so verify them.
Sometimes the guest boots too fast and the VBox modules have not been completely loaded so you need to slow down the /etc/rc.local mount statement. Add a sleep cycle like below.

Example
Code: Select all   Expand viewCollapse view
sleep 10 && mount -t vboxsf -o rw,uid=1000,gid=1000 share /mnt/share &
Perryg
Site Moderator
 
Posts: 34280
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 5 guests