title: Can I develop with VS Code in containers on a remote host running Windows/WSL2?
body: <h3>Original Post</h3>
  <p>I have a Windows workstation with WSL2 and Docker installed that I am able to use for container based development in VS Code. I would like to be able to develop inside the containers on this system remotely. I am able to SSH directly into the WSL2 environment on the workstation and am able to start the docker daemon without logging directly into Windows by creating a Task to start the daemon automatically as described here: <a href="https://stackoverflow.com/a/59467740/10692741">https://stackoverflow.com/a/59467740/10692741</a></p>
  <p>However when I try to access Docker on the remote machine by following this guide: <a href="https://code.visualstudio.com/docs/remote/containers-advanced#_developing-inside-a-container-on-a-remote-docker-host" rel="nofollow noreferrer">https://code.visualstudio.com/docs/remote/containers-advanced#_developing-inside-a-container-on-a-remote-docker-host</a>, I get the following error:</p>
  <pre><code>error during connect: Get http://docker/v1.24/version: net/http: HTTP/1.x transport connection broken: malformed HTTP status code &quot;\x00c\x00o\x00m\x00m\x00a\x00n\x00d\x00&quot;
  </code></pre>
  <p>I have also tried connecting via a SSH tunnel as outlined here: <a href="https://code.visualstudio.com/docs/remote/troubleshooting#_using-an-ssh-tunnel-to-connect-to-a-remote-docker-host" rel="nofollow noreferrer">https://code.visualstudio.com/docs/remote/troubleshooting#_using-an-ssh-tunnel-to-connect-to-a-remote-docker-host</a> and am unable to connect to Docker as well.</p>
  <p>Has anyone had success with a setup like this? Or is this not supported due to limitations with Docker on Windows, WSL2, and/or Windows OpenSSH implementation?</p>
  <h3>Update: 2021-01-21</h3>
  <p>When I SSH into the Windows machine remotely, I am able to see the docker containers in the VS Code extension. I am able to start them, stop them, and enter into them with the shell. However, when I try to attach VS Code I get same error shown above.</p>
  <p>Things that may have possibly affected this over the past couple days:</p>
  <ul>
  <li>Adding SSH keys on my local machine to the ssh-agent via <code>ssh-add /my/key</code></li>
  <li><a href="https://docs.docker.com/docker-for-windows/#general" rel="nofollow noreferrer">Exposing Docker daemon on tcp://localhost:2375 without TLS</a> on the remote Windows machine</li>
  </ul>
  <p>Also I want to note that the I've tried using Windows, Mac, and Linux as the local machine. With Mac and Linux I am able to open a remote session into the Windows machine, but from the Windows local machine I am able to SSH into the remote Windows machine but cannot open a remote connection in VS Code for some reason.</p>