13

I face this message:

Failed to execute /initKernel panic - not syncing: no init found. 
Try passing init=option to kernel.

I am using this command line:

qemu-system-x86_64 -hda disk.img -kernel /home/marssonubuntu/linux_qemu/linux-3.3.3/arch/x86/boot/bzImage -initrd my-initramfs.cpio -append "root=/dev/sda rdinit=/sbin/init"

on qemu, the full message is:

Failed to execute /sbin/init Kernel panic - not syncing: No init found. 
Try passing init= option to kernel. see Linux Documentation/init.txt for guidance. 
Pid: 1, comm: swapper Not tainted 3.3.3 #1 
Call Trace: 
[<ffffffff811d78b4>] ? panic+0xa9/0x197
[<ffffffff811d6927>] ? init_post+0xb2/0xb2
[<ffffffff812aad96>] ? kernel_init+0xff/0xff
[<ffffffff811dcd44>] ? kernel_thread_helper+0x4/0x10
[<ffffffff812aac97>] ? do_one_initcall+0x121/0x121
[<ffffffff811dcd40>] ? gs_change+0xb/0xb
Kiwy
  • 9,534
Ash
  • 141
  • I created new kernel image and running it on QEMU..but showing this error msg: "Kernel panic"

    I used this command: ["/linux_qemu$ qemu-system-x86_64 -hda disk.img -kernel bzImage -initrd my-initramfs.cpio"]

    Please help. Thanks

    – Ash Feb 26 '14 at 13:09
  • @Ash please [edit] your question to add any information that could lead to solving your issue, the message you send us can be caused by thousand of things, we are not going to enumerate so you can check one after one. – Kiwy Feb 26 '14 at 13:16
  • I edited my question with the required details, please have a look. thanks. – Ash Feb 28 '14 at 02:53
  • Your kernel is built with initramfs support, right? – derobert Feb 28 '14 at 17:13
  • Kernel is supporting initramfs..... – Ash Mar 03 '14 at 12:37
  • General howto question: http://unix.stackexchange.com/questions/47619/load-linux-bzimage-in-qemu – Ciro Santilli OurBigBook.com May 20 '15 at 14:15
  • Seems to me as if the root-fs is not reachable by the kernel. Is the fs-image really installed at /dev/hda as specified in the kernel boot parameters? Should this possibly be /dev/sda ? Providing the first bunch of boot log lines would be helpful. – gerhard d. Feb 22 '16 at 07:52

4 Answers4

13

I used:

qemu-system-x86_64 --enable-kvm -m 1024 -machine smm=off -cdrom mint.iso -boot order=d mint_hdd.img

Specifying RAM size i.e.

-m 1024

fixed this issue and booted into mint successfully.

garethTheRed
  • 33,957
4

I had this issue, and increasing the guest's RAM fixed it. Try passing -m 1024.

Michael Mrozek
  • 93,103
  • 40
  • 240
  • 233
0

Ok, here is my Qemu command line:

KERNEL=vmlinuz-2.6.32-5-686
INITRD=initrd.img-2.6.32-5-686
APPEND="root=/dev/sda2 ro "
IMG=qemu.img
qemu -kernel $KERNEL -initrd $INITRD -append "$APPEND"  -hda $IMG

$ file $IMG $INITRD $KERNEL
qemu.img: DOS/MBR boot sector
initrd.img-2.6.32-5-686: gzip compressed data
vmlinuz-2.6.32-5-686:    Linux kernel x86 boot executable bzImage
  • Thanks for sharing the command line. well, I am still having the same problem. I a using this command line: [qemu-system-x86_64 -hda disk.img -kernel /home/marssonubuntu/linux_qemu/linux-3.3.3/arch/x86/boot/bzImage -initrd my-initramfs.cpio -append "root=/dev/sda rdinit=/sbin/init"]. The message shows like this....

    Failed to execute /sbin/init Kernel panic - not syncing: No init found. Try passing init= option to kernel. see Linux Documentation/init.txt for guidance. Pid: 1, comm: swapper Not tainted 3.3.3 #1 Call Trace: [] ? panic+0xa9/0x197

    – Ash Feb 28 '14 at 01:42
-1

I had the same problam and I managed to build mini Linux following the steps below.

Boot Mini Linux Test with Qemu

Steps in Building Base Mini Linux Distro

  1. Compile the kernel and see the result in terms of size of the compilation
  2. Create rootfs image (format as ext2 mke2fs for example) that will contain the root system and some basic programs (used busybox)
  3. Mount rootfs and create basic directories and files
  4. Compile busybox and install it inside the rootfs
  5. Check the kernel size (with or without modules enabled) and Ciar image (with mkdosfs applied to the image linux.img example) that contain linux.img grub or syslinux setting the boot process of the system
  6. After rootfs created and linux, copy for syslinux.cfg linux.img , bzImage, into the linux.img
  7. Applies the command sync syslinux to finish the linux.img image ;
  8. After all settings and installations test it with qemu, for example, the following command qemu linux.img
  9. If everything's OK, the system will boot to the basic shell.

But the current attempts can not enter the terminal ( shell )

I leave these steps here in case they can help someone or someone can help me.

terdon
  • 242,166
  • 1
    It is incredibly difficult to figure out what you are trying to say. Are you asking for further help on this issue? If so, you should not be posting this as an answer, but as a new question and referencing the old one. If you are trying to provide an answer, you should try to make your procedure make sense and be readable. – HalosGhost Jul 10 '14 at 00:26
  • 1
    For those who prefer code to prose, there is Minimal Linux Live :-) – Ciro Santilli OurBigBook.com May 20 '15 at 11:43
  • This is really unclear to me. There is just so much information missing. – Alex Mar 23 '17 at 06:51