0

I saw this question and I did pretty much the same but I enabled initrd in configuration to use temporary root file system and no other modification but I still get this error on:

qemu -kernel linux-3.16.1/arch/x86/boot/bzImage

enter image description here

any suggestion about what cause this error or how can i fix it ?

3

The boot fails for the same reason as in the mentioned question - just booting a kernel without anything else doesn't do much good. You must provide a disk. Or an initrd image. But just enabling initrd doesn't give you an initrd image magically. You need to prepare one and provide it to qemu like so:

qemu-system-i386 -kernel <your kernel> -initrd <your initrd image>

It's quite likely that you need to provide a disk as well.

There are a dozen or so ways to create and use disks for qemu, so here I explain just a very simple approach (see here for more).

First create a file, e.g.

qemu-img create -f raw mydisk.img 1G

which will create a 1 GiB-disk.

You can use this like so:

qemu <other options> -hda mydisk.img

If your initrd expects something (like a usable system) on your disk, you need to fill it first by mounting it to the local host, e.g.:

losetup /dev/loop0 mydisk.img

you can treat /dev/loop0 like any other block device, i.e. you can run fdisk on it etc. Once you have created partitions and filesystems you can mount them and put there what you need.

An alternative approach is to use an installation ISO image and attch that as a CD-ROM, e.g.

qemu <other options> -hda mydisk.img -hdb myiso.img -boot d

This will boot you into the system on the virtual CD-ROM, from there you can modify your disk as you like.

  • I cannot possibly give an introduction to qemu on stackexchange. I have extended my answer to help you a bit further, but I suggest that you get familiar with qemu using "standard" setups first and try more esoteric setups later. – countermode Aug 18 '14 at 13:27
  • i created virtual hard with qemu-img create -f raw -o size=1G hardraw1.raw,and add -hda option to main comman,but it still goes to busybox – abolmabol Aug 18 '14 at 13:31
  • i think it is better to create new question. – abolmabol Aug 18 '14 at 13:34

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.