Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I was working on a old version of VirtualBox (3.2.6) in which I can edit /etc/sysconfig/vbox, there I can add as many VM to start when the host boots up.

Now on the this new version 4.2.6 can't edit that file because it's no longer supported. Checking on the forum I found something but I does not work.

cat /etc/default/virtualbox
# /etc/default/virtualbox
#
# -------------------------------------------------------------------------------------------------
# In the "SHUTDOWN_USERS" list all users for which a check for runnings VMs should be done during
# shutdown of "vboxdrv" resp. the server:
# SHUTDOWN_USERS="foo bar"
#
# Set "SHUTDOWN" to one of "poweroff", "acpibutton" or "savestate" depending on which of the
# shutdown methods for running VMs are wanted:
# SHUTDOWN="poweroff"
# SHUTDOWN="acpibutton"
# SHUTDOWN="savestate"
# -------------------------------------------------------------------------------------------------
#
#SHUTDOWN_USERS="foo bar"
#SHUTDOWN="savestate"
VBOXAUTOSTART_DB=/etc/vbox
#VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg
VBOXAUTOSTART_CONFIG=/etc/vbox/vboxauto.conf

this is vboxauto.conf:

cat /etc/vbox/vboxauto.conf
# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny

root = {
    allow = true
}

then I do this:

VBoxManage setproperty autostartdbpath /etc/vbox

and this

VBoxManage modifyvm <the_machine> --autostart-enabled on

when i try to look at the status

rcvboxes status
Virtualbox machines: no virtual machines running.                                                                                                                       skipped
vboxes.service - LSB: Autostart Virtual Box VMs
          Loaded: loaded (/etc/init.d/vboxes)
          Active: active (exited) since Tue, 2013-02-05 23:34:57 UYST; 32min ago
         Process: 30764 ExecStart=/etc/init.d/vboxes start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/vboxes.service

Feb 05 23:34:57 my.machine vboxes[30764]: Starting Virtualbox machines: no virtual machines configured..unused
Feb 05 23:34:57 my.machine systemd[1]: Started LSB: Autostart Virtual Box VMs.

why won't VirtualBox see my virtual machines to leave them headless? Edit 30 - may

I did configure it in /etc/sysconfig/vbox, but get this when I run it under init.d

/etc/init.d/vboxes status
Virtualbox machines: no virtual machines running.                    skipped
vboxes.service - LSB: Autostart Virtual Box VMs
          Loaded: loaded (/etc/init.d/vboxes)
          Active: inactive (dead) since Sat, 2013-02-02 22:00:49 UYST; 1 day and 21h ago
         Process: 4155 ExecStop=/etc/init.d/vboxes stop (code=exited, status=0/SUCCESS)
         Process: 3955 ExecStart=/etc/init.d/vboxes start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/vboxes.service

I did a small test and move the script to /root/bin an it worked just fine.

./vboxes_test status
 test (user: root):                                       running (since 2013-02-04 21:55:46)                                                        running
 test (user: root):                                       running (since 2013-02-04 21:55:46)

small edit: So far this is what I was talking about.... anyway did the old configuration (add the vm in /etc/sysconfig/vbox) and now then I reboot the host the vms also do that. The thing is I don want the vms to reboot when I poweroff the host: t*he vms must do savestate before the host shutdown*.

small_coment: If I previous do a savestate and the reboot the host.. the vms do work as I wanted...

Is there any info to make it work?

share|improve this question
    
if you speak Spanish, please visit the opensuse forum forosuse.org/forosuse/showthread.php?p=162878#post162878 –  maniat1k Apr 15 '13 at 16:07

1 Answer 1

up vote 3 down vote accepted
+100

I think the command you're looking for is this:

VBoxManage modifyvm <Machine Name> --autostop-type savestate

The following are alternatives to savestate: [disabled|savestate|poweroff|acpishutdown].

If that doesn't work I believe you can use the acpishutdown option to configure the VM so that when it receives the trigger to acpishutdown to savestate as well.

If the above doesn't work there is always manually doing the savestates yourself using this command:

VBoxManage controlvm <vm> savestate

And then rebooting the host system.

References

share|improve this answer
    
Actually I did all those things but get no good results. Maybe Is something on the OpenSuSe but not so sure... Really need some extra help. –  maniat1k Jun 3 '13 at 16:51
    
maybe is something else that not works on opensuse... thanks anyway. Your answer looks right. –  maniat1k Jun 5 '13 at 12:33
    
Thanks. I've researched this a lot and I can't find anything else other than the above to do. It should work so without more of your setup I can't really assist further. Sorry! Also with the bounties if you don't award them they go away. Do as you wish, just letting you know. –  slm Jun 5 '13 at 12:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.