"git clone" requires sudo in synced directory

16 views
Skip to first unread message

Jason Hsu

unread,
Aug 26, 2019, 5:36:12 PM8/26/19
to Vagrant
An issue that has been giving me fits for some time is that running "git clone" within the synced directory (accessible from the guest and host systems) results in a permission denied error.

Fortunately, specifying "rsync" as the type parameter in the Vagrantfile resolved this.  I suppose I have no grounds to complain giving that I found a solution, but what is it about the synced folder in the Vagrant environment that would require specifying rsync as the type parameter?

Dennis Chang

unread,
Aug 26, 2019, 5:43:13 PM8/26/19
to Vagrant
My guess is, the Vagrant VM, requires the user "vagrant" to own the files contained within the synced_folder.
When you startup your VM, and run your script to "git clone", vagrant is
trying to clone to a shared directory (which it doesn't have permission to write to).

Rsync suggests that files are rsynced to the folder (through vagrant) and the result is the files are owned by "vagrant".

Who owns the directory and files when you don't use "rsync"?

Reply all
Reply to author
Forward
0 new messages