I have been trying to boot grub legacy via qemu using pxe. For some reason, the grub does not display the menu and enters into the command mode after displaying the following error.
Error15: File not found.
grub rescue>
This is my directory structure:
/var/lib/tftpboot
| - pxelinux.0
| - pxegrub.0
| - pxelinux.cfg
| default
| - boot
| grub
|default
|fat_stage1_5
|menu.lst
|stage1
|device.map
|installed-version
|minix_stage1_5
|stage2
|e2fs_stage1_5
|jfs_stage1_5
|reiserfs_stage1_5
|xfs_stage1_5
|x86_64
Contents of pxelinux.cfg/default:
default vesamenu.c32
prompt 0
menu title Available Installations (scroll down for more options)
menu autoboot Starting grub2 in # Seconds
timeout 30
label local
menu label Boot From Local Disk
localboot 0
label grub
menu label grub
menu default
kernel pxegrub.0
menu end
Contents of menu.lst:
timeout 0
# spawnd is used to control which cpus are booted
#
# "spawnd boot" will use the skb and pci to figure out and
# boot all cores in the machine
#
# "spawnd boot bootapic-x86_64=1-5" will not use the skb and
# boot the list of cores passed as argument.
# The APIC id of the cores to boot should be specified.
# This list may not include the bsp core id.
title Barrelfish
root (nd)
kernel /x86_64/sbin/elver loglevel=4
module /x86_64/sbin/cpu loglevel=4
module /x86_64/sbin/init
# Domains spawned by init
module /x86_64/sbin/mem_serv
module /x86_64/sbin/monitor
# Special boot time domains spawned by monitor
module /x86_64/sbin/ramfsd boot
module /x86_64/sbin/skb boot
modulenounzip /skb_ramfs.cpio.gz nospawn
module /x86_64/sbin/kaluga boot
module /x86_64/sbin/acpi boot
module /x86_64/sbin/spawnd boot
#bootapic-x86_64=1-15
module /x86_64/sbin/startd boot
module /x86_64/sbin/routing_setup boot
# Drivers
module /x86_64/sbin/pci auto
module /x86_64/sbin/ahcid auto
module /x86_64/sbin/rtl8029 auto
module /x86_64/sbin/e1000n auto
module /x86_64/sbin/NGD_mng auto
module /x86_64/sbin/netd auto
# General user domains
module /x86_64/sbin/serial
module /x86_64/sbin/fish
module /x86_64/sbin/hellotest
module /x86_64/sbin/ahcialloctest
module /x86_64/sbin/idctest client
module /x86_64/sbin/idctest server
I used the following command to generate grub image:
grub-mkimage --format=i386-pc-pxe --output=grub.pxe --prefix='(pxe)/boot/grub' pxe pxecmd
grub
is the endgame this will be irrelevant, but otherwise you could useqemu
's built-inpxe
server and/oriPXE
firmware packages and link them through the host to whatever boot media/target you wish. Or you could just script the network pull/mount of theinitramfs/kernel
and client drive on the host and boot them directly inqemu
.