
#Timemachine scheduler windows#
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 WSL 1 has better performance across file systems, which our use case might benefit from.As a workaround, the amount of memory available to the VM can be limited, as described in the Advanced Configuration WSL 2 consumes massive amounts of RAM and doesn’t return it.
#Timemachine scheduler full#
While WSL 2 offers better compatibility by means of full Linux kernel running in VM (see ), there are some issue which may make WSL 1 a better choice for our purposes, at least for now: In this article, we’ll document the steps to create a compatible Time Machine target via AFP using netatalk running under Ubuntu in WSL 2 or WSL 1 Selecting WSL version Time Machine on macOS does not like windows hosts as targets, likely due to noncompliance to Time Machine over SMB Specification. Connecting from macOS and configuring Time Machine.
