I have setup a service to automatically start up the VM after booting the host. After a boot, the service errors out with the following errors:
Code: Select all
sudo service vbox_vm_start@ERPNext status
● vbox_vm_start@ERPNext.service - VirtualBox VM ERPNext
Loaded: loaded (/etc/systemd/system/vbox_vm_start@.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-11-20 00:35:44 HKT; 16s ago
Process: 1144 ExecStart=/usr/bin/VBoxManage startvm ERPNext --type headless (code=exited, status=1/FAILURE)
Tasks: 0 (limit: 76627)
Memory: 25.2M
CGroup: /system.slice/system-vbox_vm_start.slice/vbox_vm_start@ERPNext.service
Nov 20 00:35:44 vs02 VBoxManage[1162]: WARNING: The character device /dev/vboxdrv does not exist.
Nov 20 00:35:44 vs02 VBoxManage[1162]: Please install the virtualbox-dkms package and the appropriate
Nov 20 00:35:44 vs02 VBoxManage[1162]: headers, most likely linux-headers-generic.
Nov 20 00:35:44 vs02 VBoxManage[1162]: You will not be able to start VMs until this problem is fixed.
Nov 20 00:35:44 vs02 VBoxManage[1144]: VBoxManage: error: The virtual machine 'ERPNext' has terminated unexpectedly during startup with exit code 1 (0x1)
Nov 20 00:35:44 vs02 VBoxManage[1144]: VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
Nov 20 00:35:44 vs02 VBoxManage[1144]: Waiting for VM "ERPNext" to power on...
Nov 20 00:35:44 vs02 systemd[1]: vbox_vm_start@ERPNext.service: Control process exited, code=exited, status=1/FAILURE
Nov 20 00:35:44 vs02 systemd[1]: vbox_vm_start@ERPNext.service: Failed with result 'exit-code'.
Nov 20 00:35:44 vs02 systemd[1]: Failed to start VirtualBox VM ERPNext.
Code: Select all
sudo modprobe vboxnetflt
Code: Select all
matth@vs02:~$ sudo modprobe vboxnetflt
matth@vs02:~$ sudo service vbox_vm_start@ERPNext start
matth@vs02:~$ sudo service vbox_vm_start@ERPNext status
● vbox_vm_start@ERPNext.service - VirtualBox VM ERPNext
Loaded: loaded (/etc/systemd/system/vbox_vm_start@.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-11-20 00:37:59 HKT; 3s ago
Process: 2283 ExecStart=/usr/bin/VBoxManage startvm ERPNext --type headless (code=exited, status=0/SUCCESS)
Tasks: 43 (limit: 76627)
Memory: 58.1M
CGroup: /system.slice/system-vbox_vm_start.slice/vbox_vm_start@ERPNext.service
├─2293 /usr/lib/virtualbox/VBoxXPCOMIPCD
├─2299 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
└─2315 /usr/lib/virtualbox/VBoxHeadless --comment ERPNext --startvm b1a48d9c-e8e6-4901-8530-fb32513999a7 --vrde config
Nov 20 00:37:58 vs02 systemd[1]: Starting VirtualBox VM ERPNext...
Nov 20 00:37:59 vs02 VBoxManage[2283]: Waiting for VM "ERPNext" to power on...
Nov 20 00:37:59 vs02 VBoxManage[2283]: VM "ERPNext" has been successfully started.
Nov 20 00:37:59 vs02 systemd[1]: Started VirtualBox VM ERPNext.