LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   emulate slackware install over serial console using kvm/qemu (http://www.linuxquestions.org/questions/slackware-14/emulate-slackware-install-over-serial-console-using-kvm-qemu-716850/)

[GOD]Anck 04-04-2009 01:15 PM

emulate slackware install over serial console using kvm/qemu
 
I want to emulate Slackware installation over a serial console using kvm/qemu.

I did a similar installation with Debian Lenny, and was able to make that work by copying the vmlinuz and initrd.gz from the installation iso to a directory on the host, then starting the installation using qemu -nographic -kernel vmlinuz -initrd initrd.gz -append console=ttyS0. I'm not sure if that's really the best way but it worked.. :D

I tried to do the same for Slack so I copied /kernels/hugesmp.s/bzImage to a directory on the host and booted with qemu -nographic -kernel bzImage -append console=ttyS0. Console output redirection works fine, but the kernel panics:

Code:

VFS: Cannot open root device "<NULL>" or unknown-block(8,2)
Please append a correct "root=" boot option; here are the available partitions:
0300    5242880 hda driver: ide-disk
1600    3838730 hdc driver: ide-cdrom
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,2)

There is no root fs to mount yet, hda is an empty qemu image.. how do I make this work? Am I even using the right boot kernel?

grunt547 04-04-2009 01:59 PM

It needs the root file system on the CD to finish booting. That won't be the eventual / on the installed system, but it will be while you run from CD. Give it a "root=/dev/hdc" option to point it at the CD and see if that works.

[GOD]Anck 04-04-2009 02:51 PM

Okay, adding root=/dev/hdc got me a bit further, filesystem gets mounted but the kernel can't find init:

Code:

VFS: Mounted root (iso9660 filesystem) readonly.
Freeing unused kernel memory: 424k freed
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

I've tried adding init=/sbin/init and also init=/bin/sh to get a shell but neither could be executed. Where does init live?

grunt547 04-04-2009 04:02 PM

Well, when I boot my Slack disk, it's in /sbin/init, and also symlinked to the root dir as /init. Further, /sbin/init is the kernel's default, so it should be trying to do that anyway. I'm not sure why it can't find your init.

I hate to say it, but double-check that you have the first disk in (sorry). Also, does the kernel panic message look different at all when you add init=/bin/sh?

Alien Bob 04-04-2009 04:17 PM

Whenever I want to test a new initrd.img I use this command:

Code:

qemu -kernel ./kernels/hugesmp.s/bzImage -initrd ./isolinux/imitrd.img \
    -append initrd="initrd.img load_ramdisk=1 prompt_ramdisk=0 rw SLACK_KERNEL=hugesmp.s

I have not yet tried installing over a qemu serial console but I see no reason why that should not work.

Eric

[GOD]Anck 04-05-2009 03:31 AM

Ah there we go, I wasn't loading the initrd.img from /isolinux, adding that fixed it. Thanks!


All times are GMT -5. The time now is 10:55 AM.