HA installed with VirtualBox on Ubuntu, how to autostart image after reboot?

Hello guys, I’m trying for hours to find a solution for this issue. I installed home assistant supervised on Ubuntu 22.04, using the VirtualBox image. All good until I want to restart the minipc. After that I have to manually start the HA virtual machine.

I tried with comands added to app autostart in Ubuntu, then with comands that calls a script that starts HA. Nothing works. The commands were good, because I ran them in terminal and there the HA starts.

Is there a way to start it automatically?

You need to use VirtualBox commands to set up autostart along the lines of:

vboxmanage modifyvm "hass" --autostart-enabled on

You will need to run this when the VM is powered off, and then the following to restart the service:

sudo systemctl restart vboxautostart-service

I did that, with another guide that asked to put some script in etc/vbox. So I created vbox and the script and ran the commands that you added on top, still not starting.