1

I want to run OpenSUSE as guest with a custom kernel image which is on my host machine. I'm trying:

$ qemu-system-x86_64 -hda opensuse.img -m 512 -kernel \
    ~/kernel/linux-git/arch/x86_64/boot/bzImage -initrd \
    ~/kernel/linux-git/arch/x86_64/boot/initrd.img -boot c

But it boots into BusyBox instead. Using uname -a shows Linux (none). How do I tell the kernel image to boot with OpenSUSE?

I have OpenSUSE installed intoopensuse.img, and:

$ qemu-system-x86_64 -hda opensuse.img -m 512 -boot c 

boots it with the stock kernel.

  • If you use absolute paths instead of the ~'s does that make a difference? – slm Sep 10 '13 at 1:44
  • I don't think so. Still, I tried with absolute paths and it didn't work. – Varad Sep 12 '13 at 17:47
1

I would try this version of the command line which includes an argument to the booting Kenel telling it where to find the /dev/sda that you told qemu about:

$ cd ~
$ qemu-system-x86_64 -m 512 -s -hda opensuse.img \
     -kernel kernel/linux-git/arch/x86_64/boot/bzImage \
     -initrd kernel/linux-git/arch/x86_64/boot/initrd.img \
     -append "root=/dev/sda"

References

  • Or, more precisely, you need to tell the kernel and initrd which is the root file system. If opensuse.img is a disk image, the root filesystem is lilely to be a partition, like /dev/sda1. Check the grub.cfg in there to get the correct kernel command line. – Stéphane Chazelas Sep 10 '13 at 7:07
  • I have tried this, but it still boots up with BusyBox and uname -a results in Linux (none) rather than OpenSUSE. Is there a way to edit the grub.cfg file so that it takes in the kernel that is kept on my host machine (i.e. without requiring me to copy the kernel to the virtual machine)? – Varad Sep 12 '13 at 17:45

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.