Je cherche à faire démarrer une machine virtuelle au boot de mon ordi. Etant depuis peu sous systemd, je cherche à lancer ma vbox dans un service.
J'ai trouvé https://bbs.archlinux.org/viewtopic.php?id=147591 en fouillant sur Google et, après copier/coller, j'obtiens :
Code : Tout sélectionner
$ cat /etc/systemd/system/vbox.service
[Unit]
Description=Virtualbox Headless VM
[Service]
ExecStart=/usr/bin/VBoxHeadless -s MA_MACHINE
ExecStop=/usr/bin/VBoxManage controlvm MA_MACHINE poweroff
User=MON_UTILISATEUR
[Install]
WantedBy=muti-user.target
Code : Tout sélectionner
$ sudo systemctl start vbox
$ systemctl status vbox
vbox.service - Virtualbox Headless VM
Loaded: loaded (/etc/systemd/system/vbox.service; disabled)
Active: failed (Result: exit-code) since Thu, 2012-11-01 07:40:20 CET; 628ms ago
Process: 1723 ExecStop=/usr/bin/VBoxManage controlvm MA_MACHINE poweroff (code=exited, status=1/FAILURE)
Process: 1675 ExecStart=/usr/bin/VBoxHeadless -s MA_MACHINE (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/vbox.service
Lorsque je lance ma commande vboxheadless -s MA_MACHINE, la machine démarre, pas de pb et je peux l'utiliser via rdesktop.
J'ai ajouté root au groupe vboxusers, ça ne change rien, même après redémarrage.


Laptop HP ProBook 4730s
Gnome 3.4.2
$ uname -a
Linux Dunz_Arch 3.6.4-1-ARCH #1 SMP PREEMPT Mon Oct 29 09:49:00 CET 2012 x86_64 GNU/Linux
$ systemd --version
systemd 195
arch
+PAM -LIBWRAP -AUDIT -SELINUX -IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ