This error typically indicates an issue with the SSH handshake and also this could happen if the SSH server on the VM is blocked or misconfigured and also I would recommend you to reset the daemon with: service sshd restart and also try to restart the VS code and check if it is working.Also could you please confirm whether you have checked this link?