From: Stefan Hajnoczi <stefanha@gmail.com>
To: Shlomi Tsadok <tsadok@gmail.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: Invoking guest os script, without guest having network connectivity?
Date: Mon, 26 Nov 2012 12:06:00 +0100 [thread overview]
Message-ID: <20121126110600.GD963@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <CANbGLCGMBBKAKe6FZYY8QsRp8SYTYj4FoJ7S3wBDg1qGaCnCyg@mail.gmail.com>
On Sat, Nov 24, 2012 at 06:40:39PM +0200, Shlomi Tsadok wrote:
> I'm looking for a way to configure the guest networking(including IP)
> dynamically, using a custom script, right after VM creation.
>
> Is there a similar feature in KVM/Libvirt as the Invoke-VMScript in of
> VMware's PowerCLI?
> It allows you to run a script in the guest OS, even before the guest
> has networking connectivity (the host talks to the vmtools agent
> that's installed in the guest).
The QEMU guest agent (qemu-ga) has features that may allow you to do
this. I'm not familiar enough with it to give details, here are some
alternatives:
If you provide a kernel + initramfs externally (outside the guest disk
image) you can add files to the initramfs. This allows you to customize
boot up.
Alternatively you can use PXE booting to achieve the same thing.
Finally, you could edit the disk image using libguestfs or qemu-nbd
before booting it for the first time. This gives you a chance to
customize configuration and startup files.
Stefan
prev parent reply other threads:[~2012-11-26 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-24 16:40 Invoking guest os script, without guest having network connectivity? Shlomi Tsadok
2012-11-26 11:06 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121126110600.GD963@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=tsadok@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox