microsoft / vscode-azurevirtualmachines

Azure Virtual Machines extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurevirtualmachines
MIT License
32 stars 20 forks source link

[Unstable] Pop up an error when connecting a VM which is created in Azure VM Extension from Remote Explorer #65

Open v-dantch opened 4 years ago

v-dantch commented 4 years ago

OS: Windows Build Version: 20200226.22

Repro Steps:

  1. Make sure the Remote - SSH Extension has been installed.
  2. Select "Create Virtual Machine..." from Azure VM Extension --> Type the VM name and region.
  3. Make sure the VM has been created -->Navigate to the Remote Explorer --> Refresh the Remote Explorer --> Right click the new host --> Select "Connect to Host in New Window".

Expect: Succeed to connect the host.

Actual: [Unstable] Fail to connect the host with error "The process tried to write to a nonexistent pipe". image

nturinski commented 4 years ago

Hi @v-dantch,

Thanks for your work as usual. Is this the same issue that we resolved last night before I left the office?

In any case, I think that this is probably being caused by deleting and reusing VM names. The .ssh config isn't cleared when you delete a VM, so the entry becomes stale. There should be a warning indicating that the Host or HostName already exists.

v-ruizh commented 4 years ago

This bug also can be reproduced on the new build 20200414.1. We test this scenario using different regions, but changing the regions can't fix this issue.

v-mengwe commented 4 years ago

This issue also reproduce on the latest build 20200629.1.

v-mengwe commented 4 years ago

Verified on the latest build 20200819.1, this issue still reproduces for now. I will continue to track this issue.

nturinski commented 3 years ago

@v-mengwe Could you check your network security group policies? It's possible that your account automatically denies outgoing ports.

image

You can see on this screenshot that the priority of the deny rule is higher than the SSH rule, which was preventing me from connecting to the VM.

v-mengwe commented 3 years ago

@nturinski I checked the vm's network security group policies, the "Action" is indeed "Deny", and I manually changed the status "Deny" to "Allow", which can fix this issue. image But we can connect to the same vm without changing the above "Action" on the Mac OS. We are confused the different behaviors on Windows and Mac. Could you help to clarify this?