Skip to content

Little workaround to run in Windows (11/10) using WSL2 (no building required) #352

@mf

Description

@mf

Since there is no build yet - WSL2 can natively run AppImage apps with minimal prereqs.

This was done using Ubuntu 24.04. Use latest WSL (wsl .exe--update)
Single prereq is libgles2: (apt install libgles2)

Attached below is installation helper bash script, just download the AppImage release and execute as parameter (I keep everything under my non-privileged user)

TLDR: Force AppImage contents to self-extract, move everything from squashfs-root folder into your new app folder, get in there and execute AppImage (or create launcher.sh helper installer that will take care of everything for you)

Image
#!/usr/bin/env bash
#
# installAppImageWSL2.sh
#
# Usage: ./installAppImageWSL2.sh /full/path/to/AppImageFile
#
set -e

if [ $# -ne 1 ]; then
    echo "Usage: $0 /full/path/to/AppImageFile"
    exit 1
fi

APPIMAGE="$1"

# Check if appimage exists
if [ ! -f "$APPIMAGE" ]; then
    echo "Error: file not found: $APPIMAGE"
    exit 1
fi

APPIMAGE_OPT=$(basename -- "$APPIMAGE")
APPIMAGE_DIR=~/.local/bin/"$APPIMAGE_OPT"
# Create standard per-user directories if not already there
mkdir -p $APPIMAGE_DIR
mv "$APPIMAGE" "$APPIMAGE_DIR" && chmod a+x "$APPIMAGE_DIR/$APPIMAGE_OPT"
"$APPIMAGE_DIR/$APPIMAGE_OPT" --appimage-extract

mv squashfs-root/* "$APPIMAGE_DIR/"
rm -rf squashfs-root

# Create launcher
TARGET="$APPIMAGE_DIR/AppRun"

# Create a wrapper that resolves the real path and runs from there
cat > "$HOME/.local/bin/opcode" <<'WRAP'
#!/usr/bin/env bash
set -euo pipefail
TARGET="__TARGET__"
DIR="$(dirname "$(readlink -f "$TARGET")")"
cd "$DIR"
exec "$TARGET" "$@"
WRAP

# Inject your real target path and make executable
sed -i "s|__TARGET__|$TARGET|g" "$HOME/.local/bin/opcode"
chmod +x "$HOME/.local/bin/opcode"

# Check PATH
if ! echo "$PATH" | grep -q "$HOME/.local/bin"; then
    echo ""
    echo "⚠️  Reminder: add this line to your ~/.bashrc or ~/.zshrc:"
    echo "    export PATH=\"\$HOME/.local/bin:\$PATH\""
fi
echo "✅ Installation complete."

Metadata

Metadata

Assignees

No one assigned

    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