Page 1 of 1

Headless shutdown problems

Posted: 11. Aug 2009, 05:10
by ToddAndMargo
Hi All,

I am trying to shutdown one of my headless VM's from the command line:

Code: Select all

# su todd -c "/usr/bin/VBoxManage controlvm WS08-1 acpipowerbutton"
VirtualBox Command Line Management Interface Version 3.0.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: The machine 'WS08-1' does not have an open session
Details: code VBOX_E_INVALID_SESSION_STATE (0x80bb000b), component Machine, interface IMachine, callee nsISupports
Context: "OpenExistingSession (a->session, uuid)" at line 584 of file VBoxManage.cpp
Using ps

Code: Select all

# ps axl 
F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
...
4     0 15110 15013  18   0   4908  1232 wait   S    pts/1      0:00 su todd -c /usr/bin/VBoxHeadless --startvm WS08-1
4   500 15111 15110  15   0 603320 521952 stext Ssl  ?          1:24 /usr/lib/virtualbox/VBoxHeadless --startvm WS08-1
0   500 15446     1  15   0  11400  2232 -      Ss   ?          0:00 rdesktop -k en-us -N -a 16 127.0.0.1:5011
You will notice WS08-1 does have a process and it is Todd's (UID=500). You will also notice Todd's "rdesktop" that he is currently running the stinking thing with.

So why does "VBoxManage controlvm WS08-1 acpipowerbutton" give me "machine 'WS08-1' does not have an open session". What am I missing?

Many thanks,
-T

p.s., if this helps:

Code: Select all

# su tony -c "VBoxManage showvminfo WS08-1"
VirtualBox Command Line Management Interface Version 3.0.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Name:            WS08-1
Guest OS:        Windows Vista
UUID:            f63fef94-37af-447c-8f3c-1056a76c69aa
Config file:     /export/tony/.VirtualBox/Machines/WS08-1/WS08-1.xml
Memory size:     512MB
VRAM size:       32MB
Number of CPUs:  2
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
PAE:             on
Time offset:     0 ms
Hardw. virt.ext: on
Nested Paging:   off
VT-x VPID:       off
State:           powered off (since 2009-08-11T02:45:38.000000000)
Monitor count:   1
3D Acceleration: off
Floppy:          empty
SATA:            enabled
SATA 0:          /export/home/VirtualBox/VDI/VirtualWin2008.vdi (UUID: 8bb842de-a2a1-413d-9a9b-e17f91432b49)
IDE Controller:  PIIX4
DVD:             empty
NIC 1:           MAC: 080027C97FF6, Attachment: Bridged Interface 'eth0.5', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported spee
d: 0 Mbps
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
UART 1:          disabled
UART 2:          disabled
Audio:           disabled
Clipboard Mode:  Bidirectional
VRDP:            enabled (Address 0.0.0.0, Port 5011, MultiConn: off, ReuseSingleConn: off, Authentication type: null)
USB:             disabled

USB Device Filters:

<none>

Shared folders:  <none>

Guest:

Statistics update:                   disabled

Re: Headless shutdown problems

Posted: 11. Aug 2009, 09:42
by frank
Is there a VBoxSVC daemon running as user todd?

Re: Headless shutdown problems

Posted: 11. Aug 2009, 20:20
by ToddAndMargo
Frank Mehnert wrote:Is there a VBoxSVC daemon running as user todd?

Code: Select all

$ ps axl | grep -i vbox
F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
0   500  6631  6614  15   0   9716  2540 -      S    ?          0:00 /usr/lib/virtualbox/VBoxXPCOMIPCD
1   500  6638     1  15   0  16768  5816 stext  Sl   ?          0:00 /usr/lib/virtualbox/VBoxSVC --automate
But, only after I run "/usr/bin/VirtualBox". Problem: I fire off my VM at rc3/5.d S99.xxxx and never run "VirtualBox"
if or until I fire up my GUI (X).

Do you have any suggestions? Should I fire off "/usr/lib/virtualbox/VBoxSVC --automate" as "Todd" in S99?

-T

Re: Headless shutdown problems

Posted: 12. Aug 2009, 04:21
by ToddAndMargo
You called it. I make sure it is running in my rc.local.shutdown before sending the acpipoweroff

Thank you so much!

-T