qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] requirements of root filesystem image when passed to qemu
@ 2008-06-12 17:14 Peter Teoh
  2008-06-13  0:34 ` [Qemu-devel] " Peter Teoh
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Teoh @ 2008-06-12 17:14 UTC (permalink / raw)
  To: qemu-devel

First, after installing debian (8.04) on a qemu image - debian.cow - I
then used it to mount the latest kernel:

qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda debian.cow -append
"root=/dev/hda console=ttyS0" -nographic

[    5.493332] 0300    1331200 hda driver: ide-disk
[    5.494978]   0301     248976 hda1
[    5.496151]   0302    1076355 hda2
[    5.497403] No filesystem could mount root, tried:  ext3 ext2 iso9660
[    5.499552] Kernel panic - not syncing: VFS: Unable to mount root
fs on unknown-block(3,0)

But when I downloaded the root filesystem image at:

http://bellard.org/qemu/download.html

for linux-0.2.img, and execute:

qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda linux-0.2.img -append
"root=/dev/hda console=ttyS0" -nographic

everything went through to the root prompt level, even though the
linux-0.2.img image has its own kernel version (0.2).   And I noticed
that (using "file"):

linux-0.2.img: x86 boot sector, LInux i386 boot LOader
debian.cow: QEMU Copy-On-Write disk image version 1, size 0 + 1363148800

Next, using another rootfs image:

file FedoraCore5-x86-root_fs
FedoraCore5-x86-root_fs: x86 boot sector

I run qemu successfully.

Next I entered ubuntu installation image:

ubuntu-8.04-desktop-i386.iso: ISO 9660 CD-ROM filesystem data UDF
filesystem data (unknown version, id 'NSR01') 'Ubuntu 8.04 i386
       ' (bootable)

qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda
ubuntu-8.04-desktop-i386.iso -append "root=/dev/hda console=ttyS0"
-nographic

And the result is:

[    6.136373] Unable to load NLS charset utf8
[    6.144019] VFS: Mounted root (iso9660 filesystem) readonly.
[    6.144826] debug: unmapping init memory c0795000..c07d4000
[    6.145575] Write protecting the kernel text: 2352k
[    6.146417] Write protecting the kernel read-only data: 1068k
[    6.147388] Warning: unable to open an initial console.
[    6.148323] Kernel panic - not syncing: No init found.  Try passing
init= option to kernel.

So what is the requirement for -hda then?   1.   presence of
bootsector image 2.   presence of /sbin/init???

Next I created the busybox rootfs image following this instruction:

http://dev.gentoo.org/~solar/busybox/bbemu

And run qemu as before, just substituting only the -hda option, it result in:

[    5.564894] debug: unmapping init memory c0795000..c07d4000
[    5.565539] Write protecting the kernel text: 2352k
[    5.565891] Write protecting the kernel read-only data: 1068k
[    5.656106] mount used greatest stack depth: 2240 bytes left
Bummer, could not run '/bin/sh': No such file or directory
Bummer, could not run '/bin/sh': No such file or directory
Bummer, could not run '/etc/init.d/rcS': No such file or directory
Bummer, could not run '/bin/sh': No such file or directory
Bummer, could not run '/bin/sh': No such file or directory
Bummer, could not run '/bin/sh': No such file or directory

Endless repetition here..

Why?

Why the difference?   (ie, why can't I mount the latest kernel on the
debian image)  How to resolve the error as shown above?

-- 
Regards,
Peter Teoh

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: requirements of root filesystem image when passed to qemu
  2008-06-12 17:14 [Qemu-devel] requirements of root filesystem image when passed to qemu Peter Teoh
@ 2008-06-13  0:34 ` Peter Teoh
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Teoh @ 2008-06-13  0:34 UTC (permalink / raw)
  To: qemu-devel

On Fri, Jun 13, 2008 at 1:14 AM, Peter Teoh <htmldeveloper@gmail.com> wrote:
> First, after installing debian (8.04) on a qemu image - debian.cow - I
> then used it to mount the latest kernel:
>
> qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda debian.cow -append
> "root=/dev/hda console=ttyS0" -nographic
>
> [    5.493332] 0300    1331200 hda driver: ide-disk
> [    5.494978]   0301     248976 hda1
> [    5.496151]   0302    1076355 hda2
> [    5.497403] No filesystem could mount root, tried:  ext3 ext2 iso9660
> [    5.499552] Kernel panic - not syncing: VFS: Unable to mount root
> fs on unknown-block(3,0)
>
> But when I downloaded the root filesystem image at:
>
> http://bellard.org/qemu/download.html
>
> for linux-0.2.img, and execute:
>
> qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda linux-0.2.img -append
> "root=/dev/hda console=ttyS0" -nographic
>
> everything went through to the root prompt level, even though the
> linux-0.2.img image has its own kernel version (0.2).   And I noticed
> that (using "file"):
>
> linux-0.2.img: x86 boot sector, LInux i386 boot LOader
> debian.cow: QEMU Copy-On-Write disk image version 1, size 0 + 1363148800
>
> Next, using another rootfs image:
>
> file FedoraCore5-x86-root_fs
> FedoraCore5-x86-root_fs: x86 boot sector
>
> I run qemu successfully.
>
> Next I entered ubuntu installation image:
>
> ubuntu-8.04-desktop-i386.iso: ISO 9660 CD-ROM filesystem data UDF
> filesystem data (unknown version, id 'NSR01') 'Ubuntu 8.04 i386
>       ' (bootable)
>
> qemu -kernel /boot/vmlinuz-2.6.26-rc5 -hda
> ubuntu-8.04-desktop-i386.iso -append "root=/dev/hda console=ttyS0"
> -nographic
>
> And the result is:
>
> [    6.136373] Unable to load NLS charset utf8
> [    6.144019] VFS: Mounted root (iso9660 filesystem) readonly.
> [    6.144826] debug: unmapping init memory c0795000..c07d4000
> [    6.145575] Write protecting the kernel text: 2352k
> [    6.146417] Write protecting the kernel read-only data: 1068k
> [    6.147388] Warning: unable to open an initial console.
> [    6.148323] Kernel panic - not syncing: No init found.  Try passing
> init= option to kernel.
>
> So what is the requirement for -hda then?   1.   presence of
> bootsector image 2.   presence of /sbin/init???
>
> Next I created the busybox rootfs image following this instruction:
>
> http://dev.gentoo.org/~solar/busybox/bbemu
>
> And run qemu as before, just substituting only the -hda option, it result in:
>
> [    5.564894] debug: unmapping init memory c0795000..c07d4000
> [    5.565539] Write protecting the kernel text: 2352k
> [    5.565891] Write protecting the kernel read-only data: 1068k
> [    5.656106] mount used greatest stack depth: 2240 bytes left
> Bummer, could not run '/bin/sh': No such file or directory
> Bummer, could not run '/bin/sh': No such file or directory
> Bummer, could not run '/etc/init.d/rcS': No such file or directory
> Bummer, could not run '/bin/sh': No such file or directory
> Bummer, could not run '/bin/sh': No such file or directory
> Bummer, could not run '/bin/sh': No such file or directory
>
> Endless repetition here..
>
> Why?
>
> Why the difference?   (ie, why can't I mount the latest kernel on the
> debian image)  How to resolve the error as shown above?
>
> --

That was the last stage of booting - /sbin/init was executed, and
endless repetition is due to the inittab's respawn mechanism.   and
instead of /bin/sh, which not sure was not created by bbemu, i changed
it to /bin/msh, and it goes into a prompt.

Thanks.



-- 
Regards,
Peter Teoh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-13  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-12 17:14 [Qemu-devel] requirements of root filesystem image when passed to qemu Peter Teoh
2008-06-13  0:34 ` [Qemu-devel] " Peter Teoh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).