Run Photino Apps in WSLg

WSLg includes Wayland, the successor to X11, a graphical environment for Linux. You can read the latest at https://github.com/microsoft/wslg. WSLg is available in Windows 11 and is preferable to WSL2 for Photino work as it doesn't require any 3rd party software or configuration.

Run Photino Apps in WSL2

Yes, you can test your Photino applications in Windows Subsystem for Linux (WSL2)! We've tested with WSL2 and Ubuntu 20.04. While we don't officially support running Photino Linux apps in WSL2, we recognize that it is useful for testing and demos. It does require a little configuration however, because WSL does not have a graphical UI. To compensate, Linux has the X Window System, sometimes referred to as X11 or just X which provides for basic GUI functions. We've tested with an X Windows System for Windows named VcXsrv which can be found on SourceForge.

Configure Your Machine

Install VcXsrv

VcXsrv can be installed with a downloaded installer program obtained from the web page above.

Once VcXsrv server has been installed and run on your Windows machine, you'll see the X Server icon in your system tray. Right-click and choose ‘Show Log’. The last few lines of the log should look something like this:

From the context menu of the system tray icon, there is an Applications submenu from which you can launch xcalc, xclock, and xwininfo; these Linux programs display their GUIs on your Windows desktop.

Set an Environment Variable in Your WSL2 Shell

  1. Open a command prompt or PowerShell prompt in Windows, type ipconfig and hit enter.
  2. Find the entry that reads: Ethernet adapter vEthernet (WSL): and make a note of the IPV4 address listed.
  3. Next, open a WSL shell and enter:
    export DISPLAY=XXX.XXX.XXX.XXX:0.0
    where XXX.XXX.XXX.XXX is the IP address for your WSL vEthernet adapter. Note that most of the directions you'll find online for VcXsrv, XMing and other X Window Servers tell you to use 127.0.0.1 for the IP address. This does not work (at least not well) in WSL2.

  1. You can test running apps from the WSL shell by installing some sample X Window apps: sudo apt-get install x11-apps and then running one of the apps: xeyes, which displays a window with a title bar and a set of eyes that follow the cursor around.

  1. You Photino apps will now run on your Windows desktop as well:

Since Windows assigns a new IP address to WSL2 every time you re-start your computer, you'll have to issue export DISPLAY= command in your shell prompt with the new IP address every time you start WSL2.