0

I'm trying to run a flutter app with VScode inside of WSL (win11)

Here's how I setup my vscode and WSL

  • Installed dart and flutter plugins for VSCode (installed inside WSL)
  • Installed dart and flutter SDK inside of wsl using terminal
  • Added the flutter bin folder to PATH

The error happens when pressing the run/debug button built into the IDE.

Here is the full error;

Downloading linux-x64/linux-x64-flutter-gtk tools...
Downloading linux-x64-profile/linux-x64-flutter-gtk tools...
Downloading linux-x64-release/linux-x64-flutter-gtk tools...
Launching lib/main.dart on Linux in debug mode...
lib/main.dart:1
(flutter_application_1:373): Gtk-WARNING **: 23:32:28.406: cannot open display:
Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
Error launching application on Linux.
Exited (sigterm)

Is there any suggested fix for the following?

Kaigo
  • 1,267
  • 2
  • 14
  • 33
  • 2
    You don't mention your Windows version, but it sounds like it is Windows 10. WSL on Windows 10 does not support graphical applications. See [WSL 2: Run Graphical Linux Desktop Applications from Windows 10 Bash Shell "Error E233: cannot open display"](https://stackoverflow.com/questions/61860208/wsl-2-run-graphical-linux-desktop-applications-from-windows-10-bash-shell-erro) for more info, but realize that the question was closed as off-topic for Stack Overflow and may not have the most recent answers. – NotTheDr01ds Jul 15 '22 at 23:27
  • Some on-topic discussions you can follow (in case there is new information since the SO question was closed) are [How to run GUI apps with Windows Subsystem for Linux](https://superuser.com/q/1580610/1210833) on Super User and [What's the easiest way to run GUI apps on Windows Subsystem for Linux?](https://askubuntu.com/q/993225/1165986) on Ask Ubuntu. – NotTheDr01ds Jul 15 '22 at 23:27

0 Answers0