I am running qemu first time so I don't have much knowledge of it.

I am having a kernel module hello.ko and I want to insert it in kernel using insmod in an OS running in qemu and this module is stored in a folder which is on host system. So is there a way to run this module on guest system or I need to share it with guest system and then test it?

I searched on google there was a solution which first creates isoimage and then create virtual machine:

genisoimage -o image.iso -r /path/to/dir
virsh attach-disk guest image.iso hdc --driver file --type cdrom --mode 

where guest is virtual ID of virtual machine.

But in my case virsh list --all gives empty output so I think there is no virtual machine. I run qemu using

qemu-system-x86_64 -kernel bzImage -hda qemu-image.img -initrd initrd.img- 
4.9.1 -append "root=/dev/sda single" -m 2GB

where qemu-image.img is created using sudo debootstrap --arch amd64 stretch $DIR where is $DIR is a folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.