Running applications withing a VM from a host command-line

This is for discussing general topics about how to use VirtualBox.

Running applications withing a VM from a host command-line

Postby oloth » 8. Aug 2010, 19:25

In short, can I run an application from within a guest, just by specifying command line parameters to a vmanage from the host?

My clients send me a lot of untrusted applications that's why I use a persistent VM to run those, and that makes a it a lot of clicking within the VM.
Is there a possibility to execute applications inside the VM by running a shell script from the HOST?

Thank you in advance.
oloth
 
Posts: 8
Joined: 10. Nov 2009, 20:13
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: XP, Linux (Ubuntu), FreeBSD

Re: Running applications withing a VM from a host command-line

Postby stefan.becker » 8. Aug 2010, 19:40

VBoxManage guestcontrol execute Guest Command

For the exact syntax read User Manual.
stefan.becker
Volunteer
 
Posts: 7609
Joined: 7. Jun 2007, 21:53

Re: Running applications withing a VM from a host command-line

Postby oloth » 8. Aug 2010, 22:42

thanks a lot
I appreciate it
oloth
 
Posts: 8
Joined: 10. Nov 2009, 20:13
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: XP, Linux (Ubuntu), FreeBSD

Re: Running applications withing a VM from a host command-line

Postby HubTou » 9. Aug 2010, 01:15

Hello,

stefan.becker wrote:VBoxManage guestcontrol execute Guest Command


It's also possible to do it with "VBoxManage controlvm <uuid>|<name> keyboardputscancode <hex> [<hex> ...]".

On the minus side:
- You don't get any feedback on the command output (unless you redirect it somewhere (for example with output redirection, "tee" or "script" on Unix guests) and use other commands to analyse it)

On the plus side:
- It works without Guest Additions (GA)
- It always work, even when you're installing the OS inside the guest (too early to have GA inside)
- It's not limited to actions on commands (for example, you can send events to GUI apps)

You'll find a small shell library to ease the use of scancodes and a whole example in which an host controls the installation and configuration of an OS in a Guest there:
http://www.projet-hev.org/dist/generateur1.tar.bz2

Best regards,

Hubert
HubTou
 
Posts: 93
Joined: 24. Nov 2009, 11:01
Primary OS: FreeBSD
VBox Version: OSE other
Guest OSses: FreeBSD, OpenSolaris, and several Linuxes

Re: Running applications withing a VM from a host command-line

Postby oloth » 9. Aug 2010, 21:02

Thank you for the additional info,
that's really works for me,
Thanks
oloth
 
Posts: 8
Joined: 10. Nov 2009, 20:13
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: XP, Linux (Ubuntu), FreeBSD

Re: Running applications withing a VM from a host command-line

Postby HubTou » 10. Aug 2010, 01:04

Hello,

Here's a little video capture of my generator running in debug mode plus VNC display (both are not needed):
http://www.projet-hev.org/dist/hev1.flv

The OS is installed twice (the first time in a small 1GB swap-less rescue partition, the second time in the main partition) and with very little configuration (because there's a second generator which takes care of that). The disk geometry and the partitions sizes are input parameters...

Best regards,

Hubert
HubTou
 
Posts: 93
Joined: 24. Nov 2009, 11:01
Primary OS: FreeBSD
VBox Version: OSE other
Guest OSses: FreeBSD, OpenSolaris, and several Linuxes


Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 12 guests