Shared Folders work but can't run .exe on them

Discussions related to using VirtualBox on Windows hosts.
Post Reply
MrAnalogy
Posts: 3
Joined: 14. Aug 2016, 00:02

Shared Folders work but can't run .exe on them

Post by MrAnalogy »

I've got Windows 10 build 14393.447 on the Gues.
Host is windows 7 Pro

From Guest:
I can see shared folders (which I have Shared as v:\)
I can SEE files on that V: drive
But when I try to RUN an .exe it fails with no error.
I can create files on V:\ and also copy the file from v:\
If I run it as Admin I get: specified path does not exist. check the path, and then try again.

Uninstalled & reinstalled VM Guest Additions
I disconnected the Shared network folder and reconnected it.
Virtual Box is up to date (just installed latest version today)
No luck.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Shared Folders work but can't run .exe on them

Post by socratis »

This is part of a how-to I've been meaning to post for some time, still unfinished, but the following passage should apply in your case.
Note 1: If you run your executable from a VirtualBox share that is not mapped (does not a drive letter assigned), you get the following error:
  • Unable to assign a drive letter
    to the script path \\VBoxSvr\Share\Executable
Note 2: If you run your executable from a VirtualBox share that is mapped (has a drive letter assigned), you get the following error:
  • W:\Share\Executable.exe
    The specified path does not exist.
    Check the path and then try again.
Solution 1: Disable UAC control temporarily. Then run your program from a mapped share (like W:\). You can turn off the network altogether if you don't feel protected enough with the UAC turned off.
Solution 2: Copy the whole executable sub-directory in the VM.

Explanation
When a user connects to a network share, Windows tries to connect with two sets of credentials. This fails due to the UAC control. This is done so by design. For references and further reading on previous reports and the reasoning behind it (read especially the Microsoft links):
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared Folders work but can't run .exe on them

Post by scottgus1 »

FWIW, if you're trying to run the exe using a Guest Additions Shared Folder, know that Guest Additions Shared Folders are really just for file copying between the host and the guest, not for running programs, databases, etc. like a real shared folder can do.
Casey Dwayne
Posts: 1
Joined: 4. Oct 2021, 08:37

Re: Shared Folders work but can't run .exe on them

Post by Casey Dwayne »

I know it's an old post but I wanted to add a solution/workaround for anyone searching for this (like I just did).

You can make a symlink to the directory then run it as if it were native to your virtual machine.

For Windows, open CMD as administrator and travel to the location you'd like to "place" the installer (i.e. desktop = `cd /users/<username>/desktop`). Then make a directory symlink like so:

Code: Select all

mklink /d TempDir "Z:\Path\To\Desired Folder"
Just remember to enclose paths that have spaces inside quotation marks like above.

No more copying!!!
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Shared Folders work but can't run .exe on them

Post by scottgus1 »

Thanks, Casey, for the possible workaround!

I have not yet tried a situation where Virtualbox Shared Folders did not support something that regular shared folders supported. But I'll remember this and try it to see if it works.

FWIW I have also learned since my posts above that VSFs weren't specifically designed to be only for file copying. However, it seems that only file copying works all the time, and some other things stop working or don't work in a VSF where they do work in a real shared folder.
dornech
Posts: 10
Joined: 9. Jan 2011, 17:20
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Windows

Re: Shared Folders work but can't run .exe on them

Post by dornech »

I mentioned the issue with running programs from VB shared folders or "real" shares earlier.
viewtopic.php?t=97186
I read somewhere there were relvant changes in 6.1.22. As I was reluctant to update from VB 6.1.6 so far, but in the meantime I did the update to 6.1.50. Unfortunately I still have the issue.

I cannot run programs from VB shared folders nor can I do this from a "real" shared folder / network drive (via Windows "net use"). Also the symlink workaround suggested does not work. So, I wonder what I am doing wrong.
My use case ist to run VScode from different environments with same settings, this is the reason I am preferring the portable installation on a somehow shared location.

Any idea, any specific setting I did miss to consider?

Thanks in advance.
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Shared Folders work but can't run .exe on them

Post by fth0 »

Does it work if you use the UNC path instead of the drive mapping when running an executable?
dornech
Posts: 10
Joined: 9. Jan 2011, 17:20
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Windows

Re: Shared Folders work but can't run .exe on them

Post by dornech »

Thanks for your thoughts.

Well, while I still have an issue running an .exe from a shared drive, I still think it is somewhat linked to the UNC problem.

I created an link on the desktop to the .exe. Wether I set execution folder to the UNC-path or the drive-mapped path makes no difference.

But I can make VSCode running from the VBox happen: VScode is normally started by a \bin\code.cmd anyway.
If I start this cmd I run into the problem with the command line trying to execute at the UNC path what is not supported by windows requiring user interaction. But this can be overcome by input redirection using a dummy text file.
Post Reply