Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to script qemu?

Tags:

qemu

I was wondering if it's possible to script qemu so that you can boot it up and automatically get it to run programs in the guest OS? In my case, that's Linux. Basically, I want to avoid having to interact with the guest so that I can perform a batch of experiments with condor or something similar.

I saw this question which suggests a method using python, but I'm wondering if there's any other way at all that is supported by qemu itself?

I don't want to do anything too fancy. Assuming automatic login on the guest to a simple shell, I was thinking of a script such as this:

cd <some_dir>
./experiment
scp result [email protected]:

Any ideas, otherwise I'll try out the python method above?

like image 506
Timothy Jones Avatar asked Mar 11 '11 10:03

Timothy Jones


Video Answer


1 Answers

The QEMU Monitor can interact with guest systems to a limited extent using its own console. This includes reading registers, controlling the mouse/keyboard, and getting screen dumps. There is a QEMU Monitor Protocol (QMP) that lets you pass JSON commands to and read values from the guest system.

like image 97
jeremiah Avatar answered Sep 29 '22 01:09

jeremiah