zappy
zappy

Reputation: 2094

How to create qcow2 image of Linux kernel 4.1.1

I want to make a qcow2 image of Linux Kernel 4.1.1. I found the following to convert .img image

qemu-img convert -f raw -O qcow2 kernel.img kernel.qcow2

But how to get kernel.img file. I have tried making kernel 4.1.1,but it only produced a bzimage inside arch/x86/boot directory

I am new to linux image building and all... thank you for your time

Upvotes: 1

Views: 2396

Answers (1)

programingfrik
programingfrik

Reputation: 311

I think your question is a little mislead because I see that you're trying to use the kernel image as a hard disk image and it won't work that way. However I also understand that you want to test the kernel 4.1.1 on qemu and as I see it you have 2 choices:

  • to run a direct image1 (never used this):
    • compile your kernel image
    • create a hard disk image2.
    • run your virtual machine
  • or make a linux installation on a virtual hard disk (this is what I recommend you to do as the newbie I am):
    • create a hard disk image2
    • get an iso of the distribution you want to test (one that uses kernel 4 like fedora as you can see in their kernel package3) and put it an the command line of qemu "-cdrom blablabla.iso"
    • run the virtual machine to make the installation and you're done.

Qemu is a great project but the documentation is dispersed all over the internet so maybe for every step you'll have to make some searches. Maybe you can help to make better documentation like creating a tutorial on the wikibook4 "my first virtual machine" or something.

Upvotes: 1

Related Questions