-
Notifications
You must be signed in to change notification settings - Fork 0
[WSL]
Running Tango in WSL with Anki on Windows requires extra configuration because WSL2 and Windows run in separate network namespaces.
AnkiConnect binds to 127.0.0.1:8765 by default. This means it only accepts connections from the same machine. From inside WSL2, localhost does not reach Windows services -- they are on different virtual networks.
In Anki, go to Tools -> Add-ons -> AnkiConnect -> Config. Change:
"webBindAddress": "127.0.0.1"to:
"webBindAddress": "0.0.0.0"Restart Anki after saving. This makes AnkiConnect listen on all network interfaces, including the one visible from WSL.
From inside WSL, run:
ip route | grep defaultThe IP shown (e.g. 172.28.144.1) is your Windows host as seen from WSL.
Test the connection:
curl http://172.28.144.1:8765You should see {"apiVersion": "AnkiConnect v.6"}.
ANKI_HOST=http://172.28.144.1:8765
Replace the IP with your own from step 2.
The WSL gateway IP can change when Windows restarts or WSL is reset. If Tango stops connecting to Anki after a restart, re-run ip route | grep default and update ANKI_HOST in your .env.
A permanent fix is available on Windows 11 23H2 and later using WSL mirrored networking mode, which makes localhost work transparently between WSL and Windows. Enable it by adding networkingMode=mirrored to %USERPROFILE%\.wslconfig and restarting WSL.
The auto-import prompt at the end of a pipeline run sends the .apkg file path to AnkiConnect using the Linux path format (/mnt/c/...). Windows AnkiConnect cannot read this path. Import the file manually instead: File -> Import in Anki, then navigate to the output/ folder in your project directory.