VirtualBox

Ticket #4873 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

VBoxSVC missing from headless starts

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

Description

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

fi

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

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

Change History

comment:1 Changed 5 years ago by frank

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.

Changed 5 years ago by ToddAndMargo

VM-Utils Script

Changed 4 years ago by ToddAndMargo

11-06-2009 version of VM-Utils

comment:2 Changed 4 years ago by ToddAndMargo

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 Changed 4 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

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

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use