Skip to content

AppImage is Problematic under Dev Mode with AppArmor on Ubuntu 24.04 / 23.10 #6

@coatless

Description

@coatless

After building the electron app on Ubuntu 24.04 ARM, we're getting:

Screenshot of Ubuntu 24.04 ARM in Parallels with RStudio open while trying to build the Electron standalone R Shiny app under {shinyelectron} displaying the error of '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 /home/parallels/shinyelectron/converted-app/electron-app/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.'
Running npm run electron

> My-App-Title@1.0.0 electron
> electron .

[77996:0908/150845.938417:FATAL:sandbox/linux/suid/client/setuid_sandbox_host.cc:166] 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 /home/parallels/shinyelectron/converted-app/electron-app/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
/home/parallels/shinyelectron/converted-app/electron-app/node_modules/electron/dist/electron exited with signal SIGTRAP

However, if we go to where the distribution is made and double-click on the AppImage, we get a working copy of the application:

Standalone AppArmor application working when double-clicked from distribution directory

So, possible, we could:

  1. --no-sandbox when running under dev mode on Ubuntu
  2. Try a workaround proposed by netron via afterPack.js
  3. Add to the install_nodejs_dependencies() a step related to platform such that we modify behavior on linux:
sudo chown root:root node_modules/electron/dist/chrome-sandbox
sudo chmod 4755 node_modules/electron/dist/chrome-sandbox
  1. Recommend to disable on Ubuntu as this is an edge case:
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

Official post on AppArmor changes in 23.10:

https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces

Relevant SO suggesting a custom AppArmor entry:

https://askubuntu.com/a/1528215

Relevant Electron Builder Issue ticket:

electron/electron#42510

New MWE Issue ticket:

electron/electron#48280

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions