B2C Demo Shop Installation: Windows, with Development Virtual Machine
  • 22 Sep 2020
  • 2 Minutes To Read
  • Print
  • Share
  • Dark
    Light

B2C Demo Shop Installation: Windows, with Development Virtual Machine

  • Print
  • Share
  • Dark
    Light

To install the Demo Shop for B2C implementations on Windows with Development Virtual Machine, follow the steps below.

1. Install Prerequisites

To set up your environment, install the following prerequisites:

vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-hostmanager

2. Install Spryker Virtual Machine

To install the VM, you need to run the following commands. For this purpose, use Git Bash command prompt with administrative privileges.

  1. Launch Git Bash:
  • Click Start.

  • Start typing "Git Bash".

  • In the search results, right-click Git Bash and select Run as administrator.
    Run git bash as administrator

  1. Create the folder in which you want the source code to be placed:
mkdir devvm
cd devvm
  1. Initialize the Vagrant environment:
vagrant init devvm3.1.0 https://github.com/spryker/devvm/releases/download/v3.1.0/spryker-devvm.box

For Spryker Core version 201907.0 or prior, you need to use an older version of the development machine:

vagrant init devvm2.3.1 https://github.com/spryker/devvm/releases/download/v2.3.1/spryker-devvm.box
  1. Update the Vagrantfile:

Add hostmanager plugin configuration:

mv Vagrantfile Vagrantfile.bak
awk '/^end/{print "  config.hostmanager.enabled = true\n  config.hostmanager.manage_host = true"}1' Vagrantfile.bak > Vagrantfile
  1. Build and start the virtual machine:
This step creates the VM without cloning the actual codebase. It will be done in the step 3.8.
VM_SKIP_SF="1" VM_PROJECT=b2c-demo-shop SPRYKER_REPOSITORY="https://github.com/spryker-shop/b2c-demo-shop.git" vagrant up

3. Install the Shop

  1. Log into the VM:
vagrant ssh
  1. Update the network configuration of the VM:
sudo sed -i "s/eth1/eth1 $(ip -o -4 route show to default | cut -d ' ' -f 5)/g; s/create mask = 0775/create mask = 0777/g; s/directory mask = 0775/directory mask = 0777\n  force user = vagrant\n  force group = vagrant/g"  /etc/samba/smb.conf
  1. Add the Samba server to the autoload configuration and restart it:
sudo systemctl enable smbd.service nmbd.service
sudo /etc/init.d/samba restart
  1. Update PHP and Jenkins configuration:
sudo sed -i 's/user = www-data/user = vagrant/g'  /etc/php/7.4/fpm/pool.d/*.conf
sudo sed -i 's/=www-data/=vagrant/g' /etc/default/jenkins-devtest
sudo chown -R vagrant:vagrant /data/shop/devtest/shared/data/common/jenkins
  1. Restart PHP and Jenkins:
sudo /etc/init.d/php7.4-fpm restart
sudo /etc/init.d/jenkins-devtest restart
  1. Change permissions for the project directory:
sudo chown vagrant:vagrant .
sudo chmod og+rwx .
  1. Mount the share in Windows:

    1. Start Windows Command Prompt. To do this, press Win+R, type cmd and press Enter.

    2. Execute the following command to mount the share as a network drive:

      net use s: \\spryker-vagrant\project\current /persistent:yes
      
      The share will be mounted as the s: drive.
  2. Copy the codebase to the VM:

    1. Logout from the VM and clone the codebase into the c:\b2c-demo-shop directory by executing the following commands in Git Bash:

      cd /c/
      git clone https://github.com/spryker-shop/b2c-demo-shop.git
      
    2. In Windows Command Prompt, execute the command to move the c:\b2c-demo-shop directory to the network drive:

      xcopy C:\b2c-demo-shop s: /he
      

      where:

      • s: - is the network drive you have mounted in the previous step.
    3. Make sure that the codebase has been copied completely.

  3. Run the installation commands:

    1. Switch back to Git Bash

    2. Go to the devvm folder you have created in the step 2.1

    3. Run the following commands:

      vagrant ssh
      composer install
      vendor/bin/install
      
If you are using a devvm version lower than 2.2.0, run the ulimit -n 65535 command first.

Executing these steps will install all required dependencies, and run the installation process. Also, this will install the demo data and export it to Redis and Elasticsearch.

When the installation process is complete, Spryker Commerce OS is ready to use. It can be accessed via the following links:

  • http://de.b2c-demo-shop.local - front-end (Storefront);
  • http://zed.de.b2c-demo-shop.local - backend (the Back Office).
  • http://glue.de.b2c-demo-shop.local - REST API (Glue).

Credentials to access the administrator interface: user [email protected] and password change123.

Was This Article Helpful?