Crashes of the HA running in a VM

Hello,

I am running HA on a DELL computer (windows 11), in a VirtualBox VM.
I crashes like once a week to once a day, I need to restart the VM.

I read a suggestion that RAM allocation might be a problem (the host computer has 8BG, 4GB is allocated to VM). The host is not used for anything different from running VM with HA.
I just increased the amount of allocated memory (to 5GB and something), I wish it solves the problem.

But - I have a different question - what I migrate to Raspberry PI (like 4) instead?
Is it going to run soother (with no issues)?

It is unlikely that the ram amount of 4Gb is the cause. 4Gb should be fine.

You need to extract and read the homeassistant.log.1 file from the config folder after a crash.
It is the log file from the run up to the crash, so reading it backwards might give you some clues.

No guarantee. If it’s a problem with an integration or a memory leak changing hardware won’t save you.

Fix the problem.

Move to anything running Linux FIRST, then trouble-shoot any issues.

IMO, trying to troubleshoot virtualbox on Windows is potentially a waste of time, as IMO, it’s not an ideal setup. It’s much much simpler to run native on a Pi or other Linux environment.

So, moving to Rpi and installing native HA OS should be the first step to trace and solve problems?

When I saw that it crashed once a week on a Windows with VirtualBox I thought of Windows Update right away, but I do not think there have been so many updates that recently that have required daily restarts.
Windows will restart due to updates regardless of VirtualBox is running or not, unless something is done to stop the automatic updates and that is only possible on versions other than the home version.
Proxmox or bare metal HAOS would be better solutions, but again if the issue is hardware, then try to find the culprit first.

A move to a RPi is not that much of an upgrade to to a Dell computer, more likely a down grade actually.
A RPi often require several accessories, like a case, a fan, SSD and expansion slot and powered USB hub.

IMHO you probably made the problem worse. It’s likely Windows running out of memory, not Virtual box. If it was me I’d drop the VM down to 3GB to see if that helps.

Giving W11 only 3GB will likely cause terrible swap related performance issues, which will hurt VB even worse.

My 2 cents.

Well, its defenetly not a Win update issue.

Usually some infos/errors are printed on the VM console


At this moment - the client side (ie homeassistant.local) works, but when it does not the screen looks similar (there are more lines, but it does not look like something I could understand…).

Should I copy that info to analyze? I can not do that by myself…

Then why are you wasting resources on Virtualbox?

Yes, but a used micro PC like the Intel NUC i3 or i5 will cost less that a new Raspberry Pi and the micro-PC will outperform any Raspberry Pi in every metric.

Running HAOS bare-metal on a Micro PC is the easiest and most reliable installation. I measure my Intel NUC uptime in years.

See “sensor.memory_use” history if it’s rising gradually. If it’s not available enable it in system monitor.
There can be memory hog addons, Studio Code Server is one of them. I restart studio addon every night at 00:00 to prevent this.

that is the screen I find while my HA server is not accessible. I need to restart the VM - then it works… For some (random) time I suppose.
Windows itself works normal.

If just changing the operating systrm (to a bare HA) is best solution - I would do that soon as I have phisical access to this computer.

The PC is I5-6500 8GB, that with native HAOS should be good (in the beginig I just wanted to try how the whole HA works, hence VM - now it prooved to be great for my needs, so I can swich to another OS. I jaust need to have problemless solution:)

If there’s memory leak then going to bare HA won’t help, as same will happen. Did you check if memory use slowly goes sky high as i suggested?

You are not the first one…

As before, my advise to switch to VMWare stands.
A bit harder to set up, but way more stable :wink:

That output does not look like a memory leak, but more like a scheduling issue, which could be from Windows starving the VM from CPU cycles.

Now what Windows is using CPU cycles on is a good question.
It is a heavy OS, due to the GUI and all the flexibility it has built-in.
It could also be that Windows is low on memory and it is swapping a lot, which also eats CPU cycles for disc handling.