CSS file on Vagrant VM is not refreshed

197 views
Skip to first unread message

James Newton

unread,
Sep 15, 2017, 8:03:20 AM9/15/17
to Vagrant
Hello Vagrant visionaries,

I have used Vagrant to create a virtual machine running Ubuntu 16.04 and nginx. As I described in this thread, I have set up synchronized folders in the Project folder to point at /etc/nginx/ and at /var/www/. I have set the virtual machine up with a static IP address, and created an example.com site on it.

When I change one of the HTML files in /var/www/example.com/html/, and reload that file in my browser, I see the changes immediately. However, when I update an external CSS file that the HTML page needs to load, I cannot see the changes until I run `vagrant reload`.

It is not enough to reload the nginx settings or to restart nginx: I must force the entire VM to reload. I have also checked that the problem is not due to the browser caching the CSS page. I have disabled caching, and when I load the same page using nginx running on the host machine, the CSS changes appear immediately.

Is this a known issue? Can you suggest a solution or a workaround?

Thanks in advance,

James

Alvaro Miranda Aguilera

unread,
Sep 15, 2017, 10:07:35 AM9/15/17
to vagra...@googlegroups.com
hello

The isse is on the shared folder from virtualbox. As its not a filesystem, is beaves pretty good for some use cases but not so good for others.

I can't tell whats the best workflow but for some people using rsync to sync from host to guest has been good, for others use nfs also works.

Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/4dc0e7d4-0a31-4624-a6a9-b617155ea082%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

James Newton

unread,
Sep 15, 2017, 10:33:46 AM9/15/17
to vagra...@googlegroups.com
On 15 September 2017 at 17:07, Alvaro Miranda Aguilera <kik...@gmail.com> wrote:
The issue is on the shared folder from virtualbox. As it's not a filesystem, it behaves pretty good for some use cases but not so good for others.

I can't tell what's the best workflow but for some people using rsync to sync from host to guest has been good, for others use nfs also works.

Hi Alvaro,

I appreciate your follow up.

Would you have more specific details on how rsync and nfs should be used in this case? Is this run from the command line, or as part of a script that detects changes to any file in a given folder?

Thanks for your dedication :)

James

Alvaro Miranda Aguilera

unread,
Sep 15, 2017, 2:57:26 PM9/15/17
to vagra...@googlegroups.com
Hello!

So first suggestion would be have a look at this at time permits:

Then lets reuse something other people have wrote about this very same problem:

Or:

That should give a wide idea on why one is faster/better/stronger (technologic)

From there, implement one or the other, will depend on your host OS and guest OS

Can you share what are you using today? 

Whats your host OS ?
Whats your guest VM OS ?

Thanks!
Alvaro
--

This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAGNcf%2BGFv4rWXorq1EJAwBzdG%2BH67j2xgpzycwqkPiWjPWJ83g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages