file in share folder don't update correctly in CentOS 7

Discussions related to using VirtualBox on Mac OS X hosts.
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

I've centOS 7 on Vbox (Macosx Yosemite).

when I update a file (page.php) from host then when I run the page in browser I receive an error (SyntaxError: illegal character... it's like I write bad the encoding). If I update the same file from guest by "vi" then the file (page.php) is right, that is into browser work fine without error.

I mount the folder so:

Code: Select all

mount -t vboxsf workspace_XXX /var/www/workspace_XXX/ -o fmode=770,dmode=770,uid=webuser,gid=webuser,iocharset=utf8
in /etc/rc.local

and mount -l is:

Code: Select all

none on /var/www/workspace_XXX type vboxsf (rw,nodev,relatime)
Why?????

thanks

ps eclipse is (see attach):
Attachments
Schermata 2015-10-05 alle 17.02.58 copia.jpg
Schermata 2015-10-05 alle 17.02.58 copia.jpg (105.28 KiB) Viewed 3695 times
Last edited by oscaroxy on 5. Nov 2015, 11:17, edited 1 time in total.
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

Nooooooooooo, it's wrong than I thought ...

I tried to delete a file and update the source file, the file is a file swf and I update the .mxml file (source), only with Flex I can regenerate that file from mxml to swf, with command run... that file never regenerate until I rewrite old source file ...

it's like if the share folder take a timestamp, if I update from host nothing can happen, only when I update from guest then the file into share folder work fine ...

Why???
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: file in share folder don't update correctly in CentOS 7

Post by Martin »

Do you see the changed files with a normal file browser inside the guest?
The shared folders are not designed as working directory for applications, just for an easy way to transfer files between guest and host.
Many advanced features like access control and file locking don't exist in a shared folder.
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

yes, I see file size changed and also the source's changed... but in browser give me syntax error. If I open the same file (swf, html, etc...) by "vi command" and save it (by :wq command) then the browser read correctly the file.

That you write isn't completely true, in fact I have centOS 6.5 configured egual to centOS 7 (egual egual, the shared folder in 6.5 is correct while in 7 I've the "none" instead the name folder) and work fine.... so in Virtualbox with centos 7 there is a problem

thanks
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: file in share folder don't update correctly in CentOS 7

Post by Martin »

The shared folders are not designed for this, so if it worked before you were lucky. ;)
Maybe also the newer software versions of CentOS 7 are doing something different than before in 6.5.
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

mmmmmmh, if you have right, what'is it the right method?


that is, I've in vbox (guest) the webserver (apache, mysql, php) and in host I've the source files where webserver access, because in host I've the eclipse in order to work...

How I share that file between host and guest?
thanks
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: file in share folder don't update correctly in CentOS 7

Post by Martin »

The only full featured way for a shared access to files is a "real" network share.
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

it isn't possible, because so I need of LAN every time, instead now with centos 6.5 I work in local, without wi-fi or LAN ...

another solution???

but do Virtualbox recognizes the bug?
why?

thanks
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: file in share folder don't update correctly in CentOS 7

Post by Martin »

For the shared folders it is "working as designed".
You could try a host only network adapter to be independent of LAN/WLAN.
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

yes, I use that, "only host" in vbox and I use "shared folder" for shared the file between webserver and eclipse ...

how do I resolve this?

thaks
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

so shared folder isn't usable for web server file?
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: file in share folder don't update correctly in CentOS 7

Post by loukingjr »

VIrtualBox shared folders are not as full-featured as a network share nor are they meant to be. They are for convenience to transfer a file from hosts and guests. So if it doesn't work for you as you are trying to use it, the answer is no.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

for me is impossible to think that work in every VM (CentOS 6.5, Ubuntu , Windows Xp, 7, 8.1 ... ) but not in CentOS 7...
Because also in CentOS 7 I see the file into guest, the bug is:
the file don't refresh when I update it into host.

But when I "re-mount" the folder then all work fine ...
(that is, I don't umount, but only

Code: Select all

mount -t vboxsf workspace_XXX /var/www/workspace_XXXf/ -o fmode=770,dmode=770,uid=webuser,gid=webuser,iocharset=utf8
to every files updated/new/deleted)

I resolved the "none" problem in:

Code: Select all

https://forums.virtualbox.org/viewtopic.php?f=8&t=70492
removed auto-mount from VM and add into rc.local mount to share_folder

after I obtain this, problem...
About me is an error in VirtualBox 5
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

Writing this post I had a idea, I create this sh:

Code: Select all

#!/bin/sh
while [ 1 ]; do
    sh /etc/rc.local
    sleep 1
done
so I run "/etc/rc.local" every second, that is I mount every second the shared_folder... Now it work like I want, but this could to go in some error/bug/disservice/problem or other?

thanks
oscaroxy
Posts: 35
Joined: 24. Sep 2015, 22:43

Re: file in share folder don't update correctly in CentOS 7

Post by oscaroxy »

I don't think this is a solution, in fact after some minutes I have a list of mount more big ...

mount -l

Code: Select all

...
none on /var/www/workspace_oscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_XXX type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_softeoscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_computime type vboxsf (rw,nodev,relatime)
none on /var/www/vhosts type vboxsf (rw,nodev,relatime)
none on /repositories type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_oscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_XXX type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_softeoscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_computime type vboxsf (rw,nodev,relatime)
none on /var/www/vhosts type vboxsf (rw,nodev,relatime)
none on /repositories type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_oscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_XXX type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_softeoscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_computime type vboxsf (rw,nodev,relatime)
none on /var/www/vhosts type vboxsf (rw,nodev,relatime)
none on /repositories type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_oscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_XXX type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_softeoscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_computime type vboxsf (rw,nodev,relatime)
none on /var/www/vhosts type vboxsf (rw,nodev,relatime)
none on /repositories type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_oscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_XXX type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_softeoscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_computime type vboxsf (rw,nodev,relatime)
none on /var/www/vhosts type vboxsf (rw,nodev,relatime)
none on /repositories type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_oscar type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_XXX type vboxsf (rw,nodev,relatime)
none on /var/www/workspace_softeoscar type vboxsf (rw,nodev,relatime)
...
and this maybe slow my http request ...
I tried to replace sh with:

Code: Select all

#!/bin/sh
while [ 1 ]; do        
        umount /var/www/vhosts/ 
        
        mount -t vboxsf www /var/www/vhosts/ -o fmode=770,dmode=770,uid=webuser,gid=webuser
    sleep 1
done
but when the resources is busy (for instance when the file is used from apache, that is a client request) then the umount fails...
Post Reply