I need to start a virtual machine on Windows Startup and read about move the virtual machine to the "Shared VMs" tab. This worked for me since now when I need to auto start a Virtual Machine with a Physical Disk reference. By default VMware Workstation won't allow you to do this if you are loading a physical disk (from host machine).

I started to search for a solution and found some info about the "vmrun" command which allows you to start a virtual machine using the Windows Console (cmd.exe). Turns out that it works! If you execute something like this:

vmrun.exe -T ws start "D:\VM\Name.vmx"

The virutual machine starts immediately. So far we are good. Now, If I create a batch script (.bat) with the same line and configure the system to execute that batch file on startup nothing happens and I got this system prompt:


Also I got my VM blocked and force me to Take ownership, which I can't and finally offers me the alternative to Remove the VM from library.

This confuses me because I can start the VM from a command prompt but I can't do the same using a .bat file.

PS: I modified the windows environment variables to allow me to type only the vmrun command without pointing the entire path to the .exe. Somehow the system tries to execute the Virtual Machine (which says the .bat is executed) and finally can't do it completely.

**Post edit: I'm using the NSSM program to set other programs to run as services, which by the way I found in this great platform.


If you've scheduled a task to run without a user being logged on (which you have, because nobody is logged on while the system is booting up), the program cannot display any user interface because it runs in a session intended for only background services. Windows tells you about this situation with that message.

To start a VM with the vmrun command with no UI, add nogui at the end, like this:

vmrun.exe -T ws start "D:\VM\Name.vmx" nogui

(Source: this PDF VMWare manual.)

To fix the VM thinking it's in use, you need to delete or move the .lck or .lock files/folders from where the virtual machine is stored while VMWare Workstation isn't running. (Source: VMWare forums.)

| improve this answer | |
  • Oh man, oh man, oh man. This solved my headache about this issue. By the way I faced this same problem in VirtualBox and finally drop the flag. Now finally have the solution. Im still getting the windows prompt and I don't know why but, who cares? My VM is running in background! :) :) In your face Interactive environment. – Ophion Dec 15 '16 at 20:57
  • Seriously, I read something related to do not say thanks on posts but anyway THANK YOU! – Ophion Dec 15 '16 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.