Installing Home Assistant on VMWare Player 17

Here’s some extra credit setup info.

Setting Up USB Autoconnect

  1. Shut down your HA VM.
  2. Navigate to your the folder where your VM lives.
  3. Open the vmware.log file in the text editor of your choosing.
  4. Search for the USB device you wish to automatically connect to the VM. You should see a line similar to this.
  5. Go back to the folder and edit the VMX file for your VM.
  6. At the bottom add this line for the device(s) to auto connect. The name should be the name from the log file. If you need more than one device, just increment the number after ‘device’.

usb.autoConnect.device0 = "name:###name from log file####"

image

  1. Start your VM back up. The devices should auto connect and show up under Settings → System → Hardware → All Hardware

Setting the VM to Start With Windows

  • Create a batch file
  1. Navigate to your VM folder (really any folder will work).
  2. Create a new text file. Name it whatever you’d like, just change the file extension to ‘.bat’
  3. Paste the following line.
"C:\Program Files (x86)\VMware\VMware Player\vmrun.exe" -T player start "###full path to VMX file###" nogui

It should look something like this

(NOTE: I have the VMware folder in my path variable, so I don’t have to list the full directory location; if you haven’t done this or don’t know what it is, just use the text from above)

  • Schedule the Batch File to Run at System Start
  1. Open Task Scheduler:
  2. From the Action menu, select “Create Basic Task”
    image
  3. Name it whatever you’d like and click Next.
  4. Select “When the computer starts” as the trigger.
  5. Leave the action set to “Start a program”
  6. In the “Program/script” field, navigate and select the batch file created in the previous section:
  7. Tick the box to open properties and then click finish.
  8. Under security options on the “General” tab, change to “Run whether user is logged on or not”
  9. Go to the Triggers tab. Right click the trigger and select edit. Tick the delay task option and set to 1 minute.
  10. Go to the “Conditions” tab. Untick “Start the task only if the computer in on AC power”
  11. Go to the “Settings” tab. Tick “Run as soon as possible” and untick “Stop the task if it runs longer than:”
  12. Hit OK, then provide your Windows password when prompted.

Reboot and verify that HA starts with Windows.

6 Likes

Well done! :+1:

2 Likes

Hi I got stuck at the step where I need to add what type of firmware it is due to VMXF file is different in my case here is a screenshot


I am running vmware version 17.0.2 build-21581411 on windows 10 64bit machine
Any suggestions what I might be missing?

You should be editing the vmx not the vmxf file.

@FriedCheese thank you so much for this guide. So, what happens when the Host OS, Windows, shutdown or reboots? Home Assistant VM will not shutdown safely; and, may break the VM.

There should be a respective automated shutdown request via command-line; which can’t be done by the Windows Scheduled task. I’m guessing its possible to do this via NSSM - the Non-Sucking Service Manager to launch the batch file you created, although I don’t use that. I use AlwaysUp instead, which I know for sure allows to add the respective shutdown command:

Home_Assistant_shutdown.bat

vmrun.exe" -T player stop "E:\VMWare\Home_Assistant\Home_Assistant.vmx nogui

If I’m not mistaken, stopping a VM is the equivalent of pulling power.

I never really solved this problem. With Windows Pro, you can set a shutdown policy to run a batch file during shutdown. I had one setup to ssh into HA and run a clean host shutdown, but it never worked really worked well. I think there’s a timeout after the script is called and that was shorter than the time it would take HA to fully shutdown. I tried adding a delay to the script but didn’t really test it. I ended up moving everything to a Proxmox setup where it’s not a concern.

I know exactly what you mean. I’ve setup mine with AlwaysUp (to handle startup and shutdown), when Windows wants to shutdown, it triggers the AlwaysUp-Home-Assistant service to shutdown… which triggers the shutdown script I just posted. However…

I now have very good reason to believe that the shutdown script doesn’t shutdown Home Assistant in time before the OS shuts down. In my case, this happened so many times that it eventually broke Home Assistant VM’s containers.

I wish I had seen the below URL sooner. I just noticed it. It shows 2 different solutions to make the OS wait long enough for the Home Assistant Windows service (created by AlwaysUp) to shutdown. I don’t think there is any other way. If you come up with a different solution that works, please post here. I will also do the same after I test this solution:

How Do I Give my Windows Service More Time to Stop During Shutdown? | The Core Technologies Blog

Great article, easy to follow, thank you !
I wanted to share an experience on VMWare upgrade for reference. I upgraded VMWare Player from 16 to 17 yesterday. VMWare popped a message saying a new version was available. I clicked and installed version 17 from that notification. After restart, my HA instance got stuck. It took me a while to find out HA didn’t get an ipv4 address anymore after the VMWare restart. I tried different commands, without any luck.
The only thing that helped was to fully uninstall VMWare Player, reboot, and install VMWare Player 17 again. After that, HA received an IPv4 address again.
Hope this helps for anyone with this issue in future.

1 Like

I’m glad the article was helpful, and thank you for sharing your experience, which will surely help others!

I followed this guide, the only thing is that my sonoff 3.0 zigbee plus dongle isn’t recognized automatically
in Windows i see the device as a Silicon Laps CP210x device, and when i manually connect is to the VM i get an error in the message log: Driver error, is ther a solution for that error?
kind regards.
Alfred

Good guide for setting up HA on VMware. Thanks @SimplySmartHouse and @FriedCheese :slight_smile: I was running HAOS as vm on VirtualBox (Windows host) for almost 2.5 years before switching to VMware Player 17 (free version) around middle of 2023.

One additional note about VMware is that size of virtual disk (vmdk file in Windows host) keeps growing… see this discussion for remedy: VMWare Tools to shrink disk / reclaim unused space - #9 by faster777

For those running HA on VirtualBox I will add that once in while VMware may need additional manual maintenance (like shrink/compact disk), its still much more stable and long-running on Windows host. This makes VMware much much easier to manage than the constant monitoring and baby-sitting of the VirtualBox vm that is prone to memory issues, crashes and regular restarts/cycle every few days!

2 Likes

Thanks a lot for this guide - changing the firmware to “efi” is the key information here that did the trick for me.

I agree. For me VMware is much more stable and an added benifit is that I run completly wireless without any issues on vmware including sunning a scrypted server and 4 cameras inside hass with no issues. Trying that in virtualbox will make you want to throw your pc against the wall because hass keeps disconecting.
Also @SimplySmartHouse great write up on setting up VMware!! For thaose that want to convert from virtualbos to vmware or just create a clean VM, create a complete hass backup and save it on your pc. Install hass on your vmware vm as decribed above(10 min) and then durring onbording select import backup and dang it is all done. Super fast and easy

Is there a way to share a drive from my pc to the HASS enviroment. I know we can do it the other way via the samba share addon but that does not meet the requirement. I have files that are created in windows that I want to read into Node-red and I want to eliminate the task of having to move them from my pc into the shared folder from HASS. I also wnat to use files from my idrive that come from my iphone and this would illiminate a bunch of steps.
I tried sharing the drives via vmware but it says you need to add vmware tools?
Chat GPT brought me to this thread.

Hi there!
I came here from Google after I had a crisis and my HASS got wiped and needed to reset it.
Can you add to the guide " check if you have USB device ENABLED" on machine setting ( near Remove both New CD/DVD (IDE) and Printer as they will not be used.) if you don’t have it enabled, Zigbee Adapter won’t be found.

Hi there, anyone else experimenting network issue with bridged mode ? My vm has internet but my windows looses its connexion. Chrome returns errors on any web page

Thank you

Bridged mode is the only mode I ever run my VM’s in mostly, including HA, and it works perfectly for me.

Hi,

In my version of VMWare Workstation (17.5.x), the Configure Adapters option does not appear on Windows. Instead, look in the start menu for Virtual Network Editor. To configure the bridge-type interface, you must select the Change Settings option in the program. It should appear as VMNet0.

1 Like

You sir are my hero! Thank you very much.

1 Like

Morning Everyone,

So il try and keep this short.
I came from virtual box, due to the USB issues. I could make it work 80 percent.

Moved to VMware workstation for the ease of USB passthrough. And it has excaled in that regards.

But for some reason I am experiencing random time sync issues. Automations triggering at the wrong time so on …
Home assistant reports the correct time, but the host… Seams to experience tons of time issues.

When I look at the host logs, I see tons of sync errors.

Has any one else had similar issues?