I'm new to Magento, and to Docker for that matter...

Managed to get as far as executing the ./m2devbox-init.bat script which pulled the necessary files from the repo and did the installation but towards the end of the installation I got this error:

[SUCCESS]: Magento installation complete.

[SUCCESS]: Magento Admin URI: /admin

Executing shell command:

mysql -h db -u root -proot -e "CREATE DATABASE IF NOT EXISTS


Executing shell command:

cd /var/www/magento2 && php bin/magento deploy:mode:set developer

Enabled developer mode.

Executing shell command:

touch /home/magento2/state/enable_sync

touch: cannot touch '/home/magento2/state/enable_sync': Permission denied

If I was running Linux I would know my way around a little better but I'm a bit lost using Windows with Docker and Virtualbox.

Anyone can advise whereabouts I can find the location mentioned above to adjust the permission?

Also noticed that during installation, another terminal opens following the execution of the ./m2devbox-unison-sync.bat script and has the following error:

(./shared/webroot: No such file or directory)

or to its parent ./shared

(./shared: No such file or directory)

Try 'timeout --help' for more information.

Contacting server...

Fatal error: Cannot find canonical name of ./shared/webroot: unable to cd either to it

Not sure if the two issues above are in some way related.

Any help or direction appreciated. Have tried troubleshooting the issue without any success.

1 Answer 1


First of all, I'm also a beginner with Magento and Docker, but I think I've managed to make this devbox work.

My system: Windows 8.1 with Docker Toolbox

Let's start with the SECOND error:

Create a folder "shared/webroot" in the same folder where you have your "m2devbox-init.bat" file. In my case, I've set security permissions for "shared" and "webroot" folders by giving full control to group "Everyone", just to be sure.

Now, let's have a look at the FIRST error:

touch /home/magento2/state/enable_sync

touch: cannot touch '/home/magento2/state/enable_sync': Permission denied

How to fix: - find the id for your docker container that holds apache/php (run "docker ps", you should see 2 containers listed, one for the webserver and one for mysql)

  • ssh into the docker container that holds apache/php (run "docker exec -it bash")

  • change permissions for /home/magento2/state (run "chmod 0777 /home/magento2/state")

  • exit from your docker container ssh session

  • run again ./m2devbox-init.bat

  • at this point, your Magento application should work as expected

After all this, I still had some issues with Unison not being able to sync all the files between host and guest. For that to work, I had to increase the value of a filesystem parameter (called max_user_watches). In order to do that: - ssh into the apache docker container (same as above)

  • check the value stored in "/proc/sys/fs/inotify/max_user_watches" (the default is 8192, which seems to be to low for a Magento environment)

  • increase that value by running the following command:

    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

  • exit from your docker container ssh session

  • run (again) ./m2devbox-unison-sync.bat
  • at this point, Unison should correctly watch any file changes

Hope this helps!

  • I am also facing same issue, i tried to execute echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p but it says read-only file system May 8, 2017 at 14:15
  • @gulshanmaurya in order to fix that, mark that container as "priviledged" in docker-compose.yml services: web: container_name: magento2devbox_web_XXXXXX restart: always image: magento/magento2devbox-web:latest **privileged: true**
    – h_45h
    Jun 14, 2017 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.