Opened 15 years ago
Closed 15 years ago
#5413 closed defect (worksforme)
VBoxHeadless $? returns 0 on error
Reported by: | ToddAndMargo | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 3.0.10 |
Keywords: | Cc: | ||
Guest type: | Windows | Host type: | Linux |
Description
Hi All,
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=$?
Change History (3)
follow-up: 2 comment:1 by , 15 years ago
comment:2 by , 15 years ago
Replying to frank:
Can't reproduce the bug. The exit code is 5 here if such a condition is detected. I guess the problem is su $defaultUser. Try without su.
Oh poop. You are correct. I am reading the status of "su" and not VBoxHeadless. Sorry for the false report.
-T
Revised command:
Status="su $DefaultUser -c "/usr/bin/VBoxHeadless --startvm $VM_Name &" > $Log 2>&1; echo $?
"
comment:3 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Can't reproduce the bug. The exit code is 5 here if such a condition is detected. I guess the problem is su $defaultUser. Try without su.