how to run program in guest OS

This is for discussing general topics about how to use VirtualBox.
Post Reply
f-x
Posts: 1
Joined: 29. May 2009, 11:18
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Debian, MS Windows XP

how to run program in guest OS

Post by f-x »

Hi,
I'm working on a project which consist to automate VM creation. That's mean :
- to create the VM
- to add hardware
- to add OS
- to install software
- to configure network
I'm using the VirtualBox main API with java(Jax-WS) to do that.
Now, I need to run programs in guest in order to install softwares. But, it seems API does not provide tools to do that!

Is somebody know how to do this ?

PS : I'm French : sorry for my English !
HolgerB
Posts: 58
Joined: 28. Jul 2008, 23:36

Re: how to run program in guest OS

Post by HolgerB »

Hey f-x,

no need to excuse for your English. It´s perfectly readable.
Unfortunately you are not very specific about your scenario.
E.g. what kind of OS will by installed. I haven´t tinkered
around with the VBox API but there are multiple approaches
for this scenario. If you want to install certain programs
during a Windows Installations within the VM, you could integrate
them into your Win boot ISO with tools like NLite. You could also
use tools similar to psexec to lauch setup programs within your
VM in silent mode.

See here for details:
http://technet.microsoft.com/en-us/sysi ... 97553.aspx

Automated execution of AutoIt script after first startup could be another option.

For Linux guests on the other hands you could use simple shell scripts to connect to your guest via SSH and execute the tools of your choice.

Hope this helps somewhat,
Holger
asmlover
Posts: 1
Joined: 15. Nov 2009, 19:09
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: winxp,ubuntu

Re: how to run program in guest OS

Post by asmlover »

Is there VirtualBox API function to run program in guest OS?

Something as runProgramInGuest() in VMware commercial products?
Kristian Karl
Posts: 2
Joined: 21. Dec 2010, 11:00
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows

Re: how to run program in guest OS

Post by Kristian Karl »

Try:

Code: Select all

VBoxManage guestcontrol execute <vmname> <path to program>
You'll probably need to sett username and password for the guest as well.
HubTou
Posts: 93
Joined: 24. Nov 2009, 11:01
Primary OS: FreeBSD
VBox Version: OSE other
Guest OSses: FreeBSD, OpenSolaris, and several Linuxes

Re: how to run program in guest OS

Post by HubTou »

Hello f-x,
f-x wrote:I'm working on a project which consist to automate VM creation
I'm using the VirtualBox main API with java(Jax-WS) to do that.
Now, I need to run programs in guest in order to install softwares. But, it seems API does not provide tools to do that!
Is somebody know how to do this ?
Please have a look at:
f-x wrote:PS : I'm French
Tout pareil :wink:

Best regards,

Hubert
Post Reply