Opened 15 years ago

Closed 15 years ago

#4873 closed defect (fixed)

VBoxSVC missing from headless starts

Reported by: ToddAndMargo Owned by:
Component: other Version: VirtualBox 3.0.4
Keywords: Cc:
Guest type: Windows Host type: Linux


Hi All,

When you start a headless VM, you do not get a companion VBoxSVC. This makes it impossible to shut down your headless VM, unless you start your own VBoxSVC when you are trying to shut it down.

You can see details from my shutdown script:

# wait for VBoxSVC to exit after the "VBoxManage showvminfo" command SvcDelay=10 echo "Waiting $SvcDelay seconds for VBoxManage showvminf's VBoxSVC to exit" I=0; while [ "$I" -lt "$SvcDelay" ]; do

I=expr $I + 1 echo -n "$I " sleep 1

done echo ""

echo "Shutting down $VM_Name. Waiting $ShutdownWait seconds"

SvcFound="ps alx | grep -v grep | grep VBoxSVC" if [ -z "$SvcFound" ]; then

echo "VBoxSVC process not found. Starting it" su tony -c "/usr/lib/virtualbox/VBoxSVC --automate &" sleep 4


su todd -c "/usr/bin/VBoxManage controlvm $VM_Name acpipowerbutton" Status=$? logger -p user.notice -t VM-Utils " stopping $VM_Name. Stop status <$Status>"

By the way the VBoxSVC that is spawned by "VBoxManage showvminfo" does not work with "/usr/bin/VBoxManage controlvm $VM_Name acpipowerbutton", so you have to wait for it to clear before you issue your own.

I would request: 1) "/usr/bin/VBoxManage controlvm $VM_Name acpipowerbutton" spawned its own VBoxSVC, or 2) "/usr/bin/VBoxManage controlvm $VM_Name acpipowerbutton" would not need VBoxSVC, or 3) "/usr/bin/VBoxHeadless --startvm $VM_Name &" spawned a VBoxSVC for "/usr/bin/VBoxManage controlvm $VM_Name acpipowerbutton" to use.

Let me know if you want to see the entire script.

Many thanks, -T

Attachments (2)

VM-Utils-Todd (3.2 KB ) - added by ToddAndMargo 15 years ago.
VM-Utils Script
VM-Utils (4.6 KB ) - added by ToddAndMargo 15 years ago.
11-06-2009 version of VM-Utils

Download all attachments as: .zip

Change History (5)

comment:1 by Frank Mehnert, 15 years ago

It is impossible that a VBoxHeadless process is spawned without a VBoxSVC daemon. VBoxManage as well as VBoxHeadless will first try to attach to an already running VBoxSVC daemon and if no daemon is running it will spawn a new one. The VBoxSVC daemon is required to find the VM process so it is not possible to do a VBoxManage control ... command without a VBoxSVC daemon. When deciding if a new VBoxSVC daemon needs to be started, a suitable socket at /tmp/.vbox-VAR-ipc is opened.

So if you really have problems with the VBoxSVC daemon I indeed would like to see the whole script, so please attach it to this ticket.

by ToddAndMargo, 15 years ago

Attachment: VM-Utils-Todd added

VM-Utils Script

by ToddAndMargo, 15 years ago

Attachment: VM-Utils added

11-06-2009 version of VM-Utils

comment:2 by ToddAndMargo, 15 years ago

Hi All,

I attached the latest revision of VM-Utils. I use variables better, so it should be easier to use. It also works around bug 5413.

Also, I set my "SvcDelay" variable from 10 seconds to 1 second ("SvcDelay=1") and I get away with it under VBox 3.0.10. Did you guys fix this and forget to mention it on this bug report?

Yippee! Well, maybe yippee.

Many thanks, -T

comment:3 by Frank Mehnert, 15 years ago

Resolution: fixed
Status: newclosed

Well, reopen if the problem re-appears. Though we were never able to reproduce it.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use