Ticket #5413 (closed defect: worksforme)
VBoxHeadless $? returns 0 on error
|Reported by:||ToddAndMargo||Owned by:|
Please fix this for me.
I run a script that essentially runs:
/usr/bin/VBoxHeadless --startvm VB-W7
If I set (deliberately or by accident) /dev/fd0 to root.root and 0400 and tell setup to mount the floppy, I get:
VirtualBox Headless Interface 3.0.10 (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
Listening on port 5014 Error: failed to start machine. Error message: Cannot open host device '/dev/fd0' for read/write access. Check the permissions of that device ('/bin/ls -l /dev/fd0'): Most probably you need to be member of the device group. Make sure that you logout/login after changing the group settings of the current user (VERR_ACCESS_DENIED). Unknown error creating VM (VERR_ACCESS_DENIED)
Which is what it is suppose to do.
Problem: VBoxHeadless returns 0 in $?, which means it ran successfully. This fools my scripts into thinking VBoxHeadless started the VM Successfully.
You can reproduce this with /dev/scd0 and telling setup to mount the DVD drive as well.
Many thanks, -T
p.s. the exact line in my script:
su $DefaultUser -c "/usr/bin/VBoxHeadless --startvm $VM_Name &" > /var/log/VM-Utils.log 2>&1 Status=$?