magento2-vagrant-for-developers icon indicating copy to clipboard operation
magento2-vagrant-for-developers copied to clipboard

Running init_project.sh fails to sync vagrant folders

Open localhosted opened this issue 7 years ago • 12 comments

I'm using virtualbox 5.2.2 and vagrant 2.0.1and the setup fails with:


$ bash init_project.sh
[2018-05-30 23:13:52] Checking requirements [/f/E/Projects/magento2/vagrant-magento/scripts/host/check_requirements.sh]
[2018-05-30 23:13:57] Installing missing vagrant plugins [init_project.sh]
[2018-05-30 23:14:01] Generating random IP address, and host name to prevent collisions (if no custom values specified) [init_project.sh]
[2018-05-30 23:14:04] Installing Magento dependencies via Composer [init_project.sh]
[2018-05-30 23:14:08] Executing composer command [/f/E/Projects/magento2/vagrant-magento/scripts/host/composer.sh]
[2018-05-30 23:14:11] >  Checking requirements [/f/E/Projects/magento2/vagrant-magento/scripts/host/check_requirements.sh]
[2018-05-30 23:14:18] >  Installing composer [/f/E/Projects/magento2/vagrant-magento/scripts/host/composer.sh]
[2018-05-30 23:14:28] >  composer --ignore-platform-reqs --no-interaction install [/f/E/Projects/magento2/vagrant-magento/scripts/host/composer.sh]
[2018-05-30 23:14:32] Initializing vagrant box [init_project.sh]
[2018-05-30 23:15:35] Directory '/f/E/Projects/magento2/vagrant-magento/etc' was not mounted as expected by Vagrant.
        Please make sure that 'paliarush/magento2.ubuntu' Vagrant box was downloaded successfully (if not, this may help http://stackoverflow.com/questions/35519389/vagrant-cannot-find-box)
        And that Vagrant is able to mount VirtualBox shared folders on your environment (see https://www.vagrantup.com/docs/synced-folders/basic_usage.html ).
        Also remove any stale declarations from /etc/exports on the host. [/f/E/Projects/magento2/vagrant-magento/scripts/host/check_mounted_directories.sh]

localhosted avatar May 31 '18 13:05 localhosted

run bash with admin permission if you using window. Linux make sure you have mount folder contain script have full permissions

mrtuvn avatar May 31 '18 16:05 mrtuvn

Had to add this line to get_host_os.sh:

elif [[ "$(expr substr "${os_name}" 1 6)" == "MSYS_N" ]]; then
    echo "Windows"

localhosted avatar Jun 02 '18 22:06 localhosted

I tried both these approaches, unfortunately I was unsuccessful. I have Windows 10 x64 Vagrant 2.1.1 VirtualBox 5.2.12 When I access the site in the browser I get an apache folder browser thinger. Says "Index Of".

kevmul avatar Jun 07 '18 19:06 kevmul

Do not put the host sync folder in an encrypted home folder.

franckgarnier21 avatar Jun 08 '18 11:06 franckgarnier21

Try to disable firewall ;-) on Ubuntu:

sudo systemctl disable ufw && sudo systemctl stop ufw

I had this:

==> magento2.vg: Mounting NFS shared folders...
[2018-08-15 16:49:50] The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp 192.168.10.1:/home/tkhamlai/vagrant-magento/magento2ce /home/tkhamlai/vagrant-magento/magento2ce

Stdout from the command:



Stderr from the command:

mount.nfs: Connection timed out

Disabling the firewall solved the problem.

TomashKhamlai avatar Aug 15 '18 14:08 TomashKhamlai

Same error here on three very different windows machines.

It seems to be some issue with virtualbox itself, since the shared folders are simply not available on the guest machine.

edit

Well, the etc folder is present, but empty: image

Morgy93 avatar Sep 27 '18 08:09 Morgy93

Actually I just saw that this has already been mentioned here: #173 Gonna try those exact versions now and see..

Morgy93 avatar Sep 27 '18 08:09 Morgy93

Well, I used vb.gui=true and files are present now: image

But the same error persists. 🤔

Morgy93 avatar Sep 27 '18 08:09 Morgy93

Wait, this is totally plausible to me, since it checks for ${vagrant_dir}/etc/guest/mysql/my.cnf which is in fact missing for me here. Just need to find out why now..

Morgy93 avatar Sep 27 '18 08:09 Morgy93

Please kill me .. I figured it all out: Wrong git config I had CRLF which of course doesn't work on Linux.

From requirements:

git config --global core.autocrlf false
git config --global core.eol LF
git config --global diff.renamelimit 5000

Morgy93 avatar Sep 27 '18 09:09 Morgy93

In ubuntu 16.04 I've resolved this issue by restoring file permissions of the etc folder and by installing these nfs-common and nfs-kernel-server:

sudo apt-get install nfs-common nfs-kernel-server

ilgala avatar Oct 01 '18 10:10 ilgala

2019-02-05_10-01-13

-Mac OS Solution - 1.Open mac os settings on privacy 2.Open up the permission(Locker icon) 3.go to "Full Disk Acssess" 4.Add the command line program.(Iterms phpstorm CLI in my case). 5.press "OK" :)

@paliarush i really think its need to be at FAQ. Its takes me a lot of time to find the solution.

refaelgold avatar Feb 05 '19 08:02 refaelgold