Erwan Velu wrote: > Hey folks, > I saw the lastest qemu support pxe so I tried it using the following > command: > > qemu -hda /tmp/a.img -net nic n- user -boot n > > Note that now qemu support pxe mode, the mandatory -hda option is no > more mandatory but this is not directly linked to my patch. > I saw qemu integrates a dhcp & a tftp server but they don't seems to > be configured/developped for a pxe boot process. > Qemu says "no filename" and exits. Hi Erwan, I really like the idea of your patch. Of course, the hard coding is not really reasonable :-) Also, PXE is an x86-ism. What you've really done is added a mechanism to publish a BOOTP name. We do need to add a new option too as one may want to use -boot n without publishing a BOOTP filename. Using your patch as a basis, I've written three patches. The first one is the tsize negotiation fix for the TFTP server. The second adds a -bootp option for specifying the location of the BOOTP image. The third changes the -tftp option to take root directory. The end result, is that now you can say: qemu -hda /tmp/a.img -boot n -tftp ~/tftpboot -bootp /pxelinux.0 And you get the same results without the hard coding. What do you think? Regards, Anthony Liguori > A friend of I asked me "how do you boot using pxe in qemu when you > don't have a dhcp & a tftp server ?". > So I started to look how we can do that, I modified bootp to catch the > field 60 of a dhcp request to find if its a pxe request or not. > If yes, I set the filename to "/pxelinux.0", currently this is > harcoded, maybe you can help me to find a better way to specify a > bootloader. > > Then, I've patched the tftp server to change the default rootdir in my > home dir. "~/tftpboot". This is just for a Proof-of-concept, other > methods could be fine. We can also imagine searching in a path > restricted to the admin and then in the user dir. So it can give the > admin the ability of defining some pxe boot for all the vm of a > system or in the user dir if the user wants to have a special pxe > boot scheme. > > The last patch I did on the tftp server, is to allow the tsize > negociation because pxelinux needs it. > > This patch apply to 0.9.0, once it is applied and compiled here come > the test procedure: > > create a ~/tftpboot/pxelinux.cfg directory > copy pxelinux.0 in ~/tfptboot/ > create a pxelinux configuration file called "default" in > ~/tftpboot/pxelinux.cfg > > Et voila ;) > > Just call "qemu -hda /tmp/a.img -net nic n- user -boot n", it will > start pxelinux. > > I think this patch is very usefull because it give users & admin the > ability to use pxe inside the VM without installing the full > configuration (dhcp,tftp). > This patch is mainly a proof-of-concept, this patch can be improved, > comments and feedback are welcome. > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel >