GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(desktop): Add option to run OpenCode backend via WSL on Windows · Issue #5635 · anomalyco/opencode

feat(desktop): Add option to run OpenCode backend via WSL on Windows #5635

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
feat(desktop): Add option to run OpenCode backend via WSL on Windows#5635
Copy link
Assignees
adamdotdevinBrendonovich

Description

@jms830
jms830
opened on Dec 16, 2025
Issue body actions

Summary

Windows users who prefer WSL for their development environment currently cannot use the Desktop app effectively. The Desktop app only spawns a native Windows sidecar binary, but many developers have their projects and tooling inside WSL.

Current Behavior

The Tauri desktop app spawns OpenCode as a native Windows binary via the sidecar mechanism:

  • packages/tauri/src-tauri/src/lib.rs:64-91 - spawn_sidecar() always uses native binary
  • packages/tauri/scripts/utils.ts:3-24 - Only defines native platform targets

Proposed Solutions

Option A: Settings Toggle (Recommended)

Add a settings UI that allows users to choose their backend:

  1. Native (default) - Use bundled sidecar binary
  2. WSL - Run wsl -e opencode serve --port=PORT
  3. Custom command - Power users specify their own command

The setting would persist in app config and be read at startup.

Implementation:

  • Enable the currently disabled Settings button in layout.tsx:536-546
  • Add settings modal with backend configuration
  • Modify spawn_sidecar() to check config and use appropriate spawn method
  • For WSL: use Command::new("wsl").args(["-e", "opencode", "serve", ...]) instead of sidecar

Option B: Auto-Detection

Detect if the opened project folder is inside WSL (path starts with \\wsl$\ or /mnt/) and automatically use WSL backend for those projects.

Pros: Zero configuration
Cons: May not match user intent, harder to implement reliably

Option C: Environment Variable Override

Support OPENCODE_BACKEND=wsl environment variable that changes spawn behavior.

Pros: Simple implementation
Cons: Not user-friendly, requires launching from terminal

Additional Context

Related WSL issues (different problems):

  • /editor: non-successful editor exits should keep the text in the textarea #693 - TUI rendering in WSL
  • fix: Copilot Premium Requests #595 - Paste issues in WSL terminal

This issue is specifically about the Desktop app being able to launch the OpenCode server via WSL rather than native Windows.

Use Case

  1. User has projects inside WSL filesystem
  2. User installs OpenCode Desktop on Windows
  3. User wants Desktop UI but with OpenCode running inside WSL (for proper file access, tooling, etc.)
Reacted by Sixu Yan, Duye, Mark Novikov, Zeryther, Paris Qian, Alexander Moosbrugger, Rózsa Zoltán, Riccardo De Matteo, Weiqi Wang, Makar and 30 more

Activity

  1. github-actions
    assigned
    adamdotdevin
    on Dec 16, 2025
  2. github-actions
    added
    webRelates to opencode on web / desktop
    on Dec 16, 2025
  3. github-actions commented on Dec 16, 2025

    @github-actions
    github-actionsBot
    on Dec 16, 2025 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: OpenCode-Desktop Remote Workspace #5608: [FEATURE]: OpenCode-Desktop Remote Workspace - This requests remote development support for the Desktop app, which is conceptually related to running the backend via WSL.

    Feel free to ignore if your specific WSL use case differs from these requests.

  4. Brendonovich commented on Dec 17, 2025

    @Brendonovich
    Brendonovich
    on Dec 17, 2025
    Member
    More actions

    Desktop's windows build currently bundles opencode-windows-x64 to run the server. Would doing this WSL integration properly require running the opencode-linux-x64 build, or would just running the Windows binary within the WSL shell work?

  5. AaronFeledy commented on Feb 4, 2026

    @AaronFeledy
    AaronFeledy
    on Feb 4, 2026
    More actions

    It would need to run the linux binary in WSL. VSCode handles this by downloading its linux binary into WSL when you enable WSL integration in the windows app.

  6. Brendonovich commented on Feb 4, 2026

    @Brendonovich
    Brendonovich
    on Feb 4, 2026
    Member
    More actions

    Good to know, so we'll likely need to download opencode-linux-x64 and then launch that inside WSL

    Reacted by Luke Parker
  7. Brendonovich
    self-assigned this
    on Feb 9, 2026
  8. Brendonovich commented on Feb 11, 2026

    @Brendonovich
    Brendonovich
    on Feb 11, 2026
    Member
    More actions

    #12914 provides a toggle that will download + launch the OC server in WSL once the app is restarted, will be out in the next release.

    Reacted by pho, Aaron Feledy and Shunya Abe
  9. jairbj commented on Mar 1, 2026

    @jairbj
    jairbj
    on Mar 1, 2026
    More actions

    #12914 provides a toggle that will download + launch the OC server in WSL once the app is restarted, will be out in the next release.

    It looks like it was disabled in 1.2.7.

  10. wbdb commented on Mar 20, 2026

    @wbdb
    wbdb
    on Mar 20, 2026
    More actions

    That would be a great function, especially since it is also known from the Codex Windows app.

    • Step 1: Check whether opencode is already available in WSL PATH. If needed, also verify the installation directory.

      • If it is not installed, run the following command in WSL:
        curl -fsSL https://opencode.ai/install | bash
    • Step 2: If the environment variable is not already set, start opencode with a random password:

      OPENCODE_SERVER_PASSWORD='my random pw' opencode serve --hostname 0.0.0.0
    • Step 3: Connect to the OpenCode instance running in WSL from the Windows desktop app - the documentation doesn't say much about how to do this exactly (Password) - https://opencode.ai/docs/de/windows-wsl/

    I'm currently using the detour via a .bat file:

    @echo off
    setlocal EnableExtensions DisableDelayedExpansion
    
    set "OC_PASSWORD=something"
    set "OC_PORT=4096"
    
    where wt.exe >nul 2>nul
    if errorlevel 1 (
        echo Error: Windows Terminal wt.exe not found.
        exit /b 1
    )
    
    start "" wt.exe -w new new-tab --title "OpenCode server :%OC_PORT%" --suppressApplicationTitle -- wsl.exe -- bash -lic "OPENCODE_SERVER_PASSWORD='%OC_PASSWORD%' opencode serve --hostname 0.0.0.0 --port %OC_PORT%"
    
    timeout /t 2 /nobreak >nul
    
    start "" "C:\Users\<username>\AppData\Local\OpenCode\OpenCode.exe"
    exit /b 0
    
    Reacted by Josua Michalak
  11. Ausoj commented on Apr 4, 2026

    @Ausoj
    Ausoj
    on Apr 4, 2026
    More actions

    The workaround @wbdb provided does not seem to work for me.

    Trying to do it like that always resulted in opencode getting back mangled directory paths and not being able to properly map sessions between wsl and windows paths.

    Still hoping for a fix for this issue as right now opencode desktop for windows is unusable when wanting to work in wsl

  12. tackleberrybey commented on Apr 10, 2026

    @tackleberrybey
    tackleberrybey
    on Apr 10, 2026
    More actions

    any update on this?
    this should have been the default behaviour of the desktop app since a lot of devs on windows use wsl2 nowadays

    Reacted by wbdb, Justin Adler, ecchan, Camille Vrod and Ismael
  13. thdxr
    removed
    webRelates to opencode on web / desktop
    on May 3, 2026
  14. github-actions commented on Jul 3, 2026

    @github-actions
    github-actionsBot
    on Jul 3, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  15. github-actions
    closed this as not plannedon Jul 3, 2026
  16. PureKrome commented on Jul 3, 2026

    @PureKrome
    PureKrome
    on Jul 3, 2026
    More actions

    reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Brendonovich
    Brendonovich
  • @adamdotdevin
    adamdotdevin

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.