dsh-plugin-wsl-env: Running DeepSeek Harness Sessions in WSL 2

Introduction

DeepSeek Harness (DSH) is a plugin-based agent runtime framework. When developing WSL projects in a Windows environment, it is usually necessary to resolve environment switching issues. This plugin achieves the ability to handle both Windows and Linux paths within the same process by keeping the Harness process on Windows while migrating the execution environment to a WSL 2 distribution.

Core Features

This is a DeepSeek Harness plugin maintained by Big-Dao. It allows Harness sessions running on Windows to enter a WSL 2 distribution, providing a real Linux login shell environment and using bubblewrap for sandbox isolation by default.

Key features include:
* WSL 2 Session Execution: Run a session within a WSL 2 distribution inside the Windows Harness process.
* Real Linux Environment: Execute commands using the distribution’s login shell, preserving configurations and rc files such as PATH, nvm, pyenv, etc.
* Sandbox Isolation: Isolates commands using bubblewrap by default.
* GUI Integration: The folder picker can list installed distributions, and terminals open within the distribution.
* Session-level Support: The same Harness process can handle both Windows folders and WSL folders simultaneously.

Installation and Enablement

Installing this plugin requires Windows 10 or 11 and an installed WSL 2 distribution. bubblewrap must be installed within the distribution.

  1. Execute the installation command in the Windows terminal:
    dsh plugin --profile wsl add dsh-plugin-wsl-env
  1. Install bubblewrap in the distribution (using Ubuntu as an example):
    wsl.exe -d ubuntu -u root -- apt-get install -y bubblewrap
  1. After installation, launch Harness with --profile wsl.

Typical Usage

  • Open Distribution Directory: Open a WSL distribution path in the Harness folder picker, such as \\wsl.localhost\ubuntu\home\you\project. Even if the distribution is not the default one, it will run in this environment.
  • Command Execution: All commands are executed in the distribution’s login shell. The path /home/you/x and \\wsl.localhost\ubuntu\home\you\x point to the same file.
  • New Terminal: When opening a new terminal, it will automatically launch a shell in the same distribution and directory.
  • Port Listening: The model can see listening ports and return the development server URL (WSL 2 forwards localhost to Windows).

Use Cases and Notes

  • Environment Requirements: Only supports Windows + WSL 2.
  • Dependency Check: Node.js is not required within the distribution.
  • Sandbox Configuration: The default session sandbox requires the distribution to enable systemd (set systemd=true in /etc/wsl.conf and restart WSL). If systemd is disabled, you need to set sessionSandbox: false in the configuration.
  • Security and Isolation: No helper servers, daemons, or listening ports run inside the distribution. Restricted commands are run using bubblewrap.

This plugin reduces the switching cost for the model between Windows and Linux by aligning shell semantics with the Linux toolchain.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye