Skip to content

Open code Amd64 Linux appimage fails to launch. #6168

Closed

Description

@DevenBL

Description

./opencode-desktop-linux-amd64.AppImage 
"Wayland session detected; forcing X11 backend to avoid compositor protocol errors. Set OC_ALLOW_WAYLAND=1 to keep native Wayland."
Gtk-Message: 14:53:43.126: Failed to load module "canberra-gtk-module"
Gtk-Message: 14:53:43.127: Failed to load module "canberra-gtk-module"
error: Script not found "serve"
Image

Output from copy paste: [STDERR] error: Script not found "serve"

OpenCode version

v1.0.201

Steps to reproduce

run opencode from the terminal ./opencode-desktop-linux-amd64.AppImage

Screenshot and/or share link

Image

Operating System

Gentoo Linux

Terminal

GNOME Terminal

Activity

  1. github-actions commented on Dec 25, 2025

    @github-actions
    Contributor

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

    These issues all relate to Linux desktop/AppImage launch failures, GTK module loading, and Wayland/X11 integration problems. Given that multiple issues mention v1.0.201 as a regression point, this might be worth investigating as a version-specific regression.

    Feel free to ignore if your specific case requires unique debugging.

  2. lukelukes commented on Dec 25, 2025

    @lukelukes

    I'm getting the same serve not found error, albeit in a slightly different fashion:

    [STDERR] (eval):1: can't change option: zle
    [STDERR] (eval):1: can't change option: zle
    [STDERR] error: Script not found "serve"
    

    Running: Arch / Wayland / KDE / zsh

  3. DevenBL commented on Dec 27, 2025

    @DevenBL
    Author

    These issues all relate to Linux desktop/AppImage launch failures, GTK module loading, and Wayland/X11 integration problems. Given that multiple issues mention v1.0.201 as a regression point, this might be worth investigating as a version-specific regression.

    Feel free to ignore if your specific case requires unique debugging.

    Tested on v1.0.203 and v1.0.191 Results in the same behavior. It is not version specific.

  4. plirof commented on Dec 27, 2025

    @plirof

    This issue exists also on version 1.0.185.
    The appimage created here for version 1.0.185 : https://github.com/pkgforge-dev/opencode-AppImage-Enhanced/releases/tag/1.0.185-1%402025-12-23_1766505110 does not have this problem and runs ok.

  5. cravenceiling commented on Dec 28, 2025

    @cravenceiling
    Contributor

    I'm getting this error too, on Arch (btw). I extracted the AppImage file and ran the opencode-cli binary in squashfs-root/bin/ and it seems that it's just a bun binary not the actual opencode cli binary.

    Image
  6. plirof commented on Dec 29, 2025

    @plirof

    In the appimage I replaced /root/bin/OpenCode with the opencode that you can find in eg opencode-linux-x64-baseline_v1.0.204.tar.gz and it worked.

  7. DonKongPaPa commented on Dec 31, 2025

    @DonKongPaPa

    In the appimage I replaced /root/bin/OpenCode with the opencode that you can find in eg opencode-linux-x64-baseline_v1.0.204.tar.gz and it worked.

    I tried to port it on version 1.0.218 but was unsuccessful. What version is your AppImage?

  8. plirof commented on Dec 31, 2025

    @plirof

    I did an --appimage-extract and then recreated the appimage with the modification above. I don't know appimage version.

  9. cravenceiling commented on Jan 2, 2026

    @cravenceiling
    Contributor

    @DonKongPaPa I was able to run the desktop app in Arch Linux doing this:

    1. Download the latest version of the appimage (v1.0.223 right now)
    wget https://github.com/sst/opencode/releases/download/v1.0.223/opencode-desktop-linux-amd64.AppImage
    1. Extract the appimage
    ./opencode-desktop-linux-amd64.AppImage --appimage-extract
    1. Change the binary opencode-cli in AppDir/shared/bin with your own binary
    cd AppDir/shared/bin
    rm opencode-cli
    ln -s ~/.opencode/bin/opencode opencode-cli

    You could also download the latest binary and use it here

    wget https://github.com/sst/opencode/releases/download/v1.0.223/opencode-linux-x64.tar.gz
    1. Run inside AppDir/shared/bin
    ./OpenCode

    I wasn't able to rebuild the appimage even after replacing both opencode-cli binaries in AppDir/bin/ and AppDir/shared/bin/.

    cc @rekram1-node

  10. kmnnmk212-source commented on Jan 4, 2026

    @kmnnmk212-source
  11. NikiSkaarup commented on Jan 5, 2026

    @NikiSkaarup

    Mostly leaving this here for my future self, but in case anyone else runs into this, the solution to fix it yourself is to download

    • app image opencode-desktop-linux-amd64.AppImage
    • desktop app deb version opencode-desktop-linux-amd64.deb

    and then extract appImage

    chmod +x opencode-desktop-linux-amd64.AppImage
    
    ./opencode-desktop-linux-amd64.AppImage --appimage-extract

    now extract deb for desktop executable (ar is not a typo)

    ar -x ./opencode-desktop-linux-amd64.deb
    
    tar -xzf data.tar.gz

    copy binaries from deb to appImage

    cp ./usr/bin/OpenCode ./AppDir/bin/OpenCode
    cp ./usr/bin/OpenCode ./AppDir/shared/bin/OpenCode
    cp ./usr/bin/opencode-cli ./AppDir/bin/opencode-cli
    cp ./usr/bin/opencode-cli ./AppDir/shared/bin/opencode-cli

    repackage the appImage

    appimagetool ./AppDir

    This should result in a working appImage

  12. Brendonovich commented on Jan 6, 2026

    @Brendonovich
    Member

    As has been mentioned it appears that the AppImage's opencode-cli binary is Bun itself, rather than the CLI which is built with Bun. From what I can tell the deb and rpm packages are correct.

  13. self-assigned this
    on Jan 6, 2026
  14. lukelukes commented on Jan 6, 2026

    @lukelukes

    Yes, the ELF strip step removes the actual application code.
    From my limited research this is the offending code: https://github.com/tauri-apps/tauri/blob/feat/truly-portable-appimage/crates/tauri-bundler/src/bundle/linux/appimage/sharun.rs#L172

    Here was Opus 4.5's explanation:

    Bun's `--compile` feature creates standalone executables by:
    1. Building a standard ELF binary (the Bun runtime)
    2. **Appending** compiled JavaScript bytecode after the ELF data
    3. Adding a `---- Bun! ----` trailer signature
    
    When `strip` runs, it:
    1. Parses the ELF headers
    2. Removes debug symbols
    3. **Truncates the file** at the end of ELF sections
    4. Destroys the appended Bun bytecode
    
  15. Samueru-sama commented on Jan 9, 2026

    @Samueru-sama

    Hi, a few weeks ago I got requested to package opencode here

    The server not found error is a bigger issue related to bun, which I had to fix this way

  16. justinclift-prvidr commented on Jan 30, 2026

    @justinclift-prvidr

    The server not found error is a bigger issue related to bun, which I had to fix this way

    With that, is my reading of that correct in that you're generating kek as a way to create a random temporary file?

    If that's the case, wouldn't mktemp (ie https://www.gnu.org/software/coreutils/manual/html_node/mktemp-invocation.html) be the more standard approach for doing that bit instead? 😄

  17. Samueru-sama commented on Jan 30, 2026

    @Samueru-sama

    The server not found error is a bigger issue related to bun, which I had to fix this way

    With that, is my reading of that correct in that you're generating kek as a way to create a random temporary file?

    If that's the case, wouldn't mktemp (ie https://www.gnu.org/software/coreutils/manual/html_node/mktemp-invocation.html) be the more standard approach for doing that bit instead? 😄

    I'm not making a temp file, I'm generating 10 random characters for the name of the dynamic linker of the bun binary.

    This would not be needed if it was possible to invoke the bun binary with the dynamic linker as mentioned here

    So the second best choice is a random dynamic linker in tmp that is going to be unique for each appimage, the kek var is the random name, which at runtime it gets copied to /tmp.

  18. justinclift-prvidr commented on Jan 30, 2026

    @justinclift-prvidr

    I should have read it closer after getting a reasonable of coffee. 😉

  19. DevenBL commented on Mar 27, 2026

    @DevenBL
    Author

    I tested https://github.com/anomalyco/opencode/releases/download/v1.3.3/opencode-electron-linux-x86_64.AppImage
    it seems to work now. closing issue. Dunno when or if it was solved but it seems to have been solved.

  20. Samueru-sama commented on Mar 27, 2026

    @Samueru-sama

    They switched to electron builds which no longer need opencode-cli to run the opencode server.

    #17803

    Well that is one way of fixing it lol

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

Metadata

Metadata

Labels

bugSomething isn't workingwebRelates to opencode on web / desktop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions