Question

I need to force Xen virtual machine to run a program. Thus, I'm looking for a way to make a script, which could be executed on the host machine and make VM to run the program

Also, there's a question - is it possible to automate configuring VMs to have them already got the executable I need (before starting the VM actually or, maybe, make it copy the executable just after start)?

Was it helpful?

Solution

There's quite a challenge to what you're asking here, and I don't think there's the easy answer you were hoping for. You'll need to use different techniques under different circumstances - in particular, whether you're running Windows in your VMs, or a particular Linux distribution or something else, and in addition, are you running XenServer, or some Linux-distribution version of Xen?

One technique is to modify the filesystem image of the VM prior to booting it. In that way, you can drop in a script into a Linux VM's init scripts which will run on boot; on Windows (which I'm less familiar with, sorry) you could add a registry key and a program to execute on startup, if you can find the tools to modify the Windows filesystem from your Linux dom0. A bit tricky.

Another technique is to present a virtual CD-Rom image to the VM, with an auto-run script. With modern OSs no longer just running whatever they find inserted, you will probably have to get the user to click it to run it, but depending on your situation that might be OK.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top