Skip to content

Desktop 1.18.4 + WSL2 Ubuntu: shows 'OpenCode not installed' after install; version check fails #38309

Closed as not planned

Description

@joshua-lehmann

Description

OpenCode Desktop 1.18.4 detects the Ubuntu WSL distro but shows "OpenCode not installed" even though OpenCode 1.18.4 is installed and working via the CLI in WSL.

Clicking "Install OpenCode" in the Desktop app appears to succeed, but immediately fails with:

OpenCode update finished but Ubuntu still reports no version; expected 1.18.4

This means the Desktop app cannot detect or verify the OpenCode installation inside the WSL distro, rendering the Desktop launcher unusable for WSL users.

Plugins

none

OpenCode version

1.18.4 (both Desktop on Windows and CLI in WSL)

Steps to reproduce

  1. Install OpenCode Desktop 1.18.4 on Windows 11
  2. Have an Ubuntu WSL2 distro set as default
  3. Install opencode globally in WSL: npm install --global opencode-ai@latest (confirms v1.18.4)
  4. Open OpenCode Desktop — it detects Ubuntu but shows "OpenCode not installed"
  5. Click "Install OpenCode"
  6. Observe: "OpenCode update finished but Ubuntu still reports no version; expected 1.18.4"

Verification

OpenCode is installed at a stable system path that does not depend on .bashrc, interactive shell, or fnm initialization:

$ readlink -f /usr/local/bin/opencode
/usr/local/lib/node_modules/opencode-ai/bin/opencode.js

$ /usr/local/bin/opencode --version
1.18.4

$ which opencode
/usr/local/bin/opencode

Direct invocation via wsl (mimicking how the Desktop app calls into the distro) also works:

$ wsl -d Ubuntu -- opencode --version
1.18.4

The binary is callable without any shell initialization. The Desktop app's version check is failing despite the installation being correct and reachable through the same WSL invocation path the Desktop app uses.

Screenshot and/or share link

Image

The Desktop dialog shows:

  • Ubuntu detected as the distro
  • "OpenCode not installed" status
  • After clicking "Install OpenCode": OpenCode update finished but Ubuntu still reports no version; expected 1.18.4

Operating System

  • Windows 11 build 26200.8893
  • WSL 2.7.10.0
  • Ubuntu, WSL2, default distro
  • OpenCode Desktop 1.18.4
  • OpenCode in WSL 1.18.4
  • Node v24.18.0 via fnm
  • npm 11.16.0

Terminal

Windows Terminal + OpenCode Desktop

Activity

  1. qinyinglun commented on Jul 22, 2026

    @qinyinglun

    @joshua-lehmann

    Manual OpenCode Installation on WSL

    https://github.com/anomalyco/opencode/releases/download/v1.18.4/opencode-linux-x64.tar.gz

    I encountered the same issue and found that the root cause is the installation path.

    The OpenCode Desktop app expects the binary to be located at:

    text
    ~/.local/bin/opencode
    When installed via npm install --global opencode-ai, the binary is placed in a different location (e.g., /usr/local/bin/opencode), which the Desktop app does not recognize — even though it works fine from the CLI.

    Solution: Manually install OpenCode to the expected path.

    bash

    Download the Linux binary for your architecture from:

    https://github.com/anomalyco/opencode/releases

    cd /tmp
    curl -LO https://github.com/anomalyco/opencode/releases/download/v1.18.4/opencode-linux-x64.tar.gz

    Extract and install to ~/.local/bin/

    mkdir -p ~/.local/bin
    tar -xzf opencode-linux-x64.tar.gz
    mv opencode ~/.local/bin/
    chmod +x ~/.local/bin/opencode
    After placing the binary at ~/.local/bin/opencode, restart WSL (wsl --shutdown) and reopen the Desktop app. The version check should now pass.

    This worked for me — hope it helps!

  2. joshua-lehmann commented on Jul 23, 2026

    @joshua-lehmann
    Author

    @qinyinglun @Hona
    Thanks for the suggestion. I followed the steps and verified the setup directly from PowerShell.

    Ubuntu is installed as WSL 2:

    NAME      STATE      VERSION
    Ubuntu    Stopped    2
    

    OpenCode is installed inside Ubuntu and works correctly from a login shell:

    User: lejo
    Shell: /bin/bash
    OpenCode path: /usr/local/bin/opencode
    Version: 1.18.4
    

    I also tested the exact WSL command mentioned in the Desktop error:

    wsl.exe --list --online

    It succeeds with exit code 0 and completes in approximately 0.65 seconds.

    Unfortunately, this did not resolve the issue. OpenCode Desktop still shows Ubuntu as OpenCode not installed, and refreshing produces:

    Error invoking remote method "wsl-servers-refresh-distros":
    Error: wsl --list --online timed out after 20000ms
    

    Since the same command completes almost instantly when run manually, this appears to be related to how OpenCode Desktop invokes WSL, rather than the WSL or OpenCode installation itself.

    Is there any additional logging I can enable, or a way to inspect the environment and command used by the Desktop process? I would appreciate further help debugging this.

  3. zjm54321 commented on Aug 23, 2026

    @zjm54321

    I reproduced the same detection failure on NixOS WSL with Desktop 1.18.21.

    opencode is installed declaratively through Home Manager and is directly available to WSL commands:

    $ command -v opencode
    /etc/profiles/per-user/ming/bin/opencode
    $ opencode --version
    1.18.18
    

    The Desktop check does not resolve opencode from the distro PATH. resolveWslOpencode() currently only accepts this fixed location:

    $HOME/.opencode/bin/opencode
    

    See packages/desktop/src/main/wsl/runtime.ts around resolveWslOpencode. The later sidecar PATH filtering retains /etc/profiles/per-user/..., and the PATH-installed executable still runs after that filtering, so PATH resolution should also support Nix/Home Manager and global npm installations without relying on shell startup files.

    This is separate from #44508, which only fixes the earlier distro execution probe.

  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions