In this guide, I will show you how to run your Vmware Workstation VM in the background and automatically after startup, using either a batch file or Windows Task Scheduler. This means that after your host computer or server restarts, your VM will automatically startup without you needing to launch the VMware Workstation Player. This will also force it to run it to run in the background, so you aren’t left with an open program taking up space on your taskbar.
On previous versions of VMware, you could simply click the X on the player window, and an option pops up asking if you want to run it in the background. I’m not sure why they removed this feature in Workstation 16, but this is a simple way to achieve the same effect.
To do this, we are going to create a simple batch file and place it into our Windows startup folder.
Verify VMware Installation Folder
By default, VMware should be running at C:\Program Files (x86)\VMware\VMware Workstation. Inside that folder is a VMrun.exe.
Once confirmed that is correct, you can move onto the next step.
Locate Path to .VMX File
Browse to the path where your virtual machine configuration file (.vmx) is stored. In this example, I am going to automatically start Home Assistant after rebooting my Windows 10 host PC.
Mine is located in C:\HomeAssistant:
Option 1: Create Batch File to run after login
Go to your desktop. Right-click > Create new text document.
Double-click to open, and then paste this command. You will need to change the path to your own .vmx file.
"C:\Program Files (x86)\VMware\VMware Player\vmrun.exe" start "C:\HomeAssistant\homeassistant.vmx" nogui
The nogui at the end tells VMware to run it without opening the VMware Workstation Player window, which means it will run in the background.
Then save the file. File > Save As > and then change the “Save as Type” to All Files.
Name the file something like hassautorun.bat.
Move Batch File to Window Startup Folder
The last step is to move the batch file to your Startup folder. This is a folder where programs will automatically start after your Windows computer or server reboots and after logging in.
Open Run > type Shell:Common Startup
Simply drag and drop the batch file into this folder and click Yes on the Administrator prompt.
Option 2: Start VMware Workstation using Task Scheduler (without needing to login)
- Search Windows for Task Scheduler.
- Right-click Task Scheduler Library > Create Task.
- Give it a name, choose Run whether user is logged in or not > and configure for Windows 10.
- Under Triggers, begin the task At Startup. Make sure the Enabled box is checked.
- Under Actions:
- Program Script:
"C:\Program Files (x86)\VMware\VMware Player\vmrun.exe"
- Add arguments: start
- Program Script:
- Then click OK and enter your credentials.
Test It Out
The last step is to simply test it out. Reboot your computer. If all goes well, your Home Assistant (or whatever VM you want to run in the background) should startup automatically without a gui!
I recommend using the Task Scheduler option. If you lose power and your PC automatically starts back up, Home Assistant will start without you needing to log back into your PC.