Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 7 - no network - What do I need to locally fake UNC path for development/testing?

Situation: I'm on a stand-alone development computer running Windows 7. Not connected to any Windows Server. Would like to test a Window application's ability to use UNC paths. Will be transferred later to a Linux server (not at my location), hence the desire to use a cross-platform path mechanism (UNC) (//servername/sharename), rather than a Window's mapped drive (X:\foldername).

The application is Autodesk Maya 2014. A project's main file contains many references to other files. These file references can be relative paths ("subfolder/filename.ext"), absolute paths ("H:/projects/this_project/subfolder/filename.ext"), or UNC paths ("//servername/projects/.." or "servername/assets/.."). The app permits forward slashes, and maps those to the correct character on different OSes. Wherever possible, I use relative paths.

But I have a situation where a plug-in is not correctly working with relative paths, so I have resorted to using some absolute paths. It has been requested that I change these from the current mapped drive form, to UNC paths. REASON: the data will be transferred to a render farm, running Linux. A Linux version of the app will be used. (So my question isn't about accessing Linux files from my Windows box; it is about setting up all the data so that when everything is moved to the render farm, it will still run.)

Due to the combination of plug-ins and features we are using in Maya, I am not 100% certain I can convert all paths to relative form. (Questions there for Maya forums.) So as a fallback, I need to test with UNC paths. Am asking what it would take to set this up on my Windows 7 PC, without actually connecting to a server computer. (Don't have Linux nor Windows Server set-up at my location.)

I don't normally do network-related programming, nor server programming, so the various possible solutions are not familiar to me.

Googling suggests some basic techniques, that may or may not be relevant. Before I spend more time on this, want to know if I am going in the correct/easiest direction.

  1. installing a local DNS server and editing its hosts file. Such as:

    http://sourceforge.net/projects/acrylic/

    http://sourceforge.net/projects/dhcp-dns-server/

    .. but I don't have a domain name, I just have a (future) network computer name, so this is not relevant?

  2. Editing LMHOSTS file

    .. but this is just for mapping between a name and an IP address?

  3. multiple NetBIOS names (OptionalNames)

    Mentioned here: http://www.mediamonkey.com/forum/viewtopic.php?t=51722&f=1

    Which refers to: https://serverfault.com/questions/23823/how-to-configure-windows-machine-to-allow-file-sharing-with-dns-alias

    .. But that is talking about DNS, so is that relevant?

What I have succeeded in doing so far: In Command Prompt (Run as Administrator):

net view \\localhost

or

net view \\mycomputernamehere

Lists shared folders on my PC. E.g. H:\temp Properties / Sharing, shared as "HTemp", which is listed.

So I think all I need to do is:

A. Share any folder with the desired name, e.g. "projects". It will then be visible as "\\localhost\projects".

B. Convince Windows to use my local computer when I ask for "\\servername". I can then use "//servername/projects" in the app, which will ask Windows for "\\servername\projects", which then would be converted by Windows to "\\mycomputernamehere\projects".

... this (B) is the part I need help with. (3) above sounds like it is a solution. But to me it is rather arcane (editing the registry). Will it accomplish what I need? Is there an easy solution that doesn't involve registry editing?


And yes, somewhere along the way it dawned on me that the simplest solution is to rename my computer to "servername". I'll probably do that for this week.

But I'd still like to learn a way to alias my computer name, to fake a UNC path without actually renaming my computer. And without relying on a second computer acting as server.

like image 776
ToolmakerSteve Avatar asked Mar 21 '14 00:03

ToolmakerSteve


People also ask

How do I fix UNC path is not supported?

If you open a file with such a path, the program will crash when you try to import a glazing system. You can solve this problem by mapping a normal drive letter to the path that has the UNC path.

What is the correct UNC path?

A UNC path uses double slashes or backslashes to precede the name of the computer. The path (disk and directories) within the computer are separated with a single slash or backslash, as in the following examples. Note that in the DOS/Windows example, drive letters (c:, d:, etc.) are not used in UNC names.

What port is used for UNC path?

These ports are used when installing clients via Remote Install and when clients send quarantined files to the server using the UNC path. This uses HTTP port 8082 and HTTPS port 4345.


2 Answers

This is a late answer, but for future reference:

Your suggestion of multiple NetBIOS names (OptionalNames) has worked for me to allow a Windows machine to accept UNC paths under other computer names.

For completess, you can combine this with adding the same alias's to the hosts file with the localhost ip 127.0.0.1 so IP traffic will always be redirected.

like image 61
JonoB Avatar answered Sep 24 '22 01:09

JonoB


Maybe use the UNC version of localhost?

\\localhost\c$\tmp

Will map to your local c:\tmp folder.

like image 24
slim Avatar answered Sep 21 '22 01:09

slim