Skip to content

Running OSv image under KVM QEMU

Pekka Enberg edited this page Nov 11, 2013 · 17 revisions

Install dependencies

On Fedora:

sudo yum install libvirt

On Debian:

sudo yum install libvirt0

Download OSv image

wget http://downloads.osv.io.s3-website-us-east-1.amazonaws.com/qemu/osv-v0.03.qcow2

Create a KVM/QEMU networking bringup script

cat > qemu-ifup.sh << EOF
#!/bin/sh
echo SCRIPT, \$1
brctl stp virbr0 off
brctl addif virbr0 \$1
ifconfig \$1 up
EOF
chmod u+x qemu-ifup.sh

Start OSv under QEMU

sudo qemu-system-x86_64 -vnc :1 -gdb tcp::1234,server,nowait -m 2G -smp 2 \
  -chardev stdio,mux=on,id=stdio -mon chardev=stdio,mode=readline,default \
  -device isa-serial,chardev=stdio -drive file=osv-v0.03.qcow2,if=virtio,cache=unsafe \
  -netdev tap,id=hn0,script=qemu-ifup.sh,vhost=on -device virtio-net-pci,netdev=hn0,id=nic1 \
  -enable-kvm -cpu host,+x2apic
Clone this wiki locally