[virt-tools-list] How do the bootloader and kernel image both get transferred to the VM in the "Network install" option?

Richard W.M. Jones rjones at redhat.com
Tue Sep 11 15:45:18 UTC 2012


On Fri, Sep 07, 2012 at 07:19:44PM +0200, Marwan wrote:
> This might be a newbie question, but I thought this might be the most relevant
> place to ask.
> 
> >From my understanding of PXE, I know that there must be some negotiation first
> between the booting client and a DHCP server to obtain network parameters in
> order for the client to be able to fetch the boot loader and kernel image from
> the boot server. In other words, and aside from being a "virtual" machine,
> we're talking here about a "bare metal" machine, so there must be some "pre
> boot" mechanism for those negotiations to take place, and this is exactly
> what PXE is all about. When I think about the "Network install" option,
> I can't figure out how the new VM would be able to fetch the boot images
> (bootloader and kernel) without the previously mentioned mechanism. I mean to
> be able to do anything with the newly created machine (including launching
> the installer at the first place), there must be (1) a bootloader, and (2)
> a kernel image and initrd. So, what I am interested in, is how those images
> are get transferred to, and installed in the the newly created VM using the
> "Network install" option.

On emulated PC-like architectures ...

virt-install downloads the kernel and initrd.  It knows where to
download them relative to the URL you give it via a set of hard-coded
rules.  libvirt invokes KVM with the -kernel and -initrd options.

KVM then presents these files through a simple virtual hardware
interface called fwcfg (firmware config).  (fwcfg isn't really
documented, but someone did "reverse engineer" it from the sources the
other day -- unfortunately I cannot find that link right now).

The BIOS (SeaBIOS) knows how to query the fwcfg interface and load the
files and the kernel command line at a predefined memory location.  It
jumps to the kernel which finds the location of initrd (and the
command line?) via the multiboot spec.

It all works in different ways on other architectures.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/




More information about the virt-tools-list mailing list