VMware Communities > VMTN > General > Technology & Industry > Discussions

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
3 Replies Last post: Apr 20, 2009 5:31 AM by Texiwill
Reply

would like to script start of VM, so as to launch specific process after vm started?

Apr 15, 2009 10:19 PM

Click to view gank211's profile Novice gank211 7 posts since
May 19, 2007

As per the subject, I am looking for a VM technology(ies) where I can write a script in the general OS that will be able to launch the VM and to specify that process X inside the VM should launch after the VM is loaded/launch. For example - pseudocode:

var x = new VM (location of VM)

when (x.isLaunched){

x.runStartingProcess = "c:\runwhenlaunched.vbs -input " + y

}

x.launch

-the pseudocode above would assume you had a variable y that changed due to some user input. That input was then passed to the starting process inside the VM.

I suppose this is probably doable with some sort of virtualization technology, please point me to which virtualization technology can be used for this, and if you know some example code anywhere to look at that would be good too.

Thanks!

Reply Re: would like to script start of VM, so as to launch specific process after vm started? Apr 16, 2009 5:21 AM
Click to view AsherN's profile Hot Shot AsherN 214 posts since
Mar 10, 2009
Unless I'm missing something here, that can be accomplished on a Windows machine with an entry in the 'HKLM\software\windows\currentversion\run' hive of the registry.
Reply Re: would like to script start of VM, so as to launch specific process after vm started? Apr 18, 2009 9:33 AM
in response to: AsherN
Click to view gank211's profile Novice gank211 7 posts since
May 19, 2007

No. That's a static setting - at least as far as I've ever seen it used.

What I mean is I have a VM B sitting on Computer A running OS A, inside the VM I have OS B.

I want a script A on OS A to be executed to start VM B, and to specify that when VM B is loaded that it should start a process and pass it a particular set of parameters specified by Script A.

So if Script A takes ten different input parameters it can use those to decide exactly what parameters should be sent to a particular process in the VM. Thus the run settings in the registry doesn't work - I think - because Run is static. I can specify that Notepad must start at the beginning of every VM start, but I can't dynamically pass it text when it starts.


Reply Re: would like to script start of VM, so as to launch specific process after vm started? Apr 20, 2009 5:31 AM
in response to: gank211
Click to view Texiwill's profile Guru Texiwill 10,056 posts since
Jan 13, 2004
Moderator
Hello,

You will look at using the VMware VI and VIX SDKs to achieve your ends. Note however that VIX (which allows you to run commands/programs within in a VM) is very easy to disable as well. from a security perspective this would be disabled.


Best regards,
Edward L. Haletky
VMware Communities User Moderator, VMware vExpert 2009
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast
Actions