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.
Additionally 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.Please refer to this for more information on this.