Jenkins agent installation on NFS storage (Windows)

Hi
I am using Jenkins 2.440.2 and i want ro setup jenkins agent on NFS storage (Network drive) on windows machine.
Getting below error while setup jenkins agents.

06/13/24 16:22:28] [SSH] Checking java version of D:\node_jenkins_.Net/jdk/bin/java
Couldn’t figure out the Java version of D:\node_jenkins_.Net/jdk/bin/java
The system cannot find the drive specified.

[06/13/24 16:22:28] [SSH] Checking java version of java
[06/13/24 16:22:28] [SSH] java -version returned 17.0.11.
[06/13/24 16:22:28] [SSH] Starting sftp client.
[06/13/24 16:22:28] [SSH] Remote file system root D:\node_jenkins_.Net does not exist. Will try to create it…
java.io.IOException: Could not copy remoting.jar into ‘D:\node_jenkins_.Net’ on agent
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:734)
at hudson.plugins.sshslaves.SSHLauncher.lambda$launch$0(SSHLauncher.java:463)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: Failed to mkdir D:\node_jenkins_.Net
at com.trilead.ssh2.jenkins.SFTPClient.mkdirs(SFTPClient.java:91)
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:691)
… 5 more
Caused by: com.trilead.ssh2.SFTPException: No such file (SSH_FX_NO_SUCH_FILE: A reference was made to a file which does not exist.)
at com.trilead.ssh2.SFTPv3Client.expectStatusOKMessage(SFTPv3Client.java:555)
at com.trilead.ssh2.SFTPv3Client.mkdir(SFTPv3Client.java:955)
at com.trilead.ssh2.jenkins.SFTPClient.mkdirs(SFTPClient.java:89)
… 6 more
[06/13/24 16:22:28] Launch failed - cleaning up connection
[06/13/24 16:22:28] [SSH] Connection closed.

The question is how do you attach the NFS ( guess this is not really NFS but a samba share or CIFS as windows doesn’t support the nfs protocol afaik) to your machine. If you do this interactively while you’re logged in I think this will affect only your session. But when your Jenkins agent is running as a service in windows or you connect via ssh you don’t have the context of that session.
The first error already indicates that the d-drive doesn’t exist.
I think you can use mklink to get a persistent link but afaik you can only link a directory and not a drive.

NFS File System Considerations

NFS file systems have different locking mechanisms compared to local file systems, which can cause issues with file operations. If /export/build is an NFS file system, try configuring the agent to place the remoting jar file on a local file system to see if the problem persists. This can help determine if the issue is related to the NFS file system. For more details, refer to the discussion on the Jenkins community forum: Faviconjava.io.IOException: Could not copy remoting.jar into ‘/export/build’ on agent.