In this guide, I will show you how to run your Vmware Workstation VM in the background and automatically after reboot, using either a batch file in the Startup folder 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.

Other useful guides:


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: Run Home Assistant VM After Login

This option will automatically launch your Home Assistant VM after logging into your PC. To do this, we will be creating a simple batch file and placing it into the Startup folder. If using a USB zwave/zigbee dongle (I’m using the Nortek GoControl), then make sure to follow this guide to automatically connect USB drives to VMware Workstation.

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 the Home Assistant virtual machine 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 Autostart Home Assistant.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 you log into your computer or server.

Open Run > type Shell:Common Startup

Simply drag and drop the batch file into this folder and click Yes on the Administrator prompt.

Congratulations – Home Assistant will now run in the background without the GUI after logging in!

We earn a commission if you make a purchase, at no additional cost to you.
09/03/2024 05:52 pm GMT

Option 2: Start VMware Workstation VM using Task Scheduler (without needing to login)

This option will automatically start Home Assistant after your computer reboots, without you needing to login. This would be useful if your PC reboots for updates or if you lose power.

If you are a using a USB zwave/zigbee dongle (I’m using the Nortek GoControl), then make sure to follow this guide to automatically connect USB drives to VMware Workstation first.

Create a batch file just like you would’ve done in Option 1. Save it to a folder like C:\Scripts. Then, create a scheduled task to run the batch file by following the guide below.

  1. Search Windows for Task Scheduler.
  2. Right-click Task Scheduler Library > Create Task.
  3. Give it a name, choose Run whether user is logged in or not > and configure for Windows 10.
  4. Under Triggers, begin the task At Startup. Make sure the Enabled box is checked.
  5. Under Actions, choose Start A Program
    1. Program/Script: point to the location of your Autostart Home Assistant batch file. (for me, this is “C:\Scripts\Autostart Home Assistant.bat” ) I used quotes but not sure if that is necessary.
  6. Then click OK and enter your credentials.

Test It Out

For Option 1: Reboot your computer and login. If all goes well, your Home Assistant VM (or whatever VM you want) should startup automatically in the background, without the VM Workstation GUI!

For Option 2: Reboot your computer but do not log in. Wait about 1-2 minutes, then open the Home Assistant mobile app. If all goes well, the scheduled task should’ve ran and your Home Assistant VM should be running in the background without a gui!

During your testing, you should toggle both zwave and zigbee devices to ensure the USB drive was detected.

Let me know in the comments below if this guide helped you out!


My Favorite Home Assistant Devices

Below are some of the Home Assistant-compatible devices I personally use in my home. I highly recommend each of them.

The full list of all Home Assistant compatible & recommended devices I use can be found on my Equipment List page.


My Homelab Equipment

Here is some of the gear I use in my Homelab. I highly recommend each of them.

The full list of server components I use can be found on my Equipment List page.

Similar Posts

4 Comments

  1. Thank you Danny! Your write-ups have helped me move from virtualbox over to vmware player, which has fixed an issue I was experiencing with the Conbee II not reliably reconnecting after a reboot. Well written and easy to follow. I’ll be checking back for more articles in the future.

    1. Hey Devin,

      That’s awesome, I’m glad it worked well for you! I post new articles pretty regularly so definitely check back or join my newsletter. I send out emails whenever something new gets posted.

  2. Hello Danny.

    VMWare is working at background process, but my vm instance doesn’t work.
    Have you any suggestion fix idea for me. 🙂
    Thank u.

  3. Hey Danny,

    Only discovered you and this article today. Thanks for posting with such clear instructions. Will defo be checking out some more of your articles.
    Al

Leave a Reply

Your email address will not be published. Required fields are marked *