How to use "run --exe"?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
BillsComputerStore
Posts: 6
Joined: 5. Sep 2018, 13:08

How to use "run --exe"?

Post 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.
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

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

Post 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.
Post Reply