cant run electron on win10 ubuntu subsystem

669 views Asked by At

i have a repo for an electron project ive been able to run in ubuntu subsystem before fine, im on a new pc now and having trouble. I already ran npm i, but when I run electron . i get this err:

martin@DESKTOP-URPCCBK:/mnt/c/Users/marti/Documents/projects/electron-upload-manager$ npm start

> [email protected] start /mnt/c/Users/marti/Documents/projects/electron-upload-manager
> electron .

[5094:0907/143024.016724:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /mnt/c/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.

so i ran

sudo chown root /mnt/c/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox

and

sudo chmod 4755 /mnt/c/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox

then ran npm start again, and get:

martin@DESKTOP-URPCCBK:/mnt/c/Users/marti/Documents/projects/electron-upload-manager$ npm start

> [email protected] start /mnt/c/Users/marti/Documents/projects/electron-upload-manager
> electron .

[5120:0907/143308.127280:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /mnt/c/Users/marti/Documents/projects/electron-upload-manager/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.

I did what the error asked, but still got the error? Ive tried removing my node_modules, reinstalling with npm i, running apt-get update, installing electron globally but still am getting this err

3

There are 3 answers

3
SuperStormer On

You need to enable metadata on DrvFs. Put this in /etc/wsl.conf:

[automount]
options = "metadata"

After this, chmod/chown should work on windows files. See this Microsoft blogpost for more details.

0
Martin On

ill just run it in command prompt instead, got it working fine there

1
Adx On

Try this command. It is a work-around:

sudo sysctl kernel.unprivileged_userns_clone=1