DDEV Test Environment for OpenMage in Windows 10/11 #3839
Replies: 8 comments 21 replies
-
Those who use PHPStorm as IDE can integrate DDEV in the editor.There is already a plugin that offers more features. For more details visit |
Beta Was this translation helpful? Give feedback.
-
Question on (Windows) Installing mkcert for Secured Connections scoop bucket add extras
scoop install mkcert I cannot connect my steps with this step:
Where do I look for the file [edit] Got it, the windows executable to install mkcert can be downloaded here: https://github.com/FiloSottile/mkcert/releases |
Beta Was this translation helpful? Give feedback.
-
I encountered the following error: kiat@DESKTOP-7GLIBDK:~/openmage$ ddev composer install
Building project images...
Project images built in 1s.
Container ddev-openmage-db Recreate
Container ddev-openmage-web Recreate
Container ddev-openmage-db Recreated
Container ddev-openmage-web Recreated
Container ddev-openmage-db Started
Container ddev-openmage-web Started
Failed to create certificates for project, check mkcert operation: ERROR: failed to read the CA certificate: unexpected content
; err=exit status 1 What do I do? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
For PHPMyAdmin, it can be invoked simply with |
Beta Was this translation helpful? Give feedback.
-
@addison74 can you add it to #4156 ? |
Beta Was this translation helpful? Give feedback.
-
Small updates to this article
|
Beta Was this translation helpful? Give feedback.
-
I will create a separate article for the situation when the computer on which the DDEV test environment is installed is behind a proxy server with authentication. I encountered this situation recently where a corporation allows employees to access the Internet through a proxy server. Now it seems to me easy to implement, but initially it created some issues because the settings have to be made in both Windows and WSL for it to work. |
Beta Was this translation helpful? Give feedback.
-
Last update February 27, 2025
VMware Workstation - Free for Personal Use
In this tutorial I used VMware Workstation as a desktop hypervisor. Starting with spring 2024, the new owner Broadcom has decided to provide the application with two license models, Free Personal Use or Paid Commercial use. So, you can use this application for free as long as it is for personal use. I encourage everyone to use VMware because compared to its competitors (VirtualBox, Microsoft Hyper-V) it has better performance especially on the graphics side. A Windows 10 or 11 operating system runs in a virtual machine pretty decent to a real one.
For more details read this article
https://blogs.vmware.com/workstation/2024/05/vmware-workstation-pro-now-available-free-for-personal-use.html
VMware Workstation Settings
If you run Windows OS in a virtual machine, it is mandatory to activate the virtualization option. For example, in VMware with the virtual machine off, access
Edit virtual machine settings
. In theHardware
tab selectProcessors
and in theVirtualization engine
section check theVirtualize Intel VT-x/EPT or AMD-V/RVI
option.You need at least 8 GB of memory to run (Docker + PHPStorm) decent. I recommend a machine with 16 GB.
(Windows) Installing the Windows Terminal Application
Microsoft Store
application and search forWindows Terminal
Get
buttonIf you use PHPStorm, at the bottom there is a tab called
Terminal
. Here you can run commands in the Linux distribution too.(Windows) Installing WSL2 (Windows Subsystem for Linux 2)
The Installation Tutorial
https://pureinfotech.com/install-windows-subsystem-linux-2-windows-10/
Useful Commands
https://learn.microsoft.com/en-us/windows/wsl/
Advanced Settings
https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig
You can configure limits on the memory, CPU and swap size allocated to WSL 2 in a
.wslconfig
file. For example, create a file named.wslconfig
in theC:\Users\<User Name>
directory with the following content(Windows) Installing a Linux Distribution
Variant 1
Command Prompt
application as Administratorwsl --list --online
wsl --install -d Ubuntu-20.04
Variant 2
Microsoft Store
application and search for UbuntuOpen the
Terminal
application then choose a new tab with Ubuntu. Follow the steps to complete the installation, setting theusername
andpassword
(e.g. ubuntu / 1234).(Windows) Installing Docker
https://docs.docker.com/desktop/install/windows-install/
Docker Desktop Installer.exe
and run it as AdministratorUse WSL 2 instead of Hyper-V (recommended)
(Windows) Installing mkcert for Secured Connections
https://github.com/FiloSottile/mkcert
Terminal
application as Administratormkcert-vX.X.X-windows-amd64.exe
mkcert-vX.X.X-windows-amd64.exe --install
Yes
(Windows) Linux distribution drive mapping
Windows Explorer
applicationLinux
path and selectUbuntu-20.04
Map network drive...
from the menu. Choose a letter, for example Z:From now on it appears in the
This PC
section underNetwork locations
. If you want to disconnect it, right-click and selectDisconnect
from the menu.(Windows) PHPStorm
Create a new project in PHPStorm that has the location where you cloned the OpenMage repository. If you log in to your GitHub account, you will see in the
Pull Request
tab on the left the open PRs from OpenMage. Open one and checkout to start testing. When you are done, at the bottom of the PHPStorm window you will see theGit
tab. Click on it, then right click onLocal > main
and selectCheckout
. You can update the repositories, locals and remotes, from time to time and more.(Linux) Installing DDEV
https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/
Terminal
application and choose a new tab with Ubuntusudo apt update && sudo apt upgrade -y
(Linux) Copying mkcert Certificates from Windows to Linux
Variant 1
Terminal
application and choose a new tab with Ubuntumkdir -p /home/<user_name/.local/share/mkcert
cp /mnt/c/Users/<User Name>/AppData/Local/mkcert/* /home/<user_name>/.local//share/mkcert/
Variant 2
Windows Explorer
application as administratorrootCA.pem
androotCA-key.pem
fromC:\Users\<User Name>\AppData\Local\mkcert
/home/<user_name/.local/share/mkcert
mkcert
directory(Linux) Installing OpenMage
First make sure that the
Docker Desktop
application is running in Windows.Terminal
application and choose a new tab with Ubuntumkdir -p /home/<user_name>/openmage
git clone https://github.com/OpenMage/magento-lts.git /home/<user_name>/openmage
/home/<user_name>/openmage
.ddev/config.yaml
file to change the webserver and PHP version as you want. I am using Apache and PHP 8.3(WSL) The xdg-open error when running the ddev launch command
If you encounter errors when running the
ddev launch
command, related to xdg-open and a long list of missing Linux browsers it is normal. DDEV wants to launch an installed browser in WSL and since there is none, we have to configure to use the default one in Windows. All you have to do is editing the ~/.bashrc file and adding the following line to the endexport BROWSER="powershell.exe /C start"
For the change to take effect, run
. .bashrc.
.Another variant would be to install in WSL the wslu package.
Conclusion
As you can see, the more complicated part is the initial configuration of WSL, Docker, DDEV. Once done, it doesn't take more than 3-5 minutes to get an instance of OpenMage ready for testing. Forget about XAMPP, WAMP in Windows. The free nature of VMware Workstation allows you to move a virtual machine into many desktops and have a ready to go testing environment.
You can use a test environment in Windows without WSL2, but I do not recommend this configuration because DDEV must be installed in Windows and not inside the Linux distribution. It depends on Mutagen and it is very very slow. Testing in a Linux distribution has many advantages and it is close to the final stage, when you have to move the project into production.
For more information about using DDEV please visit https://github.com/OpenMage/magento-lts/blob/main/docs/DDEV.md. It is a fantastic tool!
Proxy Connection
When you connect to the Internet through a proxy connection, with or without authentication, because the network administrator has banned the access to certain websites (YouTube, Facebook, TikTok), you have to make some changes to be able to run properly the DDEV-based test environment. Please follow the tutorial I created here #4656.
Beta Was this translation helpful? Give feedback.
All reactions