balena scan on WSL returns no results

When I run balena scan on my Windows terminal (with admin privileges) it correctly finds my device.

When I run sudo balena scan on WSL on the same machine it returns no results.

Do you know what I need to do to get balena scan to work from WSL?

(Other balena-cli commands seem to work fine on WSL so it appears to be specific to the scan command)

Hey Graham

  • What version of WSL are you using? Is it WSL2?
  • There are some differences between WSL and WSL2. I remember discussing this with a colleague, where WSL2 has higher network permissions essentially. This is because of the way the network interfaces work. There is a slightly related issue in the nmap github issues -
    nmap is quite similar, in that it also scans for devices on the same network, and their open ports, etc. I am thinking this is going to be a similar situation to this issue.
  • I think it’ll be a good idea to open an issue on balena-cli about documenting the different behaviors based on how you install it on Windows (WSL, WSL2, native Windows, VM). Once we figure out the setup on your end, I’ll create an issue here -

@anujdeshpande I’m using WSL2.

Hey Graham

Can you try sudo /home/<username>/.npm-global/bin/balena scan in your WSL2?

@anujdeshpande I didn’t install balena via NPM so that’s not where my balena-cli install is. I ran the command using the full path to the balena executable though (sudo -i /home/<username>/bin/balena-cli/balena scan ) and it gave the same result (no balenaOS devices found)