Skip to content

Commit

Permalink
Merge pull request #457 from holochain/hotfix-wsl-tauri-electron-advice
Browse files Browse the repository at this point in the history
add note about installing ubuntu packages for WSL2
  • Loading branch information
pdaoust committed Jun 24, 2024
2 parents 38d03bf + 005ee59 commit a00399d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .cspell/custom-words.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Words that are neither common nor directly related to Holochain but appear in
# Dev Portal content
adwaita
agent-centricity
Anwaar
Automerge
Expand All @@ -20,6 +21,11 @@ identicon
identicons
IPFS
Kleppmann
libasound
libatk
libcups
libgtk
libnss
NixOS
nixpkgs
pkgs
Expand All @@ -34,4 +40,6 @@ Tauri
Ulhaq
Wahlstrom
WebRTC
webview
webviews
workdir
1 change: 1 addition & 0 deletions .cspell/holochain-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DeepKey
dnas
DPKI
hApp
hApps
Holo
Holo's
Holochain
Expand Down
8 changes: 8 additions & 0 deletions src/pages/get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ For Windows users, please note that the Nix package manager, which is used to in

Holochain is supported in WSL2 via the Ubuntu distribution.

You'll also need to install a few packages if you want to run two dev tools, `hc launch` and `hc spin`, which start your app's back end and open its GUI in Tauri or Electron webviews:

```shell
sudo apt install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-dev libasound2 adwaita-icon-theme
```

Read more about these fixes in the [Dev Tools Setup guide](/get-started/install-advanced/#opening-your-happs-gui-in-ubuntu-on-wsl2).

### 2.3. Set up development environment

Once you've ensured that your system meets the hardware requirements and set up WSL2 on Windows or a dual-boot Linux OS (if applicable), you can proceed with the installation of the Nix package manager and the binary package cache for Holochain.
Expand Down
16 changes: 16 additions & 0 deletions src/pages/get-started/install-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,19 @@ There are other fixes [outlined in the Ubuntu 24.04 release notes](https://disco
### Redistributable applications created with [`holochain-kangaroo-electron`](https://github.com/holochain-apps/holochain-kangaroo-electron) are also affected

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.)

## Opening your hApp's GUI in Ubuntu on WSL2 (Windows Subsystem for Linux) {#opening-your-happs-gui-in-ubuntu-on-wsl2}

There are two dev tools, `hc launch` and `hc spin`, which start your app's back end and open its GUI in [Tauri](https://tauri.app/) or [Electron](https://www.electronjs.org/) webview containers, respectively. Because the Ubuntu OS installed from the Microsoft Store doesn't come with GUI packages by default, you'll need to install just a few in order to get these tools to work.

If you're only using `hc launch`, which uses the Tauri webview, install this package, which resolves a GDK error about cursors:

```shell
sudo apt install -y adwaita-icon-theme
```

If you're only using the more modern `hc spin`, which uses the Electron webview, install these missing packages that are needed by the `chrome-sandbox` binary:

```shell
sudo apt install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-dev libasound2
```

0 comments on commit a00399d

Please sign in to comment.