Page 1 of 2
file in share folder don't update correctly in CentOS 7
Posted: 5. Oct 2015, 17:59
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):
Re: file in share folder don't update correctly in CentOS 7
Posted: 5. Oct 2015, 18:31
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???
Re: file in share folder don't update correctly in CentOS 7
Posted: 5. Oct 2015, 19:04
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.
Re: file in share folder don't update correctly in CentOS 7
Posted: 5. Oct 2015, 22:42
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
Re: file in share folder don't update correctly in CentOS 7
Posted: 5. Oct 2015, 22:44
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.
Re: file in share folder don't update correctly in CentOS 7
Posted: 6. Oct 2015, 08:23
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
Re: file in share folder don't update correctly in CentOS 7
Posted: 6. Oct 2015, 08:53
by Martin
The only full featured way for a shared access to files is a "real" network share.
Re: file in share folder don't update correctly in CentOS 7
Posted: 6. Oct 2015, 11:31
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
Re: file in share folder don't update correctly in CentOS 7
Posted: 6. Oct 2015, 11:46
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.
Re: file in share folder don't update correctly in CentOS 7
Posted: 6. Oct 2015, 18:12
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
Re: file in share folder don't update correctly in CentOS 7
Posted: 26. Oct 2015, 16:55
by oscaroxy
so shared folder isn't usable for web server file?
Re: file in share folder don't update correctly in CentOS 7
Posted: 26. Oct 2015, 17:01
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.
Re: file in share folder don't update correctly in CentOS 7
Posted: 5. Nov 2015, 10:45
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
Re: file in share folder don't update correctly in CentOS 7
Posted: 5. Nov 2015, 11:21
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
Re: file in share folder don't update correctly in CentOS 7
Posted: 5. Nov 2015, 13:40
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...