Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit e6162c9

Browse files
authored
Add note on shared memory (CI Ignore)
1 parent b693524 commit e6162c9

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

script-library/docs/desktop-lite.md

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ You can use this script for your primary dev container by adding it to the `feat
5454

5555
If you have already built your development container, run the **Rebuild Container** command from the command palette (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>) to pick up the change.
5656

57+
If you run into applications crashing, you may need to increase the size of the shared memory space. For example, this will bump it up to 1 GB in `devcontainer.json`:
58+
59+
```json
60+
runArgs: ["--shm-size=1g"]
61+
```
62+
63+
Or using Docker Compose:
64+
65+
```yaml
66+
services:
67+
your-service-here:
68+
# ...
69+
shm_size: '1gb'
70+
# ...
71+
```
72+
5773
### Script use
5874

5975
1. Add [`desktop-lite-debian.sh`](../desktop-lite-debian.sh) to `.devcontainer/library-scripts`
@@ -95,9 +111,26 @@ If you have already built your development container, run the **Rebuild Containe
95111

96112
The `runArgs` / Docker Compose setting allows the container to take advantage of an [init process](https://docs.docker.com/engine/reference/run/#specify-an-init-process) to handle application and process signals in a desktop environment.
97113

98-
4. Once you've started the container / codespace, you'll be able to use a browser on port **6080** from anywhere or connect a [VNC viewer](https://www.realvnc.com/en/connect/download/viewer/) to port **5901** when accessing the codespace from VS Code.
114+
4. If you run into applications crashing, you may need to increase the size of the shared memory space. For example, this will bump it up to 1 GB in `devcontainer.json`:
115+
116+
```json
117+
runArgs: ["--init", "--shm-size=1g"]
118+
```
119+
120+
Or using Docker Compose:
121+
122+
```yaml
123+
services:
124+
your-service-here:
125+
# ...
126+
init: true
127+
shm_size: '1gb'
128+
# ...
129+
```
99130

100-
5. Default **password**: `vscode`
131+
5. Once you've started the container / codespace, you'll be able to use a browser on port **6080** from anywhere or connect a [VNC viewer](https://www.realvnc.com/en/connect/download/viewer/) to port **5901** when accessing the codespace from VS Code.
132+
133+
6. Default **password**: `vscode`
101134

102135
The window manager is installed is [Fluxbox](http://fluxbox.org/). **Right-click** to see the application menu. In addition, any UI-based commands you execute in the VS Code integrated terminal will automatically appear on the desktop.
103136

@@ -122,14 +155,9 @@ If you want the full version of **Google Chrome** in the desktop:
122155
```Dockerfile
123156
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
124157
&& curl -sSL https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /tmp/chrome.deb \
125-
&& apt-get -y install /tmp/chrome.deb \
126-
&& ALIASES="alias google-chrome='google-chrome --disable-dev-shm-usage'\nalias google-chrome-stable='google-chrome-stable --disable-dev-shm-usage'\n\alias x-www-browser='x-www-browser --disable-dev-shm-usage'\nalias gnome-www-browser='gnome-www-browser --disable-dev-shm-usage'" \
127-
&& echo "${ALIASES}" >> tee -a /etc/bash.bashrc \
128-
&& if type zsh > /dev/null 2>&1; then echo "${ALIASES}" >> /etc/zsh/zshrc; fi
158+
&& apt-get -y install /tmp/chrome.deb
129159
```
130160
131-
2. Chrome sandbox support requires you set up and run as a non-root user. The [`debian-common.sh`](common.md) script can do this for you, or you [set one up yourself](https://aka.ms/vscode-remote/containers/non-root). Alternatively, you can start Chrome using `google-chrome --no-sandbox --disable-dev-shm-usage`
132-
133-
3. While Chrome should be aliased correctly with the instructions above, if you run into crashes, pass `--disable-dev-shm-usage` in as an argument when starting it: `google-chrome --disable-dev-shm-usage`
161+
2. Chrome sandbox support requires you set up and run as a non-root user. The [`debian-common.sh`](common.md) script can do this for you, or you [set one up yourself](https://aka.ms/vscode-remote/containers/non-root). Alternatively, you can start Chrome using `google-chrome --no-sandbox`
134162
135163
That's it!

0 commit comments

Comments
 (0)