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:

| - pxelinux.0
| - pxegrub.0
| - pxelinux.cfg
    | default
| - boot
    | grub

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

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
  • In the grub rescue mode I tried "ls" command which shows me the root as (pxe). ls(pxe) gives me blank output – user39617 May 21 '13 at 22:59
  • If running/testing grub is the endgame this will be irrelevant, but otherwise you could use qemu's built-in pxe server and/or iPXE 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 the initramfs/kernel and client drive on the host and boot them directly in qemu. – mikeserv Jun 7 '14 at 1:31

grub-mkimage creates a GRUB 2 image, not a GRUB Legacy image. grub rescue> is also a sign that you’re booting GRUB 2.

You should be loading stage2 instead of pxegrub.0 here.

Some versions of GRUB Legacy are netboot-enabled, but to suggest which to use and from where, I’d need to know your OS, or possibly at least which QEmu network card model you emulate (MirBSD’s got a number of precompiled GRUB Legacy netboot-capable images).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.