LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Windows XP Virtual machine using labview

Solved!
Go to solution

Hi All,

 

I'm having an issue starting the Windows XP mode VM through the command prompt in LabVIEW 2013.

 

The command I'm using is (C:\Windows\System32\VMWindow.exe -file "C:\Users\User\Virtual Machines\Windows XP Mode.vmcx"), but the problem is that the command does not work with the CMD prompt that I call from LabVIEW. I can go to command prompt on the PC and run this command on and it works, but if I have the same command on VI, the command prompt tells me the "C:\Windows\System32\VMWindow.exe" is not a recognized command.

 

On Some investigation I figured out that both LABVIEW and Test Stand are not able to see "C:\Windows\System32\VMWindow.exe" executable at all.

I tried running LABVIEW as administrator and it does not help.

 

Has any one faced similar issue.

0 Kudos
Message 1 of 4
(2,338 Views)
Solution
Accepted by topic author amarbir444

LabVIEW is directly trying to instantiate the first argument in your command as a process through the CreateProcess() Windows API. That has a number of implications such as that it must be findable by the Windows kernel directly.

 

What you want to do most probably is to invoke the command line windows as first argument with the option -k and then pass it the rest of your command. That way you do exactly the same as when you enter the command in a command line window rather then relying on Windows itself to find the executable.

 

cmd -k <your command line invocation here>

The main problem here is that System32 is reserved for 64-Bit processes on a 64 bit system (I know it sounds very unlogical but that is how Microsoft in its infinite wisdom has decided). A 32 bit process trying to refer to a file under System32 has normally no way to see that file as Windows will "helpfully" redirect any such request to SysWOW64 instead, where your file is of course not located. I'm not sure that the cmd -k will solve that, but it is the best bet, if it doesn't you are in a bit of trouble here. There are ways to convince Windows to not redirect file access but that is a pretty hacky solution with all kinds of possible race conditions.

Rolf Kalbermatter
My Blog
Message 2 of 4
(2,335 Views)

Thanks Averna.

That answers a lot of questions.

cmd -k did not work

0 Kudos
Message 3 of 4
(2,310 Views)
Solution
Accepted by topic author amarbir444

Found solution

 

To access System32 folder using 32 bit software windows has a virtual folder named Sysnative.

So I just changed the command to:

C:\Windows\Sysnative\VMWindow.exe -file "C:\Users\User\Virtual Machines\Windows XP Mode.vmcx

 

 

0 Kudos
Message 4 of 4
(2,292 Views)