Jenkins can't access mounted driver

jenkins, nfs, windows

Solution

A couple solutions:

- You need to run your Jenkins process in the same user context that you mounted the drive in. This works, but isn't always the desired solution.

- Run the job on a Jenkins slave that is started in the context of the user with the mounted drive. Not always possible if slave machines aren't available.

- Use the Publish Over CIFS plugin

Problem

My Jenkins server is running in Tomcat on Windows 2008 server. I have set up a NFS server on CentOS, Win2008 server can access the NFS shared folder via mount command. I tested it when running as administrator user on Windows. I mount the folder as Z driver on Windows 2008 server. But my job in Jenkins said it can't find the Z driver, I guess Jenkins web app might have not the enough permission to access Z driver. Please see the error message from Jenkins Console output: ``` Started by user anonymous Building in workspace C:\.jenkins\workspace\upland-install [upland-install] $ cmd /c call "C:\Program Files\Apache Software Foundation\Tomcat 6.0\temp\hudson4487584210513580576.bat" C:\.jenkins\workspace\upland-install>rd d:\tmp\upland_dist /s /q C:\.jenkins\workspace\upland-install>xcopy Z:\upland_release\364 d:\tmp /S **Invalid drive specification** 0 File(s) copied ``` How to fix this problem? Install Jenkins as a windows service?

Original source