0

Not really a question but already the answer. Just to save others from spending days on this task.

What I want to do
I want to extend the basic NextCloudPi image with some custom websites including PHP. For ease use of remote debugging I am using VSCode and Xdebug.

The Problem was
I can't get a SSH connection to my raspi from VSCode and therefore also PHP debugging didn't work. SSH connection to the raspi worked well with other tools (putty, PowerShell etc.). Also Xdebug was set properly on the raspi (according to phpinfo();). In the log of the ssh-plugin of VSCode the following error appeared:

Failed to set up socket for dynamic port forward to remote port 37399: Socket closed. Is the remote port correct?

Relevant Versions
NextCloudPi 1.36.3
Xdebug 3.0.4
VSCode 1.60.2 (RemoteSSH 0.65.8, PhpDebug 1.19.0)

Gauss3k
  • 141
  • 3
  • If it's a self-answered question ... then please post your answer as an actual Answer (a big text field below) – LazyOne Sep 29 '21 at 08:54

1 Answers1

0

The Solution is
After spending evenings of googling I found out that the TCP port forwarding of the raspi's SSH service has to be enabled which is not in the basic nextcloudpi-image. This thread gave me the final clue: VSCode Remote SSH Connection Failed

So just set in /etc/ssh/sshd_config AllowTcpForwarding to yes and everything should work as easy as described in all the manuals.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Gauss3k
  • 141
  • 3