4

I am trying to launch any electron application. When I just try to run app with npm start I get an error Running as root without `--no-sandbox` is not supported I edit start script from "electron ." to "electron --no-sandbox ." and get the new error The futex facility returned an unexpected error code./mnt/c/Users/Oleg/electron-quick-start/node_modules/electron/dist/electron exited with signal SIGABRT. I can't find the answer to this question on Google, help plase guys. My environment is: Windows 10 2004, Ubuntu 18.04 LTS, Node.js 12, Visual Studio Code

Oleg Om
  • 429
  • 5
  • 15

1 Answers1

2

I recently just had this problem when trying to run my Electron application as well using WSL2.

Summary of items needed:

  • XSERV running on Windows to Run Linux GUI Applications (e.g., your electron Application)
  • Proper identification of DISPLAY from the remote WSL subsystem

Get an XSERVER

I use https://sourceforge.net/projects/vcxsrv/. Download and install.

Ensure your display is properly identified

Run from your WSL terminal

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0

Authorization Issue?

Authorization required, but no authorization protocol specified

Look at the below GitHub issue for further understanding on creating a start script for your XSERVER on fixing your authorization issue.

https://github.com/microsoft/WSL/issues/4793#issuecomment-588321333

Note: I didn't have to perform to get my setup to work. The above DISPLAY command correctly identifies my host, so this one was unnecessary:

export DISPLAY=$WSL_IF_IP:0
Dharman
  • 30,962
  • 25
  • 85
  • 135
Tr1gZer0
  • 1,482
  • 11
  • 18