Page 1 of 1

How to use "run --exe"?

Posted: 11. Oct 2019, 17:02
by BillsComputerStore
In the manual are some examples on how to use guestcontrol with "run --exe"
From the manual: run --exe "/bin/ls" --username foo --passwordfile bar.txt --wait-exit --wait-stdout -- -l /usr
Lets say instead of "-l /usr" I use "-lah /usr"
Here I don't get the correct output. I only get a list, never with the correct formatting or for example the file-size information.
Many other commands that use arguments are not working as well.

Why is that? What is the correct way to use "run --exe" with arguments after the last " -- "?

And also how to use quotation-marks correct here?
"-lah" "/usr" or "-lah /usr"
Or none? But some of my commands require quotation-marks.

I used:
VBoxManage guestcontrol testvm run --exe "/bin/ls" --username super --password superpass -- "-lah" "/usr"

I use the correct user credentials and I don't want do use SSH or any other solution for this.

Re: How to use "run --exe"?

Posted: 12. Oct 2019, 00:00
by fth0
BillsComputerStore wrote:VBoxManage guestcontrol testvm run --exe "/bin/ls" --username super --password superpass -- "-lah" "/usr"
In the VirtualBox User Manual, the examples do not match the command specification. Try VBoxManage guestcontrol testvm run --exe "/bin/ls" --username super --password superpass -- ls -lah /usr ;)

Regarding the quotes: Each argument of your commands should be quoted separately. In the example above, "ls" "-lah" "/usr" doesn't need the quotes.