Back to Lima

Visual Studio Code

website/content/en/docs/examples/vscode.md

2.1.11.4 KB
Original Source

Securing Visual Studio Code with Lima

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.

  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:
bash
limactl start --mount-none
  1. Add the following line to ~/.ssh/config:
Include ~/.lima/*/ssh.config
  1. Open the Remote Explorer in the Visual Studio Code sidebar and select lima-<INSTANCE> from the SSH remote list.

{{% alert title="Hint" color=success %}} If the Remote Explorer is missing in the sidebar, install the following extensions:

See also the documentation of Visual Studio Code for further troubleshooting. {{% /alert %}}

  1. Set up the workspace by clicking Clone Git Repository... on the Welcome screen, or copy the project directory with limactl cp:
bash
limactl cp -r DIR default:~/