I’m running openSUSE Leap 42.1 on a amd64 system and am trying to start a Virtualbox VM called Centos7 at boot with a systemd service file located in /etc/systemd/system
I have created the following vboxvmservice@.service file with this content:
If you want to instead follow the official Virtualbox documentation (Or, you should at least skim this info to know all that you need to do in your Unit file)
To my eye comparing the official documentation with your proposed Unit file
You don’t define User permissions to access the Guest. This may be particularly relevant if you don’t enable “All Users” on your machine to be able to manage Guests in a default policy. On the other hand, AFAIK nowadays there are no restrictions for any User to manage a Guest, but that may still not be enough… A Guest may still require <some> User to be specified. To some degree, I’m comparing Virtualbox to how I understand “enterprise” virtualization technologies work, in those there is a fairly clear differentiation between core functionality and Userland tools. Virtualbox on the other hand seems to be designed to invoked, run and be managed entirely in a User security context so those differences need to be resolved, and may not be fully documented (in other words, where I don’t see full documentation, I’m guessing).
Your Unit file describes starting a specified Guest and “wants” network connectivity, but maybe that’s not right? Have you started the VBox application itself, which I would guess should provide at least minimal connectivity (Host-only, wouldn’t know about remote network functionality).
If what I suspect is correct, you should create another Unit file that sets up a “Virtualbox daemon service” to start and be running before you can execute the Unit file you created(with its vboxmanage commands), and you need to add a few parameters to your Unit file as well.