Guest: Ubuntu 18.04 (64)
Version: 5.2.20
Guest Additions: 5.2.20
Using python, I'm trying to execute a bash script in my Ubuntu guest
Code: Select all
#!/bin/sh
# Contents of first.sh
touch test.txt
Code: Select all
changePermission = runner.processCreate("/bin/chmod", ["+x", DEST_PATH], None, [virtualBoxManager.constants.ProcessCreateFlag_WaitForProcessStartOnly], 0)
changePermission.waitFor(virtualBoxManager.constants.ProcessWaitForFlag_Terminate, 0)
print("Permissions changed")
realExec = runner.processCreate(DEST_PATH, None, None, [virtualBoxManager.constants.ProcessCreateFlag_WaitForProcessStartOnly], 0)
realExec.waitFor(virtualBoxManager.constants.ProcessWaitForFlag_Terminate, 0)
I manually changed the permissions of the file, and ran again after commenting out lines 40-43. This time, no exceptions occurred and the code exit cleanly, however, the script did not get executed either, as evident from the absence of test.txt.(-2147352567, 'Exception occurred.', (0, 'GuestProcessWrap', 'VERR_ACCESS_DENIED', None, 0, -2135228411), None)
Also, and I think this is a bug, I had to comment out lines 53-56 from because fileExists() does not return False (as it should) if the file does not exist, and instead raises
(-2147352567, 'Exception occurred.', (0, 'GuestSessionWrap', 'No such file or directory on guest', None, 0, -2135228411), None)