Can't run under Linux #353

Closed
opened 2026-01-29 16:37:18 +00:00 by claunia · 8 comments
Owner

Originally created by @CrisVrinceanu on GitHub (Jul 3, 2019).

Originally assigned to: @GregorBiswanger on GitHub.

I can't run my application under Linux anymore after the new release.
It's creating a .snap file which I can't use because of the environment we have (can't install snap in production OS). I have tried copying the linux-unpacked folder which seems to have the same hierarchy as the previous one, given execution permissions but no output is shown when executing.

I can still build with the previous CLI version (which wasn't using the build server I guess).

How can I avoid building a .snap?

Originally created by @CrisVrinceanu on GitHub (Jul 3, 2019). Originally assigned to: @GregorBiswanger on GitHub. I can't run my application under Linux anymore after the new release. It's creating a .snap file which I can't use because of the environment we have (can't install snap in production OS). I have tried copying the linux-unpacked folder which seems to have the same hierarchy as the previous one, given execution permissions but no output is shown when executing. I can still build with the previous CLI version (which wasn't using the build server I guess). How can I avoid building a .snap?
claunia added the question label 2026-01-29 16:37:18 +00:00
Author
Owner

@CrisVrinceanu commented on GitHub (Jul 3, 2019):

@GregorBiswanger

@CrisVrinceanu commented on GitHub (Jul 3, 2019): @GregorBiswanger
Author
Owner

@GregorBiswanger commented on GitHub (Jul 3, 2019):

What was your previous CLI version?

@GregorBiswanger commented on GitHub (Jul 3, 2019): What was your previous CLI version?
Author
Owner

@CrisVrinceanu commented on GitHub (Jul 3, 2019):

The previous version which is working:
ElectronNET.CLI Version: 0.0.11.0

Actual version I'm trying to use:
ElectronNET.CLI Version: 5.22.13.0

The command is the same:
electronize build /target linux

Electronize start works with both (on windows)

Build output:

MyPath>electron-builder . --config=./bin/electron-builder.json --platform=linux --arch=x64
  ΓÇó electron-builder version=20.44.4
  ΓÇó loaded configuration file=mypath\obj\desktop\linux\bin\electron-builder.json
  ΓÇó no native production dependencies
  ΓÇó packaging       platform=linux arch=x64 electron=5.0.1 appOutDir=mypath\bin\Desktop\linux-unpacked
  ΓÇó scheduling remote build target=snap arch=x64
  ΓÇó compressing and uploading to remote builder
  ΓÇó uploaded to remote builder  duration=27.853s
  ΓÇó remote building  status=job started (queue time: 0s)
  ΓÇó remote building  status=  ΓÇó electron-builder version=20.44.4
  ΓÇó remote building  status=  ΓÇó building        target=snap arch=x64 file=out/electron.net.host_1.0.0_amd64.snap
  ΓÇó remote building  status=  ΓÇó default Electron icon is used reason=application icon is not set
  ΓÇó remote building  status=  ΓÇó application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  ΓÇó remote building  status=build in progress...
  ΓÇó downloading     parts=8 size=102 MB url=electron.net.host_1.0.0_amd64.snap
  ΓÇó file downloaded  duration=1.33s file=electron.net.host_1.0.0_amd64.snap size=102 MB
  ΓÇó found build service useful? Please donate (https://donorbox.org/electron-build-service)`

You can see i've never set snap as target.

Electron manifest:
{ "executable": "Browser.Electron", "splashscreen": { "imageFile": "" }, "singleInstance": false, "build": { "target": "AppImage", "appId": "com.Browser.Electron.app", "productName": "Browser.Electron", "copyright": "Copyright © 2019", "buildVersion": "1.0.0", "compression": "maximum", "directories": { "output": "../../../bin/Desktop" }, "extraResources": [ { "from": "./bin", "to": "bin", "filter": [ "**/*" ] } ], "files": [ { "from": "./ElectronHostHook/node_modules", "to": "ElectronHostHook/node_modules", "filter": [ "**/*" ] }, "**/*" ] }

@CrisVrinceanu commented on GitHub (Jul 3, 2019): The previous version which is working: ElectronNET.CLI Version: 0.0.11.0 Actual version I'm trying to use: ElectronNET.CLI Version: 5.22.13.0 The command is the same: electronize build /target linux Electronize start works with both (on windows) Build output: ``` MyPath>electron-builder . --config=./bin/electron-builder.json --platform=linux --arch=x64 ΓÇó electron-builder version=20.44.4 ΓÇó loaded configuration file=mypath\obj\desktop\linux\bin\electron-builder.json ΓÇó no native production dependencies ΓÇó packaging platform=linux arch=x64 electron=5.0.1 appOutDir=mypath\bin\Desktop\linux-unpacked ΓÇó scheduling remote build target=snap arch=x64 ΓÇó compressing and uploading to remote builder ΓÇó uploaded to remote builder duration=27.853s ΓÇó remote building status=job started (queue time: 0s) ΓÇó remote building status= ΓÇó electron-builder version=20.44.4 ΓÇó remote building status= ΓÇó building target=snap arch=x64 file=out/electron.net.host_1.0.0_amd64.snap ΓÇó remote building status= ΓÇó default Electron icon is used reason=application icon is not set ΓÇó remote building status= ΓÇó application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux ΓÇó remote building status=build in progress... ΓÇó downloading parts=8 size=102 MB url=electron.net.host_1.0.0_amd64.snap ΓÇó file downloaded duration=1.33s file=electron.net.host_1.0.0_amd64.snap size=102 MB ΓÇó found build service useful? Please donate (https://donorbox.org/electron-build-service)` ``` You can see i've never set snap as target. Electron manifest: `{ "executable": "Browser.Electron", "splashscreen": { "imageFile": "" }, "singleInstance": false, "build": { "target": "AppImage", "appId": "com.Browser.Electron.app", "productName": "Browser.Electron", "copyright": "Copyright © 2019", "buildVersion": "1.0.0", "compression": "maximum", "directories": { "output": "../../../bin/Desktop" }, "extraResources": [ { "from": "./bin", "to": "bin", "filter": [ "**/*" ] } ], "files": [ { "from": "./ElectronHostHook/node_modules", "to": "ElectronHostHook/node_modules", "filter": [ "**/*" ] }, "**/*" ] }`
Author
Owner

@GregorBiswanger commented on GitHub (Jul 3, 2019):

In the new version (5.22.12), we moved from electron-packager to electron-builder.
Please, use the new "electron.manifest.json" file. Delete the old one, and execute the "electronize init" command inner your asp.net core project.

If you develop under Linux, please install electron-builder with:
sudo npm install electron-builder --global

@GregorBiswanger commented on GitHub (Jul 3, 2019): In the new version (5.22.12), we moved from electron-packager to electron-builder. Please, use the new "electron.manifest.json" file. Delete the old one, and execute the "electronize init" command inner your asp.net core project. If you develop under Linux, please install electron-builder with: `sudo npm install electron-builder --global `
Author
Owner

@CrisVrinceanu commented on GitHub (Jul 4, 2019):

I have followed the steps but the result is still the same.

I am trying to build from Windows for Linux.

It keeps doing that remote build and generating the .snap file. The files in linux-unpacked are still not working.

@CrisVrinceanu commented on GitHub (Jul 4, 2019): I have followed the steps but the result is still the same. I am trying to build from Windows for Linux. It keeps doing that remote build and generating the .snap file. The files in linux-unpacked are still not working.
Author
Owner

@CrisVrinceanu commented on GitHub (Jul 4, 2019):

Update

Now it works, I figured out that this behaviour occurs only if the electron.net.host is run as root (with sudo).
Executing it with a lower level user works fine.

Thank you for the help @GregorBiswanger

@CrisVrinceanu commented on GitHub (Jul 4, 2019): Update Now it works, I figured out that this behaviour occurs only if the electron.net.host is run as root (with sudo). Executing it with a lower level user works fine. Thank you for the help @GregorBiswanger
Author
Owner

@CrisVrinceanu commented on GitHub (Jul 4, 2019):

Re-Opening

Seems like I need to find a way to run the application with elevated privileges (root). Is there any way to do it?

Also is there an electron log I can enable to see what's going wrong when launching as root?
Could be because of the chrome-sandbox? I can see similar behaviour on chromium-browser if trying to launch as root without the "--no-sandbox" flag, but even setting Sandbox to false in WebPreference nothing happens.

@CrisVrinceanu commented on GitHub (Jul 4, 2019): Re-Opening Seems like I need to find a way to run the application with elevated privileges (root). Is there any way to do it? Also is there an electron log I can enable to see what's going wrong when launching as root? Could be because of the chrome-sandbox? I can see similar behaviour on chromium-browser if trying to launch as root without the "--no-sandbox" flag, but even setting Sandbox to false in WebPreference nothing happens.
Author
Owner

@GregorBiswanger commented on GitHub (Jul 26, 2019):

Hi @CrisVrinceanu,
unfortunately, I can not handle your problem right now. Under the hood, Electron.NET uses the electron-builder. You can configure it in the electron.manifest.json file under the build part. You can find the documentation here: https://www.electron.build/configuration/snap

Alternatively you have to google it and try it afterwards.

@GregorBiswanger commented on GitHub (Jul 26, 2019): Hi @CrisVrinceanu, unfortunately, I can not handle your problem right now. Under the hood, Electron.NET uses the **electron-builder**. You can **configure** it in the **electron.manifest.json** file under the **build part**. You can find the documentation here: https://www.electron.build/configuration/snap Alternatively you have to google it and try it afterwards.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#353