Skip to content

Instantly share code, notes, and snippets.

View tpepper's full-sized avatar
🏠
Working from home

Tim Pepper tpepper

🏠
Working from home
View GitHub Profile
@mcastelino
mcastelino / qemu_vhost.md
Last active February 23, 2024 08:59
QEMU Tips and Tricks

How to launch QEMU from command line without libvirt with macvtap and vhost support

This sets up a host local bridge with a macvlan interface for VM to host communication. The macvtap is setup with vhost support.

The command line options to note are

-netdev tap,fd=3,id=hostnet0,vhost=on,vhostfd=4 3<>$"$tapdev" 4<>/dev/vhost-net -device virtio-net-pci,netdev=hostnet0,id=net0,mac=$(< /sys/class/net/testtap/address)

This sets up two different fd's. The first for macvtap and the second for vhost-net.