and 2.) or the WSL2 gateway IP address (3.
#Phpstorm wsl2 windows 10#
In all of them what you need to do is set the following configuration in ray: 'host' => $windows_10_ip_addr, // this could be the windows 10 IP address (1. Reconfigure the ray package each time we boot our Windows 10 host and WSL2 to set $windows_10_ip_addr as the WSL2 gateway IP.Set a DHCP reservation for our Windows 10 host on our DHCP server.Set a static IP address manually for our Windows 10 host.The first two are the recommended ways as you are required to configure them only once: There are 3 ways to reach the ray app from within WSL2 that is running our code. First off we need to know that WSL2 changes its IP address segment on each launch (each Windows 10 reboot) because that's how it works in Hyper-V, but it also configures automatically the routing necessary to reach our physical network segment (Windows 10 IP address segment) from within WSL2 for us. What we need to achieve is that WSL2 (which is running our code) is able to send the ray debug events to the Windows 10 host. Our Windows 10 host and our WSL2 Linux each have its own network configuration. Knowing this, we need to setup the ray package accordingly to connect to the app. When using WSL2 on Windows 10 we need to consider first how this technology works: essentially, the Linux running on WSL2, is an optimized VM running on Hyper-V, but it is a "full-blown" Linux OS independent from your host that has some specific kernel changes to make things a bit smoother.
#Phpstorm wsl2 update#
However, be sure to update your run_editor.js to your current version of PhpStorm and everything should work. Problems getting it to work out of the box. There is aĬhance you may need to reference this issue if you are having
Just goto PhpStorm Protocol Package and follow the directions. So you could just call.Windows 10 does not support the PhpStorm protocol and therefore you will not be able to open PhpStorm given the link from Ray.Īs a work-around, has a package to edits your registry to correlate the PhpStorm link protocol to your PhpStorm instance. If no path is specified, it will use your working directory by default. You can then call this function from your shell. Note: this requires that you mount the C: drive in WSL if you have not already done so. bashrcĬmd.exe "/mnt/c/Users//scripts/jetbrains/phpstorm.cmd" $(wslpath -w $) To be able to run this form WSL you can use the following. Or a WSL project C:\Users\\scripts\jetbrains\phpstorm.cmd "\\wsl$\Ubuntu-20.04\" C:\Users\\scripts\jetbrains\phpstorm.cmd "C:\" The first argument is the path to to the project directory. Now that the Toolbox scripts are setup you can run the following from the command prompt. You could name it something else, but make sure you remember what you called it. Make sure Shell script name is "phpstorm".Click vertical ellipsis icon > Settings.Close settings and go to the Tools tab.I prefer something like "C:\Users\\scripts\jetbrains".
You can do this with Toolbox and a shell function.