Unable to connect to WSL on Windows 10 1903 build

Sysprogs forums Forums VisualGDB Unable to connect to WSL on Windows 10 1903 build

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #25103
    winest
    Participant

    Steps to reproduce:

    1. In ViusalStudio 2019 startup wizard, create a Linux project
    2. Select “Import a project”, and thenselect “Import a CMake project”, click Next
    3. Select “Use the Windows 10 Linux Subsystem”, click Next
    4. An error message displayed at first step, “Toolchain test failed: Failed to build Linux subsystem Launcher. Please check that the Linux subsystem is installed and contains gcc.”

    Only one Linux Subsystem OS is installed, the registry value in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss is correct and I can use ssh to connect to my WSL.

    Visual Studio Version: Visual Studio Enterprise 2019 16.1.2

    Windows Version: Windows 10 1903(18362.116)

    Linux Subsystem OS: Ubuntu 18.04 downloaded from Windows Store

    VisualGDB version: 5.4.106.3190
    —————— System.Exception ——————
    System.Exception: Failed to build Linux subsystem launcher. Please check that the Linux subsystem is installed and contains gcc.
    at aj.l.c1()
    at aj.l.n(CommandLineAction a, CommandFlags b, Boolean c)
    at aj.l..ctor(CommandLineAction c, CommandFlags b, qh a, Boolean d)
    at aj.r_4(qh b, String f, String e, String d, ExpandedEnvironment c, CommandFlags a)
    at y52.g1(Int32& e, String d, String c, String g, ModifiedEnvirionment b, Int32 i, Boolean a, CommandFlags h, h91 f)
    at y52.g(String b, String e, String c, ModifiedEnvirionment f, Int32 d, Boolean a)
    at zx.a(s32 a)
    at VisualGDB.Common_GUI.WPF.ItemizedProgressWindow.<>c__DisplayClass2_2`1.<RunAction>b__0()

    #25104
    support
    Keymaster

    Hi,

    As the message suggests, please double-check that your WSL installation has gcc installed. You can check it by running “gcc -v” from the bash prompt.

    #25107
    winest
    Participant

    Of course I have already installed all development tools and is able to build my c++ projects by using ssh.

     

    Output of “gcc -v”:

    Using built-in specs.COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v –with-pkgversion=’Ubuntu 5.5.0-12ubuntu1′ –with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs –enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ –prefix=/usr –program-suffix=-5 –enable-shared –enable-linker-build-id –libexecdir=/usr/lib –without-included-gettext –enable-threads=posix –libdir=/usr/lib –enable-nls –with-sysroot=/ –enable-clocale=gnu –enable-libstdcxx-debug –enable-libstdcxx-time=yes –with-default-libstdcxx-abi=new –enable-gnu-unique-object –disable-vtable-verify –enable-libmpx –enable-plugin –enable-default-pie –with-system-zlib –enable-objc-gc –enable-multiarch –disable-werror –with-arch-32=i686 –with-abi=m64 –with-multilib-list=m32,m64,mx32 –enable-multilib –with-tune=generic –enable-checking=release –build=x86_64-linux-gnu –host=x86_64-linux-gnu –target=x86_64-linux-gnu
    Thread model: posix
    gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1)

    #25121
    support
    Keymaster

    Thanks for confirming this. We have just retested VisualGDB with WSL on Windows 10 build 1903, however we could not reproduce the issue you described.

    Please try running this build: VisualGDB-5.4.106.3193.msi

    Then enable the VisualGDB Diagnostics Console, reproduce the problem and check the diagnostic output for the command line used by build the app launcher (search for LinuxAppLauncher.c). Then try running the command line manually and see if GCC reports any errors. Once you pinpoint a specific error, please let us know and we will try to add a workaround for this.

    #25122
    winest
    Participant

    Hi, I guess I know the problem. The root cause is VisualGDB assume Windows drives are mounted at default path (/mnt/c/VisualGDB, for example) while some people like me will change mounting path to other places(/c/VisualGDB, for example) based on the suggestion from https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/

    Hope VisualGDB can implement the fix which read the setting from /etc/wsl.conf

    BTW, another error was output saying that “Loading machine index from C:\Users\winest\.vagrant.d\data\machine-index\index…
    failed to load vagrant VM list: Could not find a part of the path “.

    I don’t know whether it will affect anything or it’s just a warning.

    Thanks

     

     

    Key error:

    C:\Users\winest>C:\WINDOWS\system32\bash.exe -c “gcc -std=gnu99 \”/mnt/e/VisualGDB/TargetTools/LinuxAppLauncher.c\” -o /tmp/LinuxAppLauncher-v2 -lutil”
    gcc: error: /mnt/e/VisualGDB/TargetTools/LinuxAppLauncher.c: No such file or directory
    at VisualGDB.Common_GUI.WPF.ItemizedProgressWindow.<>c__DisplayClass2_2`1.<RunAction>b__0()

     

    Full log:

    Initializing assemblies: 14 msec
    Registering factories: 117 msec
    Initializing VisualGDB 5.4.106.3193
    Checking fonts/colors: 73 msec
    Level 2 initialization: 732 msec
    Loading machine index from C:\Users\winest\.vagrant.d\data\machine-index\index…
    failed to load vagrant VM list: Could not find a part of the path ‘C:\Users\winest\.vagrant.d\data\machine-index\index’.
    —————— System.IO.DirectoryNotFoundException ——————
    System.IO.DirectoryNotFoundException: Could not find a part of the path ‘C:\Users\winest\.vagrant.d\data\machine-index\index’.
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
    at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
    at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
    at System.IO.File.ReadAllText(String path)
    at hy1.e()
    at hy1.m()
    Loading Linux toolchain list for winest@localhost:50022 (SSH)
    Creating toolchain controller: initial selection (registry)
    SelectToolchainByKey(com.sysprogs.toolchain.default-gcc )
    Loading Linux toolchain list for (Windows 10 Linux subsystem)
    Creating toolchain controller: initial selection (registry)
    SelectToolchainByKey(com.sysprogs.toolchain.default-gcc )
    Committing LinuxTargetPage…
    Testing project settings…
    Running toolchain tester…
    C:\WINDOWS\system32\bash.exe -c “gcc -std=gnu99 \”/mnt/e/VisualGDB/TargetTools/LinuxAppLauncher.c\” -o /tmp/LinuxAppLauncher-v2 -lutil”
    Unexpected exception: Failed to build Linux subsystem launcher. Please check that the Linux subsystem is installed and contains gcc.
    —————— System.Exception ——————
    System.Exception: Failed to build Linux subsystem launcher. Please check that the Linux subsystem is installed and contains gcc.
    at wr.q.i1()
    at wr.q.n(CommandLineAction b, CommandFlags c, Boolean a)
    at wr.q..ctor(CommandLineAction d, CommandFlags b, y42 a, Boolean c)
    at wr.g_2(y42 f, String e, String c, String a, ExpandedEnvironment b, CommandFlags d)
    at hi2.m2(Int32& a, String b, String h, String c, ModifiedEnvirionment e, Int32 g, Boolean i, CommandFlags d, co2 f)
    at hi2.k2(String b, String e, String f, ModifiedEnvirionment a, Int32 d, Boolean c)
    at va2.r(du a)

     

     

    #25126
    support
    Keymaster

    Good to know you found the root cause.

    As the issue is triggered by a relatively rare setting, we would only be able to support it if there is an easy way to extract the path mappings from the WSL configuration file and if it’s requested by a user with an active support period (sorry, we could not find any orders associated with your email).

    The vagrant warning in the diagnostics console can be safely ignored – it comes from VisualGDB trying to locate virtual machines managed by the Vagrant tool and will indeed appear if you don’t have the tool installed.

    #25127
    winest
    Participant

    Hi, it’s a very simple ini file. So you can extract config by the following command:

    C:\Windows\System32\bash.exe -c “awk -F = ‘/^root/ {gsub(/^[ \t]/, \”\”, \$2); print \$2}’ /etc/wsl.conf”

     

    Thanks

    #25129
    support
    Keymaster

    Thanks for the update. It looks like we should be able to support it once requested by a user with an active technical support.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.