sudo apt reinstall virtualbox-dkms virtualbox-ext-pack virtualbox-qt virtualbox
sudo nano /etc/default/virtualbox
VBOXAUTOSTART_DB=/etc/vbox
VBOXAUTOSTART_CONFIG=/etc/vbox/autostartvm.cfg
or
echo -e "VBOXAUTOSTART_DB=/etc/vbox\nVBOXAUTOSTART_CONFIG=/etc/vbox/autostartvm.cfg" | sudo tee /etc/default/virtualbox
sudo usermod -aG vboxusers danaukes
sudo mkdir /etc/vbox
sudo chgrp vboxusers /etc/vbox
sudo chmod g+w /etc/vbox
sudo chmod +t /etc/vbox
sudo chmod 755 /etc/vbox
sudo nano /etc/vbox/autostartvm.cfg
default_policy = deny
danaukes = {
allow = true
startup_delay = 10
}
VBoxManage setproperty autostartdbpath /etc/vbox/
VBoxManage controlvm "home-assistant" poweroff
vboxmanage modifyvm home-assistant --autostart-enabled on --autostop-type acpishutdown
VBoxManage startvm home-assistant --type headless
sudo -i
cd /etc/init.d/
services=(vboxautostart-service vboxweb-service vboxballoonctrl-service)
base_url="https://www.virtualbox.org/svn/vbox/trunk/src/VBox/Installer/linux"
for service in "${services[@]}"
do
wget "${base_url}/${service}".sh -O "${service}" \
&& chmod +x "$service" \
&& update-rc.d "$service" defaults 90 10
done
sudo systemctl enable vboxautostart-service
sudo systemctl start vboxautostart-service
sudo systemctl stop vboxautostart-service
sudo systemctl disable vboxautostart-service