Vagrant Box for Magento 2 Developers

Overview

Vagrant project for Magento 2 developers (optimized for Mac, Windows and *nix hosts)

⚠️ Current project is not supported anymore. Please check out https://github.com/magento/magento2-kubernetes-devbox which is under development and may become an official devbox for Magento 2 in the future.

Tests passing on OSX MIT License Semver Latest GitHub release

What You get

It's expected that the Magento 2 project source code will be located and managed on the host to allow quick indexing of project files by IDE. All other infrastructure is deployed on the guest machine.

Current Vagrant configuration aims to solve performance issues of Magento installed on Virtual Box for development. A custom solution is implemented for Windows hosts. See explanation of the proposed solution.

The environment for Magento EE development is also configured.

It is easy to install multiple Magento instances based on different codebases simultaneously.

The project initialization script configures a complete development environment:

  1. Adds some missing software on the host
  2. Configures all software necessary for Magento 2 using a custom Ubuntu vagrant box (Apache 2.4, PHP 7.0 or 5.6, MySQL 5.6, Git, Composer, XDebug, Rabbit MQ, Varnish)
  3. Installs Magento 2 from Git repositories or Composer packages (can be configured via checkout_source_from option in etc/config.yaml)
  4. Configures PHP Storm project (partially at the moment)
  5. Installs NodeJS, NPM, Grunt and Gulp for front end development

ℹ️ This box uses the n package manager to provide the latest NodeJS LTS version.

How to install

If you never used Vagrant before, read the Vagrant Docs first.

Requirements

The software listed below should be available in PATH (except for PHP Storm).

  • Vagrant 1.8+

  • VirtualBox

  • Git - Ensure that SSH keys are generated and associated with your Github account. See how to check and how to configure, if not configured.
    ℹ️ To obtain the codebase without cloning, just use the Magento 2 codebase instead of vagrant-magento/magento2ce. Either method will produce a successful installation.

    ℹ️ On Windows hosts Git must be v2.7+. Also make sure to set the following options to avoid issues with incorrect line separators:

    git config --global core.autocrlf false
    git config --global core.eol LF
    git config --global diff.renamelimit 5000
    
  • PHP (any version) to allow Magento dependency management with Composer

  • PHP Storm, optional but recommended

  • NFS server must be installed and running on *nix and OSX hosts; usually available, follow installation steps first

Installation steps

ℹ️ In case of any issues during installation, please read FAQ section

  1. Open terminal and change your directory to the one you want to contain Magento project. On Windows use Git Bash, which is available after Git installation.

  2. Download or clone the project with Vagrant configuration:

    ⚠️ Do not open it in PhpStorm until init_project.sh has completed PhpStorm configuration in the initialize project step below.

    git clone [email protected]:paliarush/magento2-vagrant-for-developers.git vagrant-magento
    

    Optionally, if you use private repositories on GitHub or download packages from the Magento Marketplace using Composer

    1. Copy etc/composer/auth.json.dist to etc/composer/auth.json.
    2. Specify your GitHub token by adding "github.com": "your-github-token" to the github-oauth section for GitHub authorization.
    3. Add the Magento Marketplace keys for Marketplace authorization to the repo.magento.com section.
    4. Copy (optional) etc/config.yaml.dist as etc/config.yaml and make the necessary customizations.
  3. Initialize the project (this will configure the environment, install Magento, and configure the PHPStorm project):

    cd vagrant-magento
    bash init_project.sh
    
  4. Use the vagrant-magento directory as the project root in PHP Storm (not vagrant-magento/magento2ce). This is important, because in this case PHP Storm will be configured automatically by init_project.sh. If NFS files sync is disabled in config and on Windows hosts verify the deployment configuration in PHP Storm.

    Use the URL for accessing your Magento storefront in the browser as your Web server root URL. Typically this is the localhost, which refers to your development machine. Depending on how you've set up your VM you may also need a port number, like http://localhost:8080.

  5. Configure the remote PHP interpreter in PHP Storm. Go to Preferences, then Languages and Frameworks. Click PHP and add a new remote interpreter. Select Deployment configuration as a source for connection details.

Default credentials and settings

Some of default settings are available for override. These settings can be found in the file etc/config.yaml.dist.

To override settings create a copy of the file under the name 'config.yaml' and add your custom settings.

When using init_project.sh, if not specified manually, random IP address is generated and is used as suffix for host name to prevent collisions, in case when two or more instances are running at the same time.

Upon a successful installation, you'll see the location and URL of the newly-installed Magento 2 application in console.

Web access:

  • Access storefront at http://magento2.vagrant
  • Access admin panel at http://magento2.vagrant /admin/
  • Magento admin user/password: admin/123123q
  • Rabbit MQ control panel: http://magento2.vagrant :15672 , credentials guest/guest

ℹ️ Your admin URL, storefront URL, and admin user and password are located in etc/config.yaml.dist.

Codebase and DB access:

  • Path to your Magento installation on the VM:
    • Can be retrieved from environment variable: echo ${MAGENTO_ROOT}
    • On Windows hosts: /var/www/magento2ce
    • On Mac and *nix hosts: the same as on host
  • MySQL DB host: localhost (not accessible remotely)
  • MySQL DB name: magento, magento_integration_tests
  • MySQL DB user/password: root: . In CLI just use mysql with no user and password (root: will be used by default)

Codebase on host

  • CE codebase: vagrant_project_root/magento2ce
  • EE codebase will be available if path to EE repository is specified in etc/config.yaml: vagrant_project_root/magento2ce/magento2ee

Getting updates and fixes

Current vagrant project follows semantic versioning so feel free to pull the latest features and fixes, they will not break your project. For example your current branch is 2.0, then it will be safe to pull any changes from origin/2.0. However branch 3.0 will contain changes backward incompatible with 2.0. Note, that semantic versioning is only used for x.0 branches (not for develop).

ℹ️ To apply changes run vagrant reload.

Day-to-day development scenarios

Reinstall Magento

Use commands described in Switch between CE and EE section with -f flag. Before doing actual re-installation, these commands update linking of EE codebase, clear cache, update composer dependencies.

If no composer update and relinking of EE codebase is necessary, use the following command. It will clear Magento DB, Magento caches and reinstall Magento instance.

Go to the root of vagrant project in command line and execute:

bash m-reinstall

Clear Magento cache

Go to the root of vagrant project in command line and execute:

bash m-clear-cache

Switch between CE and EE

Assume, that EE codebase is available in vagrant_project_root/magento2ce/magento2ee. The following commands will link/unlink EE codebase, clear cache, update composer dependencies and reinstall Magento. Go to 'vagrant-magento' created earlier and run in command line:

bash m-switch-to-ce
OR
bash m-switch-to-ee

Force switch can be done using -f flag even if already switched to the target edition. May be helpful to relink EE modules after switching between branches.

Upgrade can be performed instead of re-installation using -u flag.

ℹ️ On Windows hosts (or when NFS mode is disabled in config.yaml explicitly) you will be asked to wait until code is uploaded to guest machine by PhpStorm (PhpStorm must be launched). To continue the process press any key.

Sample data installation

Make sure that ce_sample_data and ee_sample_data are defined in config.yaml and point CE and optionally EE sample data repositories. During initial project setup or during bash init_project.sh -fc (with -fc project will be re-created from scratch), sample data repositories willl be checked out to vagrant_project_root/magento2ce/magento2ce-sample-data and vagrant_project_root/magento2ce/magento2ee-sample-data.

To install Magento with sample data set install_sample_data in config.yaml to 1 and run bash m-switch-to-ce -f or bash m-switch-to-ee -f, depending on the edition to be installed. To disable sample data, set this option to 0 and force-switch to necessary edition (using the same commands).

Basic data generation

Several entities are generated for testing purposes by default using REST API after Magento installation:

  • Customer with address (credentials [email protected]:123123qQ)
  • Category
  • Couple simple products
  • Configurable product

To disable this feature, set magento/generate_basic_data in config.yaml to 0 and run bash m-switch-to-ce -f or bash m-switch-to-ee -f, depending on the edition to be installed.

Use Magento CLI (bin/magento)

Go to 'vagrant-magento' created earlier and run in command line:

bash m-bin-magento 
   
    
e.g.
bash m-bin-magento list

   

Debugging with XDebug

XDebug is already configured to connect to the host machine automatically. So just:

  1. Set XDEBUG_SESSION=1 cookie (e.g. using 'easy Xdebug' extension for Firefox). See XDebug documentation for more details
  2. Start listening for PHP Debug connections in PhpStorm on default 9000 port. See how to integrate XDebug with PhpStorm
  3. Set beakpoint or set option in PhpStorm menu 'Run -> Break at first line in PHP scripts'

To debug a CLI script:

  1. Create remote debug configuration in PhpStorm, use phpstorm as IDE key
  2. Run created remote debug configuration
  3. Run CLI command on the guest as follows (xdebug.remote_host value might be different for you):
php -d xdebug.remote_autostart=1 
   

   

To debug Magento Setup script, go to Magento installation script and find php ${install_cmd}. Follow steps above for any CLI script

ℹ️ In addition to XDebug support, config.yaml has several options in debug section which allow storefront and admin UI debugging. Plus, desired Magento mode (developer/production/default) can be enabled using magento_mode option, default is developer mode.

Connecting to MySQL DB

Answer can be found here

View emails sent by Magento

All emails are saved to 'vagrant-magento/log/email' in HTML format.

Accessing PHP and other config files

It is possible to view/modify majority of guest machine config files directly from IDE on the host. They will be accessible in etc/guest directory only when guest machine is running. The list of accessible configs includes: PHP, Apache, Mysql, Varnish, RabbitMQ. Do not edit any symlinks using PhpStorm because it may break your installation.

After editing configs in IDE it is still required to restart related services manually.

Upgrading Magento

Sometimes it is necessary to test upgrade flow. This can be easily done as follows (assuming that you have installed instance):

  • For git-based installation - check out codebase corresponding to the target Magento version. Or modify your composer.json in case of composer-based installation
  • Use commands described in Switch between CE and EE section with -u flag

Multiple Magento instances

To install several Magento instances based on different code bases, just follow Installation steps to initialize project in another directory on the host. Unique IP address, SSH port and domain name will be generated for each new instance if not specified manually in etc/config.yaml

Update Composer dependencies

Go to 'vagrant-magento' created earlier and run in command line:

bash m-composer install
OR
bash m-composer update

Running Magento tests

See draft

Environment configuration

Switch between PHP versions

Switch between PHP versions using "php_version: " option in config.yaml. Supported versions are 5.6, 7.0, 7.1 and 7.2. PHP version will be applied after "vagrant reload".

Activating Varnish

Set use_varnish: 1 to use varnish along with apache in config.yaml. Changes will be applied on m-reinstall. It will use default file etc/magento2_default_varnish.vcl.dist generated from a Magento 2.1 instance. Magento 2.2+ supports additional Varnish features and you may need to provide custom version of VCL to enable them. Varnish Version: 4.1

Use the following commands to enable/disable varnish without reinstalling Magento: m-varnish disable or m-varnish enable.

Activating ElasticSearch

ℹ️ Available in Magento EE only.

Set search_engine: "elasticsearch" in config.yaml to use ElasticSearch as current search engine or search_engine: "mysql" to use MySQL. Changes will be applied on m-reinstall.

Use the following commands to switch between search engines without reinstalling Magento: m-search-engine elasticsearch or m-search-engine mysql.

Redis for caching

ℹ️ Available in Magento v2.0.6 and higher.

Redis is configured as cache backend by default. It is still possible to switch back to filesystem cache by changing environment_cache_backend to filesystem in config.yaml.

Reset environment

It is possible to reset project environment to default state, which you usually get just after project initialization. The following command will delete vagrant box and vagrant project settings. After that it will initialize project from scratch. Magento 2 code base (magento2ce directory) and etc/config.yaml and PhpStorm settings will stay untouched, but guest config files (located in etc/guest) will be cleared.

Go to 'vagrant-magento' created earlier and run in command line:

bash init_project.sh -f

It is possible to reset Magento 2 code base at the same time. Magento 2 code base will be deleted and then cloned from the repositories specified in etc/config.yaml

bash init_project.sh -fc

To reset PhpStorm project configuration, in addition to -f specify -p option:

bash init_project.sh -fp

Ultimate project reset can be achieved by combining all available flags:

bash init_project.sh -fcp

Switch NodeJS Versions

By default, the box will install the latest NodeJS LTS version using the n package manager. If you need another version of Node because of Magento's package.json requirements, simply run:

n <version>

Note: See Working with npm if after switching versions with n, npm is not working properly.

FAQ

  1. To debug any CLI script in current Vagrant project, set debug:vagrant_project option in config.yaml to 1

  2. Is Windows 10 supported? Yes, but you may face the same issue as described here or here. Also Virtual box may not work on Windows 10 in headless mode, see how to enable GUI mode

  3. On OSX and *nix hosts NFS will be used by default to sync your project files with guest. On some hosts Vagrant cannot configure NFS properly, in this case it is possible to deploy project without NFS by setting use_nfs option in config.yaml to 0

  4. On Windows hosts you might face Composer Install Error: ZipArchive::extractTo(): Full extraction path exceed MAXPATHLEN (260) exception during composer install. This can be fixed in 2 ways: decrease path length to the project directory or set composer_prefer_source option in config.yaml to 1

  5. Make sure that you used vagrant-magento directory as project root in PHP Storm (not vagrant-magento/magento2ce)

  6. If project opened in PhpStorm looks broken, close PhpStorm and remove vagrant-magento/.idea. Run bash vagrant-magento/scripts/host/configure_php_storm.sh. After opening project in PhpStorm again everything should look good

  7. If code is not synchronized properly on Windows hosts (or when NFS mode is disabled in config.yaml explicitly), make sure that PhpStorm is running before making any changes in the code. This is important because otherwise PhpStorm will not be able to detect changes and upload them to the guest machine

  8. Please make sure that currently installed software, specified in requirements section, meets minimum version requirement

  9. Be careful if your OS is case-insensitive, NFS might break the symlinks if you cd into the wrong casing and you power the vagrant up. Just be sure to cd in to the casing the directory was originally created as.

  10. Cannot run unit tests from PHPStorm on Magento 2.2, see possible solution here

  11. Permission denied (publickey)

  12. If during a vagrant reload, the following message appears:

    There was a problem while downloading the metadata for your box to check for updates. This is not an error, since it is usually due to temporary network problems. This is just a warning. The problem encountered was: The requested URL returned error: 404 Not Found

    It is likely that your vagrant cli is caching an old url. Perform the following cli commands:

    sed -i -- 's/atlas.hashicorp/vagrantcloud/g' ~/.vagrant.d/boxes/{name of your paliarush/ubuntu image}/metadata_url
    mv ~/.vagrant.d/boxes/{name of your paliarush/ubuntu image}/metadata_url2 ~/.vagrant.d/boxes/{name of your paliarush/ubuntu image}/metadata_url
Comments
  • Installation failure

    Installation failure

    How to fix this issue ?

    MacBook-Pro-de-Max:vagrant-magento max$ bash init_project.sh [2017-10-19 18:07:33] Checking requirements [/Users/max/magento/vagrant-magento/scripts/host/check_requirements.sh] [2017-10-19 18:07:33] Installing missing vagrant plugins [init_project.sh] [2017-10-19 18:07:34] Generating random IP address, and host name to prevent collisions (if no custom values specified) [init_project.sh] [2017-10-19 18:07:34] Installing Magento dependencies via Composer [init_project.sh] [2017-10-19 18:07:34] Executing composer command [/Users/max/magento/vagrant-magento/scripts/host/composer.sh] [2017-10-19 18:07:34] > Checking requirements [/Users/max/magento/vagrant-magento/scripts/host/check_requirements.sh] [2017-10-19 18:07:34] > composer --ignore-platform-reqs --no-interaction install [/Users/max/magento/vagrant-magento/scripts/host/composer.sh] [2017-10-19 18:07:35] Initializing vagrant box [init_project.sh] [2017-10-19 18:07:36] Directory '/Users/max/magento/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 ) [/Users/max/magento/vagrant-magento/scripts/host/check_mounted_directories.sh] MacBook-Pro-de-Max:vagrant-magento max$

    I'm using Vagrant 2.0.0 and VirtualBox 5.2.0 on Mac OS X Sierra.

    question answered 
    opened by gilles6 14
  • Survey: How do you use this project?

    Survey: How do you use this project?

    Hi guys,

    I am Magento core developer and may not know all the issues you may face as a community developer. To improve current project, I am trying to collect more information about the use cases community developers have in their daily work.

    I would appreciate If you could share your typical project structure and how you use this vagrant project.

    Maybe there are some missing features, which could make your life easier.

    Thanks Alex

    help wanted question 
    opened by paliarush 14
  • Cant find 'guest' file(s)

    Cant find 'guest' file(s)

    When I use the bash init_proces.sh, the command line returns a error which results in a invalid Vagrant installation process.

    bash: /vagrant/scripts/guest/m-clear-cache: No such file or directory This error comes up after 'Unlinking CE sample data'

    Two weeks ago, it all worked perfectly on my local machine.

    enhancement 
    opened by wpoortman 13
  • Problems with deep_merge

    Problems with deep_merge

    1. Clone repository :

    git clone https://github.com/paliarush/magento2-vagrant-for-developers.git magento2-test

    1. Initializing :

    cd magento2-test bash init_project.sh

    1. I get an error :

    Message: NoMethodError: undefined method `deep_merge!' for #Hash:0x00000001504b68

    I read somewhere deep_merge would be a vagrant plugin, but just a vagrant plugin install deep_merge return the same error.

    help wanted maybe later env-specific bug 
    opened by nicolaspernot 12
  • Sample data for CE

    Sample data for CE

    Hi,

    is it me, or is sample data not working currently? The default config.yaml file seems to have filled out defaults for the CE edition with sample data (only thing NOT set is the "install_sample_data" option).

    Regardless of the "install_sample_data" option, the sample data isn't installed. If I attempt to deploy it manually using "bash m-bin-magento sample:deploy" (which seems it shouldn't be needed, but regardless) it fails with the following:

    $ bash m-bin-magento sample:deploy
    + arguments=sample:deploy
    + cd /d/magento/vagrant-magento
    + vagrant ssh -c '$MAGENTO_ROOT/bin/magento sample:deploy'
    <warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>
    ./composer.json has been updated
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - The requested package magento/module-sales-rule-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 2
        - The requested package magento/module-cms-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 3
        - The requested package magento/module-bundle-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 4
        - The requested package magento/module-grouped-product-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 5
        - The requested package magento/module-swatches-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 6
        - The requested package magento/module-wishlist-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 7
        - The requested package magento/module-downloadable-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 8
        - The requested package magento/module-tax-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 9
        - The requested package magento/module-catalog-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 10
        - The requested package magento/module-review-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 11
        - The requested package magento/module-offline-shipping-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 12
        - The requested package magento/module-sales-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 13
        - The requested package magento/module-widget-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 14
        - The requested package magento/module-msrp-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 15
        - The requested package magento/module-theme-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 16
        - The requested package magento/module-configurable-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 17
        - The requested package magento/module-product-links-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 18
        - The requested package magento/sample-data-media could not be found in any version, there may be a typo in the package name.
      Problem 19
        - The requested package magento/module-customer-sample-data could not be found in any version, there may be a typo in the package name.
      Problem 20
        - The requested package magento/module-catalog-rule-sample-data could not be found in any version, there may be a typo in the package name.
    
    Potential causes:
     - A typo in the package name
     - The package is not available in a stable-enough version according to your minimum-stability setting
       see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
    
    Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
    
    Installation failed, reverting ./composer.json to its original content.
    There is an error during sample data deployment. Composer file will be reverted.
    

    I'm assuuming this is caused by some disparity between the used Magento2 and sample data GIT, but I'm unsure how to resolve it.

    opened by Szaamaan 10
  • Option to specify default branches for repositories in config.yaml

    Option to specify default branches for repositories in config.yaml

    Hi,

    I've noticed that the default Magento 2 CE installation is version 2.2-dev as that seems to be the default branch used by the Magento 2 CE git repo. Is there a flag / switch in config.yaml to use version 2.1 during the project initialisation process?

    enhancement 
    opened by jasonheecs 8
  • Cannot switch to EE using bash m-switch-to-ee

    Cannot switch to EE using bash m-switch-to-ee

    I'm downloading EE from a private repo. Here's what the repo section of my config.yaml looks like.

    repository_url:
      # [To apply changes: init-project -fc]
      ce: "https://github.com/magento/magento2.git "
      ee: "https://github.com/LCind/magento2ee.git"
    

    From my host machine, executing bash m-switch-to-ee returns the following:

    C:\Projects\vagrant-magento>bash m-switch-to-ee
    + [[ -f /c/Projects/vagrant-magento/lib/php/php.exe ]]
    + php_executable=php
    + echo php
    + [[ ! -f /c/Projects/vagrant-magento/magento2ce/magento2ee/app/etc/aliases_to_classes_map.json ]]
    + set +x
    EE codebase is not available
    
    question answered 
    opened by LCIJJ 6
  • Only see app and etc directory

    Only see app and etc directory

    I'm on windows 10 and get all the way through the installation, but when I launch in browser I just see the app directory and in that only the etc directory. Any idea what I could be doing wrong?

    question 
    opened by willboudle 6
  • Launch Vagrant on the Windows 10

    Launch Vagrant on the Windows 10

    Sorry that not post the issue, maybe to someone will be helpful. I tried to launch this Vagrant on the Windows 10 during 3 - 5 days, Faced with such issues:

    1. the first was with Vagrant, the current versions of Vagrant 2.0.2 don't work properly on Windows 10. the issue https://github.com/hashicorp/vagrant/issues/9516, doesn't relate to the current Vagrant container, but it was. And maybe it was the reason why i tried the versions 1.x. After that, i decided to try another version of Vagrant, like 1.9.x and 1.8.x all these versions lead me to the issue number 2

    2. The second was with mounting my.cnf, it was solved by setup "correct" version of Vagrant (2.0.1) and Vbox (5.2.6), but was issue number 3

    Initializing vagrant box [init_project.sh] [2018-02-28 22:24:31] Directory '/n/magento/vm22/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 ) [/n/magento/vm22/vagrant-magento/scripts/host/check_mounted_directories.sh]

    1. On this step, i faced with issue below, the Vagrant container with Ubuntu didn't contain Magento codebase, was only created directory var, generated app/etc

    [2018-02-28 20:35:43] Checking if all required directories were mounted successfully [/vagrant/scripts/guest/check_mounted_directories] [2018-02-28 20:35:43] > Directory '/var/www/magento2ce' was not mounted as expected and Magento code base is not accessible on the guest machine. If your host is OSX or *nix, please make sure that Vagrant is able to mount NFS shares on your environment (see https://github.com/paliarush/magento2-vagrant-for-developers/issues/88#issuecomment-254854019 ) [/vagrant/scripts/guest/check_mounted_directories]

    the solution for this was updated the directive to such

            guest_magento_dir = '/var/www/magento2ce'
            config.vm.synced_folder host_magento_dir, guest_magento_dir
            config.vm.synced_folder host_magento_dir + '/var', guest_magento_dir + '/var', create: true
            config.vm.synced_folder host_magento_dir + '/generated', guest_magento_dir + '/generated', create: true
            config.vm.synced_folder host_magento_dir + '/app/etc', guest_magento_dir + '/app/etc', create: true
    

    so i added synchronization with Magento codebase from a host machine to the guest, maybe not the best solution, but at the current moment, this works for me.

    config.vm.synced_folder host_magento_dir, guest_magento_dir
    

    at the current moment Magento works, i didn't test it well, so can't say what kind of issues can popup with Magento and Vagrant.

    question answered windows 
    opened by MaxMage 5
  • Node Version and Provisioning

    Node Version and Provisioning

    I just created a new project with this box and installed Magento 2.2. I'm trying to set up Grunt and I get errors like the following:

    npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
    npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
    npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
    npm WARN engine [email protected]: wanted: {"node":">=4.0.0"} (current: {"node":"v0.10.25","npm":"1.3.10"})
    npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"v0.10.25","npm":"1.3.10"})
    

    I can't find where Node is provisioned on this box and the version from a fresh install is v0.10.25. The current stable version of Node is 8.9.1. Is Node provisioned or was it installed on the base box and that's why it's out of date?

    upgrade required 
    opened by nfourteen 5
  • Install fails with composer option

    Install fails with composer option

    Hi there, Been trying for days to get this working. I initially installed via git clone, and it all worked just dandy. When I choose Composer however, the installation just hangs. I've tried manually installing via the CLI after aborting the init_project script, and the installation hangs at

    [Progress: 212 / 426]
    Installing user configuration...
    

    But I can't seem to get any further. I've tried disabling Xdebug completely and it still seems to be the same.

    I can't figure out what's causing it to stall - especially since Git install seems to go through smoothly.

    Host OS is Ubuntu 16.04.

    Thanks in advance for any help.

    question 
    opened by WillPS1989 5
  • Deleting Magento Test Module only if

    Deleting Magento Test Module only if "checkout_source_from: git"

    Hello, I'm not entirely sure but I think that Deleting TestModule directories in m_reinstall.sh should only be done in case of git as checkout source In case of checkout_source_from: "composer" for example the magento2ce/app/code/Magento directory doesn't exist, because it's found in vendor directory. In this case I'm not sure it's useful to delete the TestModule directory anyway (?) Thanks

    magento_app_code_dir="${vagrant_dir}/magento2ce/app/code/Magento"
    
    mkdir -p "$magento_app_code_dir"
    
    cd "${magento_app_code_dir}"
    
    status "Deleting TestModule directories"
    ls | grep "TestModule" | xargs rm -rf
    
    opened by medmek 0
  • [Windows] Unzip not installed by default in gitbash

    [Windows] Unzip not installed by default in gitbash

    For Windows user unzip is not installed by default in gitbash and is an implicite requirement in the project.

    Please make it more explicite to Check optional unix tools during gitbash setup (like advised in this Stackoverflow answer )

    Thank you so much

    opened by medmek 0
  • Host PHP version php-5.6.9 -> newer and adding VC_redist.x64.exe as requirement

    Host PHP version php-5.6.9 -> newer and adding VC_redist.x64.exe as requirement

    When I execute manually : curl http://windows.php.net/downloads/releases/archives/php-5.6.9-nts-Win32-VC11-x86.zip -o lib/php.zip it creates a small file (1kb)

      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   207  100   207    0     0   1510      0 --:--:-- --:--:-- --:--:--  1522
    

    a file that is clearly not the whole php5.6 zip (trying to unzip it manually tells me that it's not a zip file)

    So I had to curl manually another version of PHP : curl https://windows.php.net/downloads/releases/php-7.4.16-nts-Win32-vc15-x64.zip -o lib/php.zip

    I also had to install VC_redist.x64.exe like advised in this stackoverflow answer otherwise I get this :

    php --version
    PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
    

    So it might be a good idea to add VC_redist.x64.exe it to the requirement and update the PHP version to download. (Or maybe to make a list of versions (list of urls) to try before renouncing the Automatic PHP host installation)

    Thank you

    opened by medmek 1
  • git bash, windows 10, read-only file system error

    git bash, windows 10, read-only file system error

    When attempting to run the init shell script in git bash it immediately returns the following error. /c/www/vagrant-magento/scripts/output_functions.sh: line 184: /dev/fd/62: Read-only file system

    I can't find any other info on the error and it doesn't look like an issue has been raised for a similar issue before.

    Thanks.

    opened by pooley182 1
  • Unable to install

    Unable to install

    Running bash init_project.sh fails. I see this message in the log:

    [2019-06-10 20:05:18] STATUS: > ./bin/magento setup:install --db-host=localhost --db-name=magento --db-user=root --backend-frontname=admin --base-url=http://magento2.vagrant148/ --language=en_US --timezone=America/Chicago --currency=USD --admin-lastname=Admin --admin-firstname=Admin [email protected] --admin-user=admin --admin-password=123123q --cleanup-database --use-rewrites=1 --amqp-host=localhost --amqp-port=5672 --amqp-user=guest --amqp-virtualhost=/ --amqp-password=guest [/vagrant/scripts/guest/m-reinstall]]

    Magento supports PHP 7.1.3 or later. Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

    [2019-06-10 20:05:18] ERROR: > Magento installation failed. [/vagrant/scripts/guest/m-reinstall]]

    When I vagrant ssh and then php --version, I see this version:

    PHP 7.0.7-4+deb.sury.org~trusty+1

    When I tried to update my config.yaml to php_version: "7.2" and vagrant reload I see two messages regarding PHP:

    update-alternatives: error: alternative /usr/bin/php7.2 for php not registered; not setting ERROR: Module php7.1 does not exist! [Unknown source file] ERROR: Module php7.2 does not exist! [Unknown source file]

    And when I ssh into the box and look at the contents of /usr/bin/:

    Screen Shot 2019-06-10 at 3 29 53 PM

    opened by thoughtassassin 2
Releases(v2.2.0)
  • v2.2.0(Feb 25, 2017)

    Changed

    • Magento EE and sample data directories are added to 'Exclude list' in PhpStorm
    • Redis is used as default cache backend instead of filesystem
    • After EE is linked, EE versions of composer.lock and composer.json are replaced back with CE versions (thus are not marked by git as modified)
    • Improved CLI scripts output formatting

    Fixed

    • Issue with some files marked as unversioned in git after EE linking
    • It is now possible to use spaces in path to vagrant project on Windows. On OSX and Linux hosts it works in non-NFS mode, in NFS mode it does not work because of bug in vagrant
    • Issue with MySQL being down after VM power off

    Added

    • Added ability to configure number of CPUs for virtual machine via etc/config.yaml
    • Added generation of basic sample data for testing purposes
    • Ability to upgrade Magento using m-switch-to-ce and m-switch-to-ee (when -u flag is specified)
    • Redis support for Magento caching
    • Access to Magento developer mode and storefront/admin UI debugging features via etc/config.yaml
    • Composer-based installation support
    • Magento cache warming up after re-install and clearing cache (when -w flag is specified)
    • Tests configuration files are generated during project initialization
    • Sample data support
    • ElasticSearch support
    • NodeJS, NPM, Gulp and Grunt are installed as part of the provisioning process
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Jun 22, 2016)

    Changed

    • Removed requirement for public github token due to Composer limitations (issue is fixed on Composer side)
    • Changed requirement for minimum box version from 1.0 to 1.1
    • Upgraded PHP 5.5.9 to PHP 5.6
    • When init_project.sh is executed, EE will be installed by default, if EE repository is specified in etc/config.yaml.dist. Not supported on Windows hosts

    Fixed

    • Fixed permissions during Magento installation on Windows hosts
    • Fixed issue with Magento compiler on Windows hosts
    • Fixed "stdin: is not a tty" warning

    Added

    • Added setup and upgrade cron scripts to crontab
    • Added logging of all emails in HTML format to vagrant-magento/log/email
    • Added host wrapper script for bin/magento command on guest
    • Added ability to modify guest config files (PHP, Apache etc) directly from host IDE
    • Added ability to choose if PhpStorm configs should be removed during project reinitialization
    • Added ability to switch PHP version without destroying the project ("vagrant reload" is required)
    • Added ability to do force switch to CE or EE (even if already switched to target edition)
    • Added ability to use Varnish full page caching automatically. (Using "vagrant reload" or m-varnish script)
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Feb 5, 2016)

    Changed

    • Moved provisioning scripts
    • Magento project directory moved to vagrant project root. Current structure is as follows: vagrant-magento/magento2ce/magento2ee
    • PHP 7.0 is installed by default instead of PHP 5.5.9 (can be configured in etc/config.yaml.dist)
    • Renamed configuration folder from local.config to etc
    • Set minimum Vagrant version as 1.8
    • Improved deployment speed in case of disabled NFS for folders sync
    • Used custom Vagrant box with pre-installed software necessary for Magento 2 development
    • Eliminated explicit dependency on PHP for Windows hosts (it can be downloaded and used locally for the project)
    • XSD URN generation is executed after Magento installation

    Added

    • Added project initialization script and host scripts for routine flows (compatible with OSX, *nix and Windows)
    • Implemented static value of forwarded SSH port to prevent necessity to reconfigure software accessing guest via SSH
    • Implemented collision prevention for IP address and host name (in case when several machines are created at once)
    • Added configuration file etc/config.yaml.dist
    • Added PHP 7.0 support
    • Added PHP Storm configuration during project initialization (particularly automatic deployment settings)
    • Added automatic vagrant plugins installation
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Jan 11, 2016)

    With current configuration Vagrant will:

    1. Run Ubuntu 14.04 box (Apache 2.4, PHP 5.5.9, XDebug, MySQL 5.6, Rabbit MQ)
    2. Install and configure all software necessary for Magento 2
    3. Install the Magento 2 application
    Source code(tar.gz)
    Source code(zip)
Owner
Alex Paliarush
twitter: @paliarush
Alex Paliarush
MageVagrant - Vagrant/Chef base box for running Magento

MageVagrant MageVagrant is a complete LAMP development environment for Magento. Specially created for the Magento Developer's Guide book. Features Aut

null 59 Sep 28, 2021
Provides a foundation for developing with Magento Commerce in a Vagrant box

Provides a foundation for developing with Magento Commerce in a Vagrant box. The machine is based on CentOS 6.4. ==== List of installed software. Mage

Jason Evans 19 May 12, 2017
Simple Magento 2 Vagrant Box

Magento2 Vagrant Box A simple way to get magento2 up and running. It consists of a Debian Wheezy box provised via Puppet. The provider is Virtual Box.

beeplogic 253 Sep 30, 2022
This a php environment for developers. based on Vagrant & CentOS & laravel/homestead

Centstead 这是一个 PHP 调试环境 , 基于 centos,laravel/homestead. 介绍   基于开发的实际需求,PHP开发者通常需要一个贴近生产环境,又易于维护的测试与开发环境.以往的选择: xampp, wamp, phpstudy… 集成环境,启动方便,占用小,但是需

JasonChang 52 Sep 30, 2022
Hi Im L, I found a box that I believe it's contain Kira's real ID. for open that box we need to find three keys. let's start looking for them

DeathNote ctf Description are you smart enaugh to help me capturing the three keys for open the box that contain the real ID of kira? Let's start solv

Hamza Elansari 4 Nov 28, 2022
Magento-Vagrant-Puppet-Nginx - Installs magento and a nginx server

Magento-Vagrant-Puppet-Nginx Installs Magento MySQL PHP PHP-FPM Nginx n98-magerun Setup git submodule init git submodule update vagrant up Modify pupp

Christian Münch 61 Aug 10, 2022
Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Strategery 123 Nov 20, 2021
[ONLY Magento 2.0.x Compatible] Code samples for Magento developers

Synopsis This project is a collection of samples to demonstrate technologies introduced in Magento 2. You will find the most simple extension along wi

Magento 58 Dec 26, 2022
The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

netz98 magerun CLI tools for Magento 2 The n98 magerun cli tools provides some handy tools to work with Magento from command line. Build Status Latest

netz98 758 Dec 28, 2022
Enables developers to modify Magento installations (configuration, data) based on the given environment using n98-magerun.

Enables developers to modify Magento installations (configuration, data) based on the given environment using n98-magerun.

LimeSoda Interactive Marketing GmbH 73 Apr 1, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
Dashboard that shows who pings your linux box - PHP and TCPDUMP

server-ping-alert Dashboard that shows who pings your linux box - PHP and TCPDUMP This uses tcpdump and php to see who is pinging your linux box. This

null 4 May 16, 2022
O manager Box é um projeto da disciplina de Projeto e prática 2 do IFPE - Igarassu, que consiste em uma aplicação web com funções de gerenciamento de estoque para pequenos empreendimentos.

ManagerBox O Manager Box é um projeto da disciplina de Projeto e prática 2 do IFPE - Igarassu, que consiste em uma aplicação web com funções de gerenc

Alan José 4 Apr 15, 2022
Box of Tricks for common PrePress related tasks.

PrePress Tricks Library Box of Tricks for common PrePress related tasks. Table of Contents Purpose Installation Basic Usage Purpose If you have ever a

null 1 Jul 26, 2022
WordPlate is a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.

WordPlate is simply a wrapper around WordPress. It makes developers life easier. It is just like building any other WordPress website with themes and plugins. Just with sprinkles on top.

WordPlate 1.7k Dec 24, 2022
Humanize values that are readable only for developers.

PHP Humanizer Tests - 4.x Readme for 4.x version Humanize values to make them readable for regular people ;) Installation Run the following command: c

Coduo 1.5k Dec 21, 2022
actionMaster is a new faction plugin that aims at flexibility and customization of the plugin by the user and the developers.

FactionMaster is a new faction plugin that aims at flexibility and customization of the plugin by the user and the developers. It includes all the basic functionality of a faction plugin and data storage in MySQL or SQLITE. This is done by adding an extension system and a translation system. FactionMaster has a will of accessibility to the players and especially not to have to remember a lot of commands to play, all is done via interface.

FactionMaster 21 Dec 26, 2022