nanovms / nanos

A kernel designed to run one and only one application in a virtualized environment
https://nanos.org
Apache License 2.0
2.65k stars 137 forks source link

Question: How to run unikernel on generic kvm #1900

Closed packetq closed 1 year ago

packetq commented 1 year ago

Hi.

Is it possible to run a golang based unikernel on generic kvm (ie; without ops)?

Thanks, -S

eyberg commented 1 year ago

of course - if you start up ops, then see the output it generates via ps aux

eg: something like so:

qemu-system-x86_64 -machine q35 -device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x3 -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x3.0x1 -device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x3.0x2 -device virtio-scsi-pci,bus=pci.2,addr=0x0,id=scsi0 -device scsi-hd,bus=scsi0.0,drive=hd0 -vga none -smp 1 -device isa-debug-exit -m 2G -device virtio-rng-pci -accel hvf -cpu host,-rdtscp -no-reboot -L /Applications/qemu.app/Contents/MacOS/ -cpu max,-rdtscp -drive file=/Users/eyberg/.ops/images/g,format=raw,if=none,id=hd0 -device virtio-net-pci,netdev=vmnet,mac=d6:1d:0a:6c:3f:66 -netdev vmnet-bridged,id=vmnet,ifname=en0 -display none -serial stdio

you should prob. note that kvm is probably the most supported target we have since it is used in many places so unless you're building your own run tool or hacking on nanos itself it's probably going to be easier to use any of the existing targets