Skip to content

Support launching VS Code from Bash on Ubuntu on Windows #13138

Closed

Description

  • VSCode Version: Unpacked and installed "code_1.5.3-1474533365_amd64.deb"
  • OS Version: Windows 10 with WSL, latest patched.

Steps to Reproduce:
(NOTE: I am running Xming on my Windows 10 host, and have "export DISPLAY=:0" set in my .bashrc file)

  1. Open Bash on Ubuntu on Windows
  2. Type "code" and press ENTER.

Expected result:
Code launches in a GUI window.

Actual result:
Absolutely nothing happens. There is no output. The prompt just returns in a couple of seconds.

Activity

  1. changed the title [-]In WSL, does not launch, no error message[/-] [+]VS Code does not launch or give error when running via Bash on Ubuntu on Windows[/+] on Oct 3, 2016
  2. added
    help wantedIssues identified as good community contribution opportunities
    feature-requestRequest for new features or functionality
    windowsVS Code on Windows issues
    on Oct 3, 2016
  3. Tyriar commented on Oct 3, 2016

    @Tyriar
    Contributor

    We don't support this at the moment.

  4. sujaysarma commented on Oct 4, 2016

    @sujaysarma
    Author

    In that case, would be good if some message was output to the console window rather than silence.

  5. Tyriar commented on Oct 4, 2016

    @Tyriar
    Contributor

    Sujay Sarma (@sujaysarma) code --verbose should give you some info

  6. sujaysarma commented on Oct 5, 2016

    @sujaysarma
    Author

    Have you tried --verbose? This is what I see (see attachment)... Tell me how this is supposed to let someone know that it is "not supported"? What would be meaningful is a message like "Code is not supported to run on your OS/platform/configuration".
    capture

  7. Tyriar commented on Oct 5, 2016

    @Tyriar
    Contributor

    Sujay Sarma (@sujaysarma) vscode has a relatively small team compared to the size of the product, we simply do not have the people to cover every single edge case. I looked briefly at support for Bash on Ubuntu in the past and came to the conclusion that it is not worth the effort right now while it's so new.

    The output from --verbose gives you some information about why it is not starting as I said, you can look into it here if you're interested.

  8. changed the title [-]VS Code does not launch or give error when running via Bash on Ubuntu on Windows[/-] [+]Support launching VS Code from Bash on Ubuntu on Windows[/+] on Oct 5, 2016
  9. MathiasMagnus commented on Oct 23, 2016

    @MathiasMagnus

    +1

  10. jonomacd commented on Jan 6, 2017

    @jonomacd

    +1E99

    Support for this such that vscode uses the bash terminal for everything would be great. I don't want to see, touch or smell the windows terminal. Every shell out directed to bash for windows please.

  11. csholmq commented on Jan 10, 2017

    @csholmq

    Jono MacDougall (@jonomacd) You can use the integrated terminal with bash using "terminal.integrated.shell.windows": "C:/Windows/sysnative/bash.exe"

  12. Tyriar commented on Jan 10, 2017

    @Tyriar
    Contributor

    Sebastian Holmqvist (@csholmq) this one's about launching vscode from a bash in Windows shell, which actually works last time I checked, it just needs some refinement (an empty cli.js file was opening).

  13. MathiasMagnus commented on Jan 10, 2017

    @MathiasMagnus

    Daniel Imms (@Tyriar) How did it work?

  14. 168 remaining items

  15. jaakkouu commented on Nov 3, 2018

    @jaakkouu

    I had trouble getting this all working. Running code -verbose gave me error:

    Assertion 'pthread_mutex_unlock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:108, function pa_mutex_unlock(). Aborted.

    Then I ran sudo apt purge libpulse0 to remove the failing package.

    After that I tried again Code .

    Bob's your uncle.

  16. therealkenc commented on Nov 3, 2018

    @therealkenc

    Running code -verbose gave me error:
    Assertion 'pthread_mutex_unlock(&m->mutex) == 0'

    Folks may see that on Win10 1803. The error path has been addressed in 1809. Hence the # .... running on Win10 1809. Purging libpulse0 is a reasonable work-around.

  17. Jaff1 commented on Dec 10, 2018

    @Jaff1

    it works perfectly fine for me on Windows 10 Home (autoupdate enabled and up to date), with the latest ubuntu (from Windows Store):

    dave@my_laptop_name  ~
    $ uname -a
    Linux my_laptop_name  4.4.0-17134-Microsoft #137-Microsoft Thu Jun 14 18:46:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
    

    code . launches a code instance perfectly with current directory open in project pane

    for wsl interface, I am using wsltty: https://github.com/mintty/wsltty

    Maybe it helps for others to know this?

    Starts fine for me - just typing "code" in the bash shell on ubuntu (WSL): Probably supported in a later version than #13138, e.g. mine is
    OS Name: Microsoft Windows 10 Pro
    OS Version: 10.0.17134 N/A Build 17134

  18. MathiasMagnus commented on Dec 11, 2018

    @MathiasMagnus

    Jaakko Uusitalo (@jaakkouu) You do understand you cannot say goodbye to XServer, right?

  19. therealkenc commented on Dec 11, 2018

    @therealkenc

    Can confirm. Holy cow it actually works.

    Pronoun. If by it you mean WSL Windows interop, that has been available since build 14951 circa October 2016. Launching code.exe via interop was not the question asked in the OP.

    I will not be using it for this purpose

    Another one. Depends on your purpose. If your purpose it to edit text files in /mnt/c, à la notepad.exe, yes. If your purpose is software development it depends a lot on the scenario, until the work in #63155 is complete.

  20. jcklpe commented on Jan 7, 2019

    @jcklpe

    Just a follow up note on my earlier comment.

    While I got vscode installed in WSL and running graphically with vcxsrv it's kind of a hassle to have to launch vcxsrv everytime I want to use vscode to open a file from WSL bash cli. I found a solution which was to create the following alias:

    alias vscode="/mnt/c/'Program Files'/'Microsoft VS Code'/Code.exe"

    using vscode as an alternative command word keeps it from interfering with the normal code command word in the cli but also makes it easy for me to open the windows version of vscode from my bash prompt. Woo!

    This is probably pretty obvious to other devs, but like I said, I'm pretty new to development so I'm glad I figured it out! :)

  21. JoeRoddy commented on Jan 11, 2019

    @JoeRoddy

    sudo apt-get install realpath
    then restart terminal got it working for me.

  22. sbonds commented on Mar 20, 2019

    @sbonds

    I have the same issue as #35553 (marked as a duplicate of this one), which is that VS Code won't run under Linux when using a remote X server. This results in a silent failure under normal conditions or the following error under --verbose:

    [main 2019-03-20T18:17:33.461Z] windowsManager#open
    [xcb] Unknown sequence number while processing queue
    [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
    [xcb] Aborting, sorry about that.
    code: xcb_io.c:259: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
    

    A workaround is to use a VNC server running on the remote Linux host instead of an X Server running on Windows.

  23. RMacfarlane commented on May 2, 2019

    @RMacfarlane

    We just announced remote development with VS Code, check out the blog post for details https://code.visualstudio.com/blogs/2019/05/02/remote-development

  24. locked and limited conversation to collaborators on Jun 16, 2019
  25. added a commit that references this issue on Sep 6, 2026
    1e85d2a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    WSLIssue when using WSLfeature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitieson-testplanwindowsVS Code on Windows issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions