Fix for WSL vsce: Cannot autolaunch D-Bus without X11 $DISPLAY


  • Set VSCE_STORE=file environment variable.
  • OR: Use the VSCE_PAT environment variable to specify your personal access token.
  • OR: Use the -p flag to specify your personal access token.

The vsce CLI for publishing and managing VSCode extensions attempts to use system-native keychains to manage the secure storage of your Azure/Visual Studios Code personal access token. This fails in WSL as it attempts to use the Secret Service API/libsecret which apparently requires X11 or some GUI environment which is not available (unless maybe if you have WSLg installed?).

There are a 2 simple workarounds:

You can instruct vsce to use file-based storage instead of keychains by setting the environment variable VSCE_STORE=file like so:

VSCE_STORE=file vsce login

Or, you can skip vsce login entirely and instead provide your personal access token using either the VSCE_PAT environment variable or the -p, --pat flag like so:

VSCE_PAT=youraccesstoken vsce publish
vsce publish -p youraccesstoken

Mike Moore

Read more posts by this author.

Austin, TX
comments powered by Disqus