search for Task Scheduler and launch it. Using Task Scheduler, create a new task to launch the script on each Windows start: If logging is not needed and therefore the contents of the script condense to a single line it can be directly scheduled in the Task Scheduler (program name wsl, arguments sudo service netatalk start). To configure firewall to access the WSL instance, we will build on the excellent script shared here: Īdditionally, it may be helpful to start the logging service as well, just to be able to troubleshoot any possible runtime issues with the netatalk in the future.Ĭreate the script somewhere accessible, like c:\Scripts\wsl_startup.ps1, with the following content: Consequently, mDNS/Bonjour won’t work to advertise AFP shares and Time Machine services, but that’s not a big deal: windows host supports mDNS, so we can connect to it directly in the finder via Command K, afp://windows-host-name.local. Unfortunately, it is not feasible to make it external without breaking everything around it, so we’ll instead create a port mapping. WSL 2 runs in a separate internal network connected to an internal Hyper-V virtual switch named WSL. Netsh advfirewall firewall add rule name = "Allow AFP connections" dir = in action =allow protocol =TCP localport =548
0 Comments
Leave a Reply. |