Primary Guest: Debian 7.1 (kernel 3.2, i686). No X11, intended to run headless.
Secondary Guest: Debian 6.0.6 (kernel 2.6, i686). Has X11.
VirtualBox version 4.2.16
Both guests are running GuestAdditions 4.2.16
From my host machine, I need to be able to start a script on the guest. The script on the guest will need to change some files on the guest, for instance /etc/hostname. The intent is to make on the order of two hundred clones of the guest VM and then use this script to make each clone slightly different from all the others. I've been trying to use vboxmanage guestcontrol execute to get this guest script working, but I've had only marginal success. I have been trying this with a test script as opposed to my intended script just to keep things simple; the types of calls being made from the test script and the intended script are the same (open a file, write to a file, close the file).
1. I've read VirtualBox's manual on guest control
2. I've read some helpful forums on the topic and made changes like upgrading my GuestAdditions so they matched the same version of VirtualBox that I'm running (both are now 4.2.16)
3. I've turned on verbose
4. I've redirected STDOUT
5. I've verified that the script I'm trying to run works perfectly when I run it from the guest with the same admin credentials
6. I've tried using non-admin credentials (after placing the test material in a non-admin controlled location and changing permissions/owner accordingly)
7. I've used top to verify that VirtualBox does something when I run the command
8. I've tried all of this on Debian 6.0.6 also to see if I'd get a hint, but received no additional information
Unfortunately, I still can't seem to get the call from the host to actually get the guest script to make any changes to the file I've requested it change.
Here's the process. I make the call in Win7's cmd prompt:
Code: Select all
vboxmanage guestcontrol "clone10" exec --image "/opt/unique_scripts/test.py" --username foo --password bar --verbose --wait-stdoutCode: Select all
Waiting for guest to start process ...
Waiting for process to exit ...
*****INSIDE TEST.PYExit code=0 (Status=500 [successfully terminated])Code: Select all
#! /usr/bin/env python
print "\n\n*****INSIDE TEST.PY"
with open("temp", "w") as f:
f.write("Make a change.")
f.closed
I should mention that the guest I really need to get working--Debian 7.1--is headless. I therefore installed GuestAdditions with the -nox11 flag, and got the warnings that it couldn't install the Window Drivers, but I know that that is normal. I don't really care if it works on Debian 6.0.6, I just tried it there to see if I could get any hint. It's Debian 7.1 that I need to be able to modify using scripts that are started by a call from the host.
Any input would be greatly helpful. If you would like more information, please let me know and I'll do my best to get it to you. Thank you!