How do I boot a virtual machine image from my network?

I have many machines which require the same configurations. My goal is to boot them all from the network and load a virtual machine. It would be wonderful to have one image for all of our customer service machines. That way, I could load the virtual image, perform updates, and know the next time they boot up they will have all the changes. Ideally, the machines would store the image locally and only download a new image if there has been a change.

With all the information out there on "desktop virtualization", "PXE booting", and "virtual machines", I feel lost. I have been reading for hours and feel like I have only just scratched the surface.

I would like to do this using open source or free software. Any suggestions?


You are combining two things: (1) diskless booting which is common in HiPC clusters, where tools like compilers, libraries, etc, are stored on a clustered file system like Lustre or NFS; (2) virtual disk images (vmdk or vdi, or whatever else).

In case (1), you need a tftp server and a dhcp server, along with a modified initrd image for customized drivers, scripts, etc.

http://www.pixelchaos.net/2009/02/15/diskless-booting-with-pxe-and-nfs/

In case (2), given all machines are same, including configurations, you can nfs mount the virtual disk image. Write a script that checks for any changes like whether the existing image is same as nfs mounted; if they are not same, copy this image to boot partition and reboot it. You need to add this script in initrd. You can play with that.

http://www-conf.slac.stanford.edu/afsbestpractices/Slides/afsboot.pdf

The paper above gives you some clues. You better focus on how the whole boot process works, etc.

If you are using ESXi, there is a better way to achieve what you want: export nfs to esxi hosts. Keep the vmdk and -flat.vmdk files on the nfs server, and change vmdk location in .vmx file. During the next boot, it picks up your new image.


First let define some terms you are messed up.

PXE Booting:

It's an utility that replace the BIOS and it's capable of networking. Such as a diskless computer that download a kernel image from a server and execute it. After the kernel mount a distant partition as the root filesystem.

Virtual machine:

A virtual machine is a machine run by software. If I work on a particular OS then I can run the a VM to boot another OS without rebooting. There is some OSes that are dedicated to virtualisation. The virtual machine is not an answer for your problem.

Ok now I'll explain what I suggest, I did not work with it and I think it's not free software, but you should try to find a replacement. Northon Ghost is a PXE that boot up before the principal OS to check if the disk image is the same of what is on the server. If I come to a computer like that and clear out the OS, and reboot...the OS will be recovered by the server, but not the data.


I don't think you can do this with Free software and avoid hours and hours of reading. In fact I don't think you can do it with the "shiny pay for" software easily either. It's difficult & time consuming to understand all the ins and outs because its difficult & time consuming to configure all the ins and outs.

You're looking for something like netboot.me I think. Making things like this work on a couple of machines in the lab isn't difficult. You'll find making it work all across a complex routed LAN somewhat more complex - we use Apple's variation of this to run an installer to install our standard OSX desktop image on to mac workstations.

Desktop Virtualisation, by the way, is something totally different from what you actually describe yourself as wanting to do. It might well be a valid method of solving the problem you are looking at, but I'd try not to consider it at the same time as you consider this way of going about things - you'll only make the problem more difficult to understand than it needs to be.


I had the same problem some time ago and I used pxe successfully.

What You are looking for is gPXE (free). It is a bit of a hassle to set up, but You boot from an ftp server or iSCSI for example. If you boot from local lan, You can also use ata over ethernet (AOE). PXE can be started from any bootable drive about the size of a floppy or from boot rom if applied to the NICs.

You would start from the image or load the image into ramdisk via tftp or ISCSI or whatever and run the image from there. Or You give each VM it's own target and leave it that way.