VMware Communities
Stubaan
Contributor
Contributor
Jump to solution

Pathname to file on the VM

Hi folks

I am aware of VMRUN and have been using it call programs on the VM and move files between the host and guest. I am not sure exactly what it does though, nor how these VMs are actually structured, so I'd like someone to clarify for me whether it is even possible to have a host pathname for a file on the guest VM.

For instance, I am running scripts from my Mac that do a bunch of editing on the Windows VM side - is there is a pathname I can use to refer to, and thereby edit, a file on the VM without using VMRUN.

Many thanks!

0 Kudos
1 Solution

Accepted Solutions
rcardona2k
Immortal
Immortal
Jump to solution

Mirroing is a bit of a misnomer, I don't think anything is duplicated with Shared Folders. What happens is the Windows path to Documents, Music, set is set to a UNC path (vmware-host\) which is serviced by VMware's HGFS file system, a private sharing mechanism with OS X. In OS X, the files just live in whatever directory is being shared out. But it is what you said, one location with multiple shared paths.

For SMB sharing, that's standard Windows file sharing so once mounted on your Mac, OS X is using an SMB client to, yes go over the network to access files in your guest VM. All of the traffic is host-only unless the VM is bridged and you're using Wifi as the connection, in which case the traffic might "bounce off" the wireless access point as a hop. There are ways to optimize the network path so all the traffic is strictly host-only.

I have not benchmarked HGFS v. SMB but there is a "tax" either way compared to the VM opening file right on its local filesystem. For your use case, it's probably worth checking both options out.

View solution in original post

0 Kudos
6 Replies
rcardona2k
Immortal
Immortal
Jump to solution

There is no standard path to files in a VM as it is a separate OS with it's own filesystem. With Shared Folders or Mirrored folders you can have your VM write (or copy files to) a common location on your OS drive, i.e. a path that you know, e.g. /Users/username/Desktop

Otherwise you can turn on Windows sharing in your VM and use OS X's standard SMB client support to map your guest's shares to OS X, i.e. use the Finder's Go > Connect to Server... option with an smb://guest_vm_ip/SharedMount URL. Once mounted your guest's files are available through an OS X volume path such as /Volumes/SharedMount/relative/path/to/your/files.

Stubaan
Contributor
Contributor
Jump to solution

Thanks for that - very interesting. Some follow-up questions/discussion if you don't mind...

When I installed Fusion I chose "less integrated", and currently have it set up such that only the desktop is shared. Or so I thought; I see now that my entire Mac User home directory is shared, and that the desktop is the only one mirrored. I also see that I can mirror some other standard directories, like My Docs, Music and Pictures through the Sharing settings of the Fusion, and I can similarly add another shared directory, but only a Mac one

Is it possible to simply share a specific directory on the Windows VM such that I can access it directly from the host without the need to copy files in order to do so. I need to execute many many simulations (hundreds, if not thousands) on the Windows VM that process serious amounts of data originating from Windows directories. The original reason I reduced the degree of integration of my Windows install was because I noticed horrific slowdowns in execution time of my model, which is in a Visual Studio Projects directory in My Docs. When the system was more integrated I gather that My Docs on the Windows VM was actually referring the Documents directory on my Mac, which is great for interconnectivity but was untenably slow because... why? My deduction is that the Mac Documents and Windows My Documents folders, though linked, were not physically in the same place and are merely mirrored, thus requiring that files actually be copied/moved around. I would very much appreciate any insight into whether I am on track or not, and whether there is a workaround that wouldn't drag out my execution times.

I'm going to do some reading up on the difference between sharing and mirroring - I'm very new to all this, clearly, so any helpful nudges would be fantastic.

Much 'bliged

0 Kudos
rcardona2k
Immortal
Immortal
Jump to solution

I also see that I can mirror some other standard directories, like My Docs, Music and Pictures through the Sharing settings of the Fusion, and I can similarly add another shared directory, but only a Mac one

Yes, that's the way shared folders work.

Is it possible to simply share a specific directory on the Windows VM such that I can access it directly from the host without the need to copy files in order to do so.

This is the option I mentioned above. There are plenty of tutorials on setting up file sharing in Windows, so I only included the directions on accessing that share in OS X which starts at the Finder's Go > Connect to server... option and using an smb URL, when prompted provide Windows login credentials. When the shared is mounted, the path in OS X that maps to is /Volume/Share/.... This is the same for a VM, a PC or a remote company file server.

I should also note when your VM is powered off VMware provides a VMDKmounter which mounts guests filesystems in OS X, you only need to open your VM's vmdk file with VMDKmounter and the guest disk will appear under /Volumes as a navigable path. The restrictions for NTFS will be read-only and off course the VM being powered off.

Stubaan
Contributor
Contributor
Jump to solution

THANKS! Feel like I'm getting somewhere Smiley Happy

So, for clarification, mirrored directories are duplicates in multiple locations, whereas shared directories are in a single physical location but accessible from multiple locations? And "mapping" refers simply to the path that gets one to the shared directory from different locations?

Sounds like the sharing route is where I should be headed. Is it ridiculous to ask whether there is a significant overhead in terms of the time it takes to perform actions on files in a shared directory? By which I mean, does the process of mapping require extra time because data must be routed through some network path that may not be as fast as directly accessing the folder from within the VM, or is literally as if I had direct access to the shared folder?

Thank you!! (!!)

0 Kudos
rcardona2k
Immortal
Immortal
Jump to solution

Mirroing is a bit of a misnomer, I don't think anything is duplicated with Shared Folders. What happens is the Windows path to Documents, Music, set is set to a UNC path (vmware-host\) which is serviced by VMware's HGFS file system, a private sharing mechanism with OS X. In OS X, the files just live in whatever directory is being shared out. But it is what you said, one location with multiple shared paths.

For SMB sharing, that's standard Windows file sharing so once mounted on your Mac, OS X is using an SMB client to, yes go over the network to access files in your guest VM. All of the traffic is host-only unless the VM is bridged and you're using Wifi as the connection, in which case the traffic might "bounce off" the wireless access point as a hop. There are ways to optimize the network path so all the traffic is strictly host-only.

I have not benchmarked HGFS v. SMB but there is a "tax" either way compared to the VM opening file right on its local filesystem. For your use case, it's probably worth checking both options out.

0 Kudos
Stubaan
Contributor
Contributor
Jump to solution

Alrighty. Lots to do!

Thanks again for all the help rcardona2k - really is appreciated!

0 Kudos