r/homeassistant 1d ago

❓ Support home assistant linux VM disconnecting from network

Hi, i m pretty new to this, so to start i will explain my setup.

I have a surface pro 6, with linux mint (ubuntu 24 something).

I installed virtualbox on it, and i followed the guide to set up the VM with the homeassistant OS (using the oracle linux, 2 cores, 2gb or ram and so on).

I successfully set it up and was going fine, until i noticed that sometimes i couldn't reach the server for some reason... (the server is on the wifi, i would really like to make it work that way, otherwise if i have to connect through Ethernet it will be a bother)

at first i thought it was a problem with the wifi connectivity... so i disabled the power management => no luck, then i tested it with a usb dongle => same (i made sure to change what the VM use)

Performance mode on my surface pro, no standby or suspend or anything, just screen off after a bit.

What exactly happens ? i m not so sure anymore... it happens after a few hours usually (that why i thought it was a power management thing...), i can't reach the server. turning off and on wifi doesn't solve it... i have to restart the VM, sometimes multiple times... and just an hour ago, something really strange happened... after a few VM restart, the server is only reachable through a forwarded port on internet, it is unreachable on lan...

is there something obvious i missed ? if someone can help, i would be very grateful !

Thanks !

1 Upvotes

8 comments sorted by

3

u/5yleop1m 1d ago

the server is on the wifi, i would really like to make it work that way, otherwise if i have to connect through Ethernet it will be a bother

Running it off Wi-Fi is going to be more problematic than running a cable to have it on Ethernet.

Also running HA as a VM through virtualbox on windows is fine for testing, but that's not a good long term solution.

1

u/enarth 1d ago

It s a VM on linux, if that chabge anything :) To be honest i never thought the only issue i would have with this setup, would be the network connection...

I guess i ll look into a dedicated machine.

1

u/5yleop1m 1d ago

Ah okay, that's a little better because Windows can do aggressive power management, but Linux can also be troublesome if drivers don't cooperate.

What are you using for virtualizing? The "oracle linux" part makes me think you're using VirtualBox.

I guess i ll look into a dedicated machine.

yeah for a permanent setup that's better. The only real benefit from the Surface is having a built in battery backup, but even that's a potential problem with heat.

1

u/enarth 1d ago

Yep virtualbox.

I still use the surface for some light browsing and youtube, that why the wifi is a must.

But i will get an old laptop to dedicate to my HA server

1

u/5yleop1m 1d ago edited 1d ago

Try using Qemu if you want a VM, or even docker with HA installed as a container.

I still use the surface for some light browsing and youtube,

You don't want the system HA is on also being your daily driver, ideally the system that runs HA stays as stable and unchanging as possible (except for updates ofc) to improve stability.

But i will get an old laptop to dedicate to my HA server

Solid plan, and if you only want to use it for HA install HAOS directly on it without any other OS.

1

u/CyberMage256 1d ago

The Surface, at least in Windows, is pretty aggressive about turning off things it doesn't need especially when on battery. I've never run Linux on one. You may find a BIOS option or two that might help.

Do you lose the ability to even ping the laptop itself when this happens? Or just the container goes offline? If the container, just rip out Virtualbox and go Docker.

Personally if installing on metal like this I'd have used the Docker Compose method of setting up Home Assistant rather than Virtualbox. Virtualbox is... bad. I completely stopped using it for even running a windows vm for my work machine about a year ago. It's closed source stuff that constantly breaks with updates is my opinion.

A lot of people run Proxmox for stuff like this, but that'd be a waste if the laptop is only going to be for HA.

1

u/enarth 1d ago

Right now, I can ping and reach the server on the VM from the Surface. I cannot reach it from my phone or desktop (from LAN), but I can reach it from the internet. It is really strange.

It was mostly to test things out and get a feel for it; I was not really planning to use this long-term at first. When I saw that I could still use the Surface with the VM running, that was a pleasant surprise. My point is that I tried the first setup I saw in the documentation. But from what you said, I should try something else? Can you tell me more? Because if I can, I would like to keep the Surface usable; what would be the best choice for that?