Skip to content

Commit 31191b1

Browse files
authored
Merge pull request #452 from holochain/hotfix-add-advice-for-ubuntu
add instructions for fixing security error in Ubuntu 24.04
2 parents 160fe6e + 370fec7 commit 31191b1

File tree

5 files changed

+50
-1
lines changed

5 files changed

+50
-1
lines changed

.cspell/custom-words.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ QUIC
2727
rustc
2828
rustflags
2929
rustup
30+
setgid
31+
setuid
3032
subl
3133
Tauri
3234
Ulhaq

.cspell/words-that-should-exist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ howtos
1515
interoperating
1616
permissioned
1717
permissivity
18+
redistributable
1819
runtimes
1920
sandboxed
21+
sandboxing
2022
scaffolder
2123
spacebar
2224
todo

src/pages/get-started/2-hello-world.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ nix develop
3030
```shell
3131
npm install
3232
```
33+
34+
!!! info Warning for Ubuntu 24.04 and later
35+
Ubuntu Linux 24.04 [introduces security policy changes](https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions-15) that cause the following command to fail. Here's a simple fix. In your terminal, run this command:
36+
37+
```shell
38+
chmod 4755 node_modules/electron/dist/chrome-sandbox && sudo chown root:root node_modules/electron/dist/chrome-sandbox
39+
```
40+
41+
You'll need to do this once (but only once) for every new project you scaffold. You can find out more [here](/get-started/install-advanced/#fixing-the-suid-sandbox-error-in-ubuntu-24-04).
42+
!!!
43+
3344
```shell
3445
npm start
3546
```

src/pages/get-started/3-forum-app-tutorial.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,16 @@ Before you get started editing the UI, it's helpful to be able to actually run t
795795

796796
## 8. Run your application in dev mode
797797

798+
!!! info Warning for Ubuntu 24.04 and later
799+
Ubuntu Linux 24.04 [introduces security policy changes](https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions-15) that cause the following command to fail. Here's a simple fix. In your terminal, run this command:
800+
801+
```shell
802+
chmod 4755 node_modules/electron/dist/chrome-sandbox && sudo chown root:root node_modules/electron/dist/chrome-sandbox
803+
```
804+
805+
You'll need to do this once (but only once) for every new project you scaffold. You can find out more [here](/get-started/install-advanced/#fixing-the-suid-sandbox-error-in-ubuntu-24-04).
806+
!!!
807+
798808
At this stage, we'll incorporate some of the UI components that have been scaffolded by the scaffolding tool into our main application interface. Our aim here is to make all the functionality of our forum application accessible from a single, unified interface. We'll use Svelte to accomplish this, as it is the framework that we have chosen for the UI layer of our application.
799809

800810
Start the forum hApp in develop mode from the command line: go to your terminal and, from the root folder (`my_forum_app/`), enter:

src/pages/get-started/install-advanced.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,28 @@ rm -rf /nix
265265
rm ~/.nix-profile
266266
```
267267

268-
[Detailed uninstallation instructions for macOS](https://gist.github.com/chriselsner/3ebe962a4c4bd1f14d39897fc5619732#uninstalling-nix)
268+
[Detailed uninstallation instructions for macOS](https://gist.github.com/chriselsner/3ebe962a4c4bd1f14d39897fc5619732#uninstalling-nix)
269+
270+
## Fixing the SUID sandbox error in Ubuntu 24.04
271+
272+
Ubuntu 24.04 [introduced an AppArmor security policy](https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions-15) that causes `hc spin`, which is used to test applications and their UIs, to fail with a fatal error. If you have a `package.json` that lists `@holochain/hc-spin` as a dev dependency, you may see this error message:
273+
274+
::: output-block
275+
```
276+
[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 <path_to_your_application_project>/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
277+
```
278+
:::
279+
280+
You can fix the issue by entering the following command in your project's root directory:
281+
282+
```shell
283+
chmod 4755 node_modules/electron/dist/chrome-sandbox && sudo chown root:root node_modules/electron/dist/chrome-sandbox
284+
```
285+
286+
You'll have to do this for every hApp project that uses `@holochain/hc-spin`.
287+
288+
There are other fixes [outlined in the Ubuntu 24.04 release notes](https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890#unprivileged-user-namespace-restrictions-15) that can solve the problem; if you'd like to learn more, read through them all and choose the one that feels most appropriate for you.
289+
290+
### Redistributable applications created with [`holochain-kangaroo-electron`](https://github.com/holochain-apps/holochain-kangaroo-electron) are also affected
291+
292+
Because the template repo `holochain-kangaroo-electron` also bundles Electron's chrome-sandbox in the binary that you'd distribute, your users will see the same error message when they try to run your application if you've used this repo. We're still researching the best solution, but since Ubuntu is recommending it, we recommend applying the first solution in the release notes, which involves creating an AppArmor profile for your app. This profile could then be distributed and installed alongside it. (Note: this won't work with portable application packages that aren't installed as root, such as `AppImage`s.)

0 commit comments

Comments
 (0)