Skip to content

Can't run OpenCode under WSL2 Ubuntu, returns empty screen #9963

Closed

Description

@it-sha

Description

After installing opencode under WSL, command opencode returns empty screen
Image

Expected Behavior

The OpenCode UI starts and renders normally.

Actual Behavior

Blank screen when launching.

Environment

OS: Ubuntu 20.04.6 LTS (Focal Fossa)
Kernel: Linux 6.6.87.2-microsoft-standard-WSL2
Arch: x86_64
Shell: bash (/bin/bash)
Locale: C.UTF-8
Node: v22.19.0
pnpm: 10.24.0
npm: 10.9.3
git: 2.25.1
WSL: WSL_DISTRO_NAME=Ubuntu

Plugins

No plugings

OpenCode version

1.1.31

Steps to reproduce

  1. Run WSL shell
  2. Install open code (via npm or curl)
  3. Open WSL2 Ubuntu terminal.
  4. Run opencode.

Screenshot and/or share link

Image

Operating System

OS: Ubuntu 20.04.6 LTS (Focal Fossa)

Terminal

Shell: bash (/bin/bash)

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 22, 2026
  2. github-actions commented on Jan 22, 2026

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  3. it-sha commented on Jan 22, 2026

    @it-sha
    Author

    Most recommended solution is to change DNS settings

    sudo rm /etc/resolv.conf
    sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
    

    Checked. Problem still remains

  4. it-sha commented on Jan 22, 2026

    @it-sha
    Author

    Logs

    opencode run hello --print-logs

    Details

    $ opencode run hello --print-logs
    INFO 2026-01-22T14:20:48 +263ms service=default version=1.1.31 args=["run","hello","--print-logs"] opencode
    INFO 2026-01-22T14:20:48 +1ms service=default directory=/home/max creating instance
    INFO 2026-01-22T14:20:48 +0ms service=project directory=/home/max fromDirectory
    INFO 2026-01-22T14:20:48 +6ms service=default directory=/home/max bootstrapping
    INFO 2026-01-22T14:20:48 +4ms service=config path=/home/max/.config/opencode/config.json loading
    INFO 2026-01-22T14:20:48 +1ms service=config path=/home/max/.config/opencode/opencode.json loading
    INFO 2026-01-22T14:20:48 +0ms service=config path=/home/max/.config/opencode/opencode.jsonc loading
    INFO 2026-01-22T14:20:48 +6ms service=bun cmd=["/home/max/.opencode/bin/opencode","add","@opencode-ai/plugin@1.1.31","--exact"] cwd=/home/max/.config/opencode running
    INFO 2026-01-22T14:20:48 +11ms service=config path=/home/max/.opencode/opencode.jsonc loading
    INFO 2026-01-22T14:20:48 +0ms service=config path=/home/max/.opencode/opencode.json loading
    INFO 2026-01-22T14:20:48 +1ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)

    installed @opencode-ai/plugin@1.1.31

    [2.00ms] done
    stderr=Saved lockfile
    done
    INFO 2026-01-22T14:20:48 +0ms service=bun cmd=["/home/max/.opencode/bin/opencode","install"] cwd=/home/max/.config/opencode running
    INFO 2026-01-22T14:20:48 +0ms service=bun cmd=["/home/max/.opencode/bin/opencode","add","@opencode-ai/plugin@1.1.31","--exact"] cwd=/home/max/.opencode running
    INFO 2026-01-22T14:20:48 +6ms service=plugin name=CodexAuthPlugin loading internal plugin
    INFO 2026-01-22T14:20:48 +0ms service=plugin name=CopilotAuthPlugin loading internal plugin
    INFO 2026-01-22T14:20:48 +0ms service=plugin path=opencode-anthropic-auth@0.0.9 loading plugin
    INFO 2026-01-22T14:20:48 +2ms service=bun code=0 stdout=bun install v1.3.5 (1e86cebd)

    Checked 3 installs across 4 packages (no changes) [1.00ms]
    stderr= done
    INFO 2026-01-22T14:20:48 +1ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)

    installed @opencode-ai/plugin@1.1.31

    [1.00ms] done
    stderr=Saved lockfile
    done
    INFO 2026-01-22T14:20:48 +0ms service=bun cmd=["/home/max/.opencode/bin/opencode","install"] cwd=/home/max/.opencode running
    INFO 2026-01-22T14:20:48 +15ms service=plugin path=@gitlab/opencode-gitlab-auth@1.3.2 loading plugin
    INFO 2026-01-22T14:20:48 +0ms service=bun code=0 stdout=bun install v1.3.5 (1e86cebd)

    Checked 3 installs across 4 packages (no changes) [1.00ms]
    stderr= done
    INFO 2026-01-22T14:20:48 +5ms service=bun pkg=@gitlab/opencode-gitlab-auth version=1.3.2 installing package using Bun's default registry resolution
    INFO 2026-01-22T14:20:48 +0ms service=bun cmd=["/home/max/.opencode/bin/opencode","add","--force","--exact","--cwd","/home/max/.cache/opencode","@gitlab/opencode-gitlab-auth@1.3.2"] cwd=/home/max/.cache/opencode running

  5. it-sha commented on Jan 23, 2026

    @it-sha
    Author

    opencode web --hostname 127.0.0.1 --port 4096

    also returns empty screen

    Image
  6. it-sha commented on Jan 23, 2026

    @it-sha
    Author

    @kommander Could you take a look when you have time?
    Maybe we have some FAQ for such cases?

  7. kommander commented on Jan 24, 2026

    @kommander
    Contributor

    Seems like the agent server is not coming up properly. Do you have a proxy running?

  8. it-sha commented on Jan 25, 2026

    @it-sha
    Author

    @kommander

    Seems like the agent server is not coming up properly. Do you have a proxy running?

    Just WSL on Ubuntu with out-of-the-box config, proxy is not set by intention

    OpenCode starts working in 15-20 min with empty screen
    It seems like something should be uploaded in the background without any indication to the user

    The problem is getting back if I install the Zed plugin for OpenCode
    Image

    To fix that I have to:

    1. uninstall zed plugin
    2. uninstall OpenCode and all app data
    3. install OpenCode again
    4. open it in terminal, wait 20 min
    5. restart opencode in terminal

    If you need any additional info please let me know
    a lot of developers have to use Windows, so WSL in only option for us for AI development.

  9. kommander commented on Jan 26, 2026

    @kommander
    Contributor

    I don't think it is WSL specific. We've heard about that at rare occasions, but cannot properly reproduce it. cc @rekram1-node what would help to debug this?

  10. li-yifei commented on Jan 27, 2026

    @li-yifei

    Hello there, I found that ipv6 stack in wsl2 may cause such blank screen problem.
    For my case, I disabled ipv6 once but dns returns AAAA records rather than A.
    Then I re-enabled ipv6 in 'network=Mirrored' mode and it got fixed.
    Try disabling ipv6 dns records in your env may helps.

  11. kastrophony commented on Jan 28, 2026

    @kastrophony

    I found this as well, disabling ipv6 has it working again

  12. GollyJer commented on Feb 4, 2026

    @GollyJer

    uhg... frustrating road to a fix for this one. Should have come here to search first. 🙃

    For those interested.

    [wsl2]
    networkingMode=mirrored
    dnsTunneling=true
    firewall=true
    autoProxy=true
    kernelCommandLine=ipv6.disable=1  # <-- this fixes it.
  13. kommander commented on Feb 4, 2026

    @kommander
    Contributor

    Interesting. We should probably take that into the documentation for windows. wdyt @rekram1-node

  14. tontide1 commented on Feb 5, 2026

    @tontide1

    hi ! you can try this

    [boot]
    systemd=false
    

    #5361

    i got this problem and i fixed it as above

  15. csullivannet commented on Feb 16, 2026

    @csullivannet

    I had a poorly configured opencode.json in my project that was causing this. I had removed a project local plugin, but not the opencode.json file at the root of the project that still referenced the plugin.

  16. github-actions commented on Apr 22, 2026

    @github-actions
    Contributor

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

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions