Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with QEMU/KVM #44

Closed
hlef opened this issue Feb 12, 2021 · 7 comments
Closed

Compatibility with QEMU/KVM #44

hlef opened this issue Feb 12, 2021 · 7 comments

Comments

@hlef
Copy link
Contributor

hlef commented Feb 12, 2021

Is Lupine currently compatible with QEMU/KVM? Current configurations seem to work only on Firecracker.

@hlef
Copy link
Contributor Author

hlef commented Feb 15, 2021

It seems that a few configuration options are missing to support virtio-blk drives:

CONFIG_PCI=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BLK_SCSI=y

This one might also be needed:

CONFIG_VIRTIO_PCI_LEGACY=y

@Moses20
Copy link

Moses20 commented Feb 18, 2021

Same problem here.

@hlef were you able to get it to run on QEMU/KVM? If so, could you comment the line command in here?

@hlef
Copy link
Contributor Author

hlef commented Feb 18, 2021

Yes, I managed to get it running on QEMU/KVM. You need to use the compressed kernel (Firecracker uses uncompressed kernels).

You can pass the usual ext2 filesystem using -drive (virtio-blk-pci, format raw).

For networking, the usual tap works.

For the kernel command line, pass something like

root=/dev/vda rw console=ttyS0 init=/guest_start.sh /bin/something

@Moses20
Copy link

Moses20 commented Feb 18, 2021

If I understand you correctly, I have to compress the vmlinux with gzip in order for QEMU to run the kernel.

So I executed the following command:
sudo qemu-system-x86_64 -nographic -kernel vmlinux.gz \ -drive "file=$FILE.ext2,format=raw,if=none,id=hd0" \ -device virtio-blk-pci,id=blk0,drive=hd0,scsi=off \ -append "console=ttyS0 root=/dev/vda init=/bin/bash"

Sadly, this command gets me stuck in "Booting from ROM..".

As you can tell, I am fairly new to QEMU and thankful for any help.

@hlef
Copy link
Contributor Author

hlef commented Feb 18, 2021

Oh, no, it's not only a matter of compressing the image, you should use vmlinuz-4.0.0 instead of vmlinux. :-)

Otherwise it looks mostly okay.

@Moses20
Copy link

Moses20 commented Feb 18, 2021

Thank you, the unikernel is up and running now.

Just one little problem: I want to be able to talk to the guest from outside the host. I tried setting up a tap, where the tap and interface are added to a bridge.

And then running Qemu with following two flags:

-netdev tap,id=mynet0,ifname=tap1,script=no 
-device virtio-net-pci,netdev=mynet0,id=nic0  

Do I have to do some extra stuff besides executing the 'guest_net.sh' to get access to my local network?

@hlef
Copy link
Contributor Author

hlef commented Feb 19, 2021

No, it should work like that.

@hckuo2 hckuo2 closed this as completed Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants