Skip to content

VS Code won't open in Windows Bash #1233

Closed

Description

Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!

  • A brief description
    I was able to install the VS Code deb version. I got Xserve running in Windows 10, but unfortunately is giving an error when executing "code":
    /usr/share/code/bin/../code: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
  • Expected results
    To be able to open VS Code in Windows Bash in Xwindows.
  • Actual results (with terminal output if applicable)

maxt@MTrinidadLT2:/mnt/c/Users/mtrinidad/Downloads$ sudo dpkg -i code_1.6.1-1476373175_amd64.deb
[sudo] password for maxt:
(Reading database ... 46508 files and directories currently installed.)
Preparing to unpack code_1.6.1-1476373175_amd64.deb ...
Unpacking code (1.6.1-1476373175) over (1.6.1-1476373175) ...
Setting up code (1.6.1-1476373175) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
maxt@MTrinidadLT2:/mnt/c/Users/mtrinidad/Downloads$ code
/usr/share/code/bin/../code: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
maxt@MTrinidadLT2:/mnt/c/Users/mtrinidad/Downloads$

  • Your Windows build number
    Windows 10 Pro Insider Preview - Build 14946
  • Steps / All commands required to reproduce the error from a brand new installation
    VS Code installation went without any errors:
    maxt@MTrinidadLT2:/mnt/c/Users/mtrinidad/Downloads$ sudo dpkg -i code_1.6.1-1476373175_amd64.deb
    [sudo] password for maxt:
    (Reading database ... 46508 files and directories currently installed.)
    Preparing to unpack code_1.6.1-1476373175_amd64.deb ...
    Unpacking code (1.6.1-1476373175) over (1.6.1-1476373175) ...
    Setting up code (1.6.1-1476373175) ...
    Processing triggers for mime-support (3.54ubuntu1.1) ...
  • Strace of the failing command
    N/A
  • Required packages and commands to install
    N/A

winbashcodeerr_2016-10-20_11-21-45

See our contributing instructions for assistance.

Activity

  1. fpqc commented on Oct 20, 2016

    @fpqc

    I haven't tried vcXsrv for vscode, but you will need at least that, and to export DISPLAY=:0

  2. qazwsxedcrfvtg14 commented on Oct 20, 2016

    @qazwsxedcrfvtg14

    In Build 14951
    You can try to add
    alias code=""/mnt/c/Program Files (x86)/Microsoft VS Code/Code.exe""
    in ~/.bashrc
    (You need to install VS Code in windows first.)
    Then you can type "code FILENAME" to open file.
    (but this only work fine in windows directory(/mnt/c/, /mnt/d/) )

  3. MaximoTrinidad commented on Oct 20, 2016

    @MaximoTrinidad
    Author

    I'm way ahead! I've been using vcXsrv for a while.

    As I mention before, vs code is loaded. I'm just still getting the same error message when its trying to load:

    "/usr/share/code/code: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory"

    And, I don't want to run it from Windows Program files as is already loaded under the Linux subsystem.

    See images Windows 10, BASH, and vcXsrv as I created some Linux batch to run some Linux apps.
    It's so close for VS Code work!

    winbashcodeerr2_2016-10-20_11-21-45

    winbashcodeerr3_2016-10-20_11-21-45

  4. MaximoTrinidad commented on Oct 20, 2016

    @MaximoTrinidad
    Author

    Hum! As I posted the previous code, I realized the code for VS Code, I found the "standard install location". It has to be something in BASH because this VS Code work in Linux perfect.

    vscode_code_2016-10-20_13-35-38

  5. therealkenc commented on Oct 21, 2016

    @therealkenc

    "It's so close for VSCode to work". Electron apps are based on a large body of software not currently supported by WSL. See #648.

    Weird you don't have libXss though, given that you've made it this far. That's the Screen Saver extension library, which should have come along for the ride with your other X11 stuff. You can install it with sudo apt-get install libxss1, but that isn't going to help your cause much. Sublime Text works well, for what it's worth.

  6. MaximoTrinidad commented on Oct 21, 2016

    @MaximoTrinidad
    Author

    Awesome!

    Now the error message changes to:
    maxt@MTrinidadLT2:/mnt/c/Windows/System32$ code
    /usr/share/code/bin/../code: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory

    :)

  7. fpqc commented on Oct 21, 2016

    @fpqc

    Sounds like the next thing you need is gtk?

  8. therealkenc commented on Oct 21, 2016

    @therealkenc

    Do sudo apt-get install ubuntu-desktop so at least you have the bits and pieces needed to run graphic apps, including firefox. All of which is unsupported by WSL at the moment, but like the man said if it works you can go and have fun. ;)

  9. MaximoTrinidad commented on Oct 21, 2016

    @MaximoTrinidad
    Author

    therealkenc

    Found it missing library: http://stackoverflow.com/questions/37624225/shared-libraries-libgconf-2-so-4-is-missing

    So I ran:
    sudo apt-get install Gconf2

    Now, when executing "code". No errors but is not showing on the screen.
    But, I'm use the cmd "top" to list all services running and it showing three "code" running.

    I'm almost there!

    Any ideas are Welcome!!

    bash_code_2016-10-21_9-57-01

  10. therealkenc commented on Oct 21, 2016

    @therealkenc

    From here mostly my idea would be to recompile libchromiumcontent and figure out why glibc's pthread implementation is setting FUTEX_CMP_REQUEUE_PRIVATE on futex() even though no special flags seem to be set anywhere in the source. That's where I got last time I looked, anyway.

  11. MaximoTrinidad commented on Oct 21, 2016

    @MaximoTrinidad
    Author

    After installing xubuntu-desktop, and running the "code" from "nautilus" I can see a message pop out:

    Home directory not accessible: Permission denied
    Assertion 'pthread_mutex_unlock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:108, function pa_mutex_unlock(). Aborting.
    libGL error: failed to load driver: swrast
    [75:1021/104943:FATAL:thread_helpers.cc(44)] Check failed: 3UL <= task_stat.st_nlink (3 vs. 1)
    #0 0x000001e0962e
    #1 0x000001e1f23b
    #2 0x000001261765
    #3 0x00000258737f
    #4 0x000002586d16
    #5 0x0000012711f8
    #6 0x000001270672
    #7 0x000001203e97
    #8 0x000001202970
    #9 0x0000033a9313 main
    #10 0x7fa3b30e1f45 __libc_start_main
    #11 0x000000574d79

    bash_code2_2016-10-21_9-57-01

  12. therealkenc commented on Oct 21, 2016

    @therealkenc

    Yes that's (3) in the list here. You might want to take the rest of this over to that thread.

  13. MaximoTrinidad commented on Oct 21, 2016

    @MaximoTrinidad
    Author

    Ah! I'm guessing I'm running into a dead-end route. I'm finally getting a grip on Linux but I reach my limit now. Only I could make the code to come up. :P

    I'm will follow the other thread then.

    Thanks therealkenc!

  14. benhillis commented on Oct 21, 2016

    @benhillis
    Member

    Maximo Trinidad (@MaximoTrinidad) Shameless plug for running the Windows version of VSCode with our new interop feature :)

  15. MaximoTrinidad commented on Oct 21, 2016

    @MaximoTrinidad
    Author

    Just to be clear! I know I can run Windows VS Code and point to the Linux subsystem folder where my scripts are stored. I just wanted to be able to install the debian version of Code and run it separate from the Windows version. Just for demo purpose!

    I think it would be nice if is possible.
    :)

    :)

  16. 10 remaining items

  17. MaximoTrinidad commented on Mar 13, 2017

    @MaximoTrinidad
    Author

    Ah! It still doesn't work.
    :(

    So, the only work around is to create your script files (Python, PowerShell...) using your Windows Editors apps and then run the code on either your WSL Bash console or, if you have it installed, on your Ubuntu Desktop.

    I know it will be just a matter of time when this issue get fixed.

    :)

  18. felocru commented on Apr 27, 2017

    @felocru

    Something new? I have the same problem

  19. MaximoTrinidad commented on Apr 27, 2017

    @MaximoTrinidad
    Author

    I think... the reality is that WSL wasn't meant to work with the GUI Ubuntu Desktop although it possible. But trying to load the debian version of VS Code won't work (yet).

    So, my option is to build my cross-platform code using the Windows Editors then later I can execute then under WSL Bash subsystem. The only GUI editor I can run in my WSL Ubuntu Desktop is Gedit and I can run terminal and PowerShell with no issues (yet). At least for testing demo purpose, it doable now!

    Again, installing Ubuntu Desktop is not certified to run under WSL but for me is pretty functional.

    :)

  20. therealkenc commented on Nov 15, 2017

    @therealkenc

    A VSCode team member chimed in #2293 so it is probably going to be most practical to track further developments regarding VSCode native there since he's subscribed. The OP here was a missing libxss1 followed by a dupe of #1267.

  21. nityansuman commented on May 19, 2018

    @nityansuman

    I'm trying to install vs code under WSL , but even after installation is successful the editor is not running at all. Now when I execute code in the command line, it appears to just do nothing.

  22. MaximoTrinidad commented on May 19, 2018

    @MaximoTrinidad
    Author

    Kumar Nityan Suman (@nityansuman)

    But, the only way to run VS Code under WSL is to install Windows X Server in Windows 10, and in WSL install the Ubuntu Desktop.

    So, Yes! Installing the Ubuntu Desktop you can use VS Code in WSL.

    Unfortunately, the Ubuntu Desktop is not supported in Windows 10. But, I've been using it for the last few years!

    :)

    wsl_code_2018-05-19_8-38-02

  23. therealkenc commented on May 19, 2018

    @therealkenc

    it appears to just do nothing.

    code --verbose will "do something". Likely pointing out that you don't have $DISPLAY set.

  24. MaximoTrinidad commented on May 19, 2018

    @MaximoTrinidad
    Author

    therealkenc

    Yes! If you installed VS Code in WSL console, then it won't open in Windows 10. It need to the Ubuntu Desktop GUI to open VS Code Linux version.

  25. therealkenc commented on May 19, 2018

    @therealkenc

    It need to the Ubuntu Desktop GUI

    No, you don't. Which is why no one should read #637.

  26. MaximoTrinidad commented on May 19, 2018

    @MaximoTrinidad
    Author

    therealkenc

    It will be nice to know if you got a workaround. But, this got me thinking. I've been using this for about two years now.

    I got a VM with the latest Windows 10 Insider Version 10.0.17672.1000 and only WSL Ubuntu install (no GUI). I installed the latest VS Code stable edition... And ... Yes!!

    It's working without installing VSCode in WSL. You can run "Code" from the WSL console and it will open the Windows VS Code version.

    There's nothing wrong experimenting with installing GUI in WSL.

    So, if you have installed the Ubuntu GUI in WSL then you lose the ability to call the VS Code Windows app.

    And, if you still want to install the VS Code Linux version in WSL, then you need to install Ubuntu Desktop to run it.

    Interesting findings! Just pick the right environment for your work.

    :)

    Below image showing calling VS Code Windows App from the WSL console (no Ubuntu Desktop installed).
    wsl_wincode_2018-05-19_19-46-02

  27. therealkenc commented on May 20, 2018

    @therealkenc

    There's nothing wrong experimenting with installing GUI in WSL.

    Correct. There is, rather, something not right with installing the Ubuntu Desktop; which is neither necessary nor desirable to run native Linux VS Code on WSL.

    So, if you have installed the Ubuntu GUI in WSL then you lose the ability to call the VS Code Windows app.

    alias winvscode='/mnt/c/Program\ Files/Microsoft\ VS\ Code/bin/code'
    winvscode
    
  28. MaximoTrinidad commented on May 20, 2018

    @MaximoTrinidad
    Author

    therealkenc

    Awesome!! Thanks for sharing. I love learning stuff.

    Thank You!!
    :)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions