microsoft / microsoft/vscode-remote-release

Port forwarding should support IPv6

Open
#7,029 11 comments 29 reactions 1 assignee View on GitHub

@alexr00 is already working on this.

Since Aug 10, 2022.

bug remote-explorer
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

  • VSCode Version: 1.70.0
  • Local OS Version: Microsoft Windows [Version 10.0.19043.1826]
  • Remote OS Version: Ubuntu 20.04.4 LTS
  • Remote Extension/Connection Type: Containers
  • Logs: N/A

Steps to Reproduce:

  1. clone the project & open with vscode

    git clone https://github.com/doggy8088/devcontainer-dotnet-mssql-ipv6-issue.git
    code devcontainer-dotnet-mssql-ipv6-issue
    
  2. Reopen in Container

  3. Here is the PORTS info.

    image

  4. Connect to localhost locally using sqlcmd

    sqlcmd -S localhost -U sa -P P@ssw0rd -Q "SELECT 1;"
    

    It will result:

    Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Named Pipes Provider: Could not open a connection to SQL Server [2]. .
    Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
    Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
    
  5. Connect to 127.0.0.1 locally using sqlcmd

    sqlcmd -S 127.0.0.1 -U sa -P P@ssw0rd -Q "SELECT 1;"
    

    It will run successfully.

    -----------
            1
    
    (1 rows affected)
    

I really expected I can connect to the db container using localhost. It because the PORTS shows that.

During few hours research, I realized that Windows use IPv6 by default. When VSCode use IPv4 to do the port forwarding, connect to localhost will route to ::1 and it will failed.

Two suggestions:

  1. Change the Local Address to show 127.0.01:1433 on the PORTS window.

  2. Port forwarding support IPv6.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.