Skip to content

Commit 8ea7c49

Browse files
committed
docs: add examples/vscode
Lima helps securing the development environment by running it inside a VM. Notably, this prevents AI agents, such as GitHub Copilot in VS Code, from directly executing untrusted commands on the host. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
1 parent 9d5f469 commit 8ea7c49

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Visual Studio Code
3+
weight: 9
4+
---
5+
6+
## Securing Visual Studio Code with Lima
7+
8+
Lima helps securing the development environment by running it inside a VM.
9+
Notably, this prevents AI agents, such as [GitHub Copilot in VS Code](https://code.visualstudio.com/docs/copilot/overview), from directly executing untrusted commands on the host.
10+
11+
1. Start a Lima instance. If you use GitHub Copilot, consider disabling mounts by passing the `--mount-none` flag to prevent Copilot from accessing host files:
12+
13+
```bash
14+
limactl start --mount-none
15+
```
16+
17+
2. Add the following line to `~/.ssh/config`:
18+
19+
```
20+
Include ~/.lima/*/ssh.config
21+
```
22+
23+
3. Open the Remote Explorer in the Visual Studio Code sidebar and select `lima-<INSTANCE>` from the SSH remote list.
24+
25+
![](/images/vscode-remote-explorer.png)
26+
27+
{{% alert title="Hint" color=success %}}
28+
If the Remote Explorer is missing in the sidebar, install the following extensions:
29+
- [Remote Explorer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-explorer)
30+
- [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh)
31+
32+
See also the [documentation](https://code.visualstudio.com/docs/remote/ssh) of Visual Studio Code for further troubleshooting.
33+
{{% /alert %}}
34+
35+
4. Set up the workspace by clicking `Clone Git Repository...` on the `Welcome` screen, or copy the project directory with `limactl cp`:
36+
37+
```bash
38+
limactl cp -r DIR default:~/
39+
```
214 KB
Loading

0 commit comments

Comments
 (0)