devspace: Could not establish connection to "my-app.devspace": Could not resolve hostname

What happened?

I was following the IDE integration example, and got the following error from Visual Studio

What did you expect to happen instead?

I expected to see the source code inside the container displayed by VSCode.

It should be noted that I am running VSCode using WSL2 on Windows. The example is running on my Ubuntu Laptop (See Issue #2420)

How can we reproduce the bug? (as minimally and precisely as possible)

On a windows machine, running WSL2, I followed the example instructions

https://www.devspace.sh/docs/ide-integration/visual-studio-code#tldr

# Clone the example project
git clone https://github.com/loft-sh/devspace-vscode-example.git

# Switch to the folder
cd devspace-vscode-example

# Open Visual Studio Code in a Container
devspace dev -n my-namespace

Local Environment:

  • DevSpace Version: [use devspace --version] devspace version 6.1.1
  • Operating System: windows
  • ARCH of the OS: AMD64 Kubernetes Cluster:
  • Cloud Provider: google azure
  • Kubernetes Version: [use kubectl version]
$ kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.4
Kustomize Version: v4.5.7
Server Version: v1.23.8
WARNING: version difference between client (1.25) and server (1.23) exceeds the supported minor version skew of +/-1

Anything else we need to know?

The following link describes what I think is root cause and a work-around.

https://zitseng.com/archives/20325/amp

Devspace generates the necessary SSH configuration to connect to the devmode container here:

  • /home/myWslUser/.devspace/ssh/id_devspace_rsa
  • /home/myWslUser/.ssh/config

Problem is that when running VSCode via WSL2 it is running on the host windows, meaning it’s SSH configuration is located here. Explaining the “could not resolve hostname” error.

  • C:\Users\myWindowsUser\.ssh

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@oconnor17 thanks for creating this issue! We will take a look and come back to you!