Synced folder - maybe I'm not understanding how it works.

28 views
Skip to first unread message

French Fry

unread,
Jun 1, 2017, 11:29:12 AM6/1/17
to Vagrant
promise to make this the last question of the week ;)

I may not understand what sync folders will actually do for me .

Here is my vagrantfile line:

 config.vm.synced_folder "/www/", "/usr/rails_projects/DevcampPortfolio"

Now with that the share is created.  I can create a file on the host in the www directory and it will show up in DevcampPortfolio.  As well, I can create a file in DevcampPortfolio and it shows up in /www. However what I really want is access to what is inside of DevcampPortfolio, which is a Rails application with all regular files and folders that make up the app.  Right now, if I cd into the DevcampPortfolio folder (on the guest) I can no longer see the directories and files of my app.  If I remove the sync then I can see those files / folders again.  Also I see none of them in the /www folder.

What I want to use this for is the ability to edit the files in my host. Should I be able to and I'm thinking maybe it's a permissions issue though but I'm not sure.  Basically when I go into /www on the host I want to see my Rails app and have access to everything. 

Hopefully the question is clear.  Help appreciated.

French Fry

unread,
Jun 1, 2017, 7:42:34 PM6/1/17
to Vagrant

When it says first parameter should be relative to project path, are we speaking about the folder where the vagrantfile is stored? I think maybe that was my mistake.  The shares I made were going in host to C:/mysyncedfolder.  Or, it is a matter of permissions and/or owner and other particulars.  Until I figure this out I'm using the default share /vagrant.  

Alvaro Miranda Aguilera

unread,
Jun 2, 2017, 2:43:17 AM6/2/17
to vagra...@googlegroups.com
Hi

You can ask all the question you have, feel free to send more :D



www will be local where your Vagrantifle is, like included in the project.

If you want to share that other path then try

 config.vm.synced_folder "C:/mysyncedfolder", "/usr/rails_projects/DevcampPortfolio"


If you can do

vagrant halt
vagrant up

and share the log, that will confirm all is good. 

If you do changes to Vagrantifle, the way to apply them is to run:
vagrant reload

Also, share the output of

vagrant ssh -c 'df -Ph'
vagrant ssh -c 'mount'

To have a look on the guest side

Thanks!
Alvaro


On Fri, Jun 2, 2017 at 1:42 AM, French Fry <samb...@gmail.com> wrote:

When it says first parameter should be relative to project path, are we speaking about the folder where the vagrantfile is stored? I think maybe that was my mistake.  The shares I made were going in host to C:/mysyncedfolder.  Or, it is a matter of permissions and/or owner and other particulars.  Until I figure this out I'm using the default share /vagrant.  

--
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/098add1c-a995-4933-a846-680850ef0543%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

French Fry

unread,
Jun 2, 2017, 9:43:16 AM6/2/17
to Vagrant
I'm not following why /www/ would be in the same directory as Vagrantfile.  I find /somedir/ is always mapped to C:/. 
I tried again this line:

config.vm.synced_folder "C:/share/", "/var/log/", mount_options: ["dmode=777", "fmode=666"] 

I could be wrong but figured if it was a permissions issue the mount_options might help. Results turned out the same though.  In C:/share there is one empty sub folder '/'postgresql' , it's empty though.  With the sync in place, if I cd into /var/log all that is showing (ls -a, ls la) is the empty postgresql.  If I disable the sync, then the full /var/log is there.  I can create new files and folders, and they will be synced between c:/share and /var/log. 

I am curious why vagrant-vbguest shows up in the log.  I thought that was a separate plugin.  Anyway, thank you and here is all the output and logs:

https://gist.github.com/stuartambient/6ed5aff23f273047dfdfcdc2dabfac3f
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

French Fry

unread,
Jun 7, 2017, 5:50:20 PM6/7/17
to Vagrant
Alvaro,
Any chance you were able to look over the output and logs I posted ?

Thanks
Stuart

Reply all
Reply to author
Forward
0 new messages