Hex-Rays License Server on WSL
Introduction
This tutorial will guide you through the steps to configure Windows Subsystem for Linux (WSL) to install and use the new Hex-Rays license server in a WSL Ubuntu instance.
You will learn how to:
Properly configure the WSL and optionally make it run in the background.
Install the Hex-Rays license server and verify it's up and running.
Prerequisites
To follow this tutorial:
Ensure you have an up-to-date Windows Subsystem for Linux with an installed Ubuntu distribution. If not, refer to this guide for installation instructions.
You should use Windows 11 version 22H2 or later, as we will enable the WSL mirrored mode networking.
WSL configuration
Mirrored mode
Enabling mirrored mode configures WSL to an entirely new networking architecture that replicates (mirrors) your Windows network interfaces within the Linux environment.
Create WSL configuration file
To enable this mode, create a new file named
%UserProfile%\\.wslconfig
.Add the following lines to the file:
Save the file.
Verify mirrored network configuration
First, make sure that all the WSL instances are stopped and restart a fresh Ubuntu instance:
In the WSL instance, type:
Examples comparison
On our current machine, we have the following output:
On Windows, ipconfig /all
output gives matching details:
When properly configured, the wireless interface is "mirrored" in the WSL Ubuntu instance, i.e., the Windows machine and the WSL Ubuntu instance share the Wifi interface IP and MAC address. In fact, all the Windows interfaces are mirrored, but we focus on wireless network interface.
Systemd
The Hex-Rays license server installation supports configuring the server as a systemd service. To use this feature, you should enable systemd in your WSL instance.
Start a WSL Ubuntu instance as root:
Use your preferred editor to create or add the following lines to the
/etc/wsl.conf
file:
Execute the following lines:
Networking
To communicate with the WSL-hosted Hex-Rays license server from the network, you have to know the IP address of your WSL Ubuntu instance as seen by your Windows host.
Use wsl hostname -i
command to retrieve the IP address:
Setting up port forwarding
To allow external connections to reach the license server, you must forward incoming connections from the Windows host to the Ubuntu instance. This is achieved using the port proxy interface.
In this setup, we forward all connections coming to our Windows host on port 65435
to our license server listening on the default port 65434
in WSL.
In an elevated command prompt, type the following command:
Verify the result:
Firewall configuration
Finally, ensure that the Hyper-V firewall allows inbound connections on your port (in this example, 65434
).
Execute the following PowerShell command in an elevated command prompt:
If your setup requires it, you might have to open the TCP forwarding port (
65435
in our case) in the Windows firewall.
With this final step, the WSL networking configuration is complete.
Running WSL in the background - optional configuration
In a typical scenario, a WSL instance starts at system startup or within a command prompt, however when the command prompt is closed, WSL will silently stop after about a minute. To keep WSL running until it is explicitly stopped with wsl --shutdown
, a simple script can be used.
Create a script that executes the following command:
To verify if your instance is still running, use the following command:
Installing the Hex-Rays license server
After your WSL is properly configured, you can go ahead and install the Hex-Rays license server.
The procedure to install the Hex-Rays license server can be found here.
Verify the Hex-Rays license server is up and running
To verify that the Hex-Rays license server is accessible, make the following checks:
Check the network configuration
In our exemplary case, we retrieved the IPv4 address of the Windows machine to ensure the correct network settings.
Connect with Hex-Rays license server in IDA License Manager
In the License Manager, we set a server address at 192.168.1.131
and port 65435
.
Troubleshooting
License server connection fails after reboot
We have noticed that for some reason, the Windows IP Helper service has to be restarted after rebooting your computer, otherwise an RST (Reset) response is received when trying to connect to the License server.
The solution: Restart the IP Helper automatically
Add this command to a startup script so that Windows runs it automatically after every reboot:
Last updated
Was this helpful?