![]() ![]() PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz # This is free software, licensed under the GNU General Public License v2. If someone want to try i can share my makefile # I didn't run a benchmark yet, but the guest is performing really well so far. Qemu-system-x86_64 -enable-kvm -cpu host -smp 2 -m 2G \ To automatically start the VM at boot and shutting it down cleanly before a reboot, I created this init script: #!/bin/sh /etc/rc.common That's it, if your guest uses DHCP it should receive an address by the server running in br-lan. ![]() The network backend is of type bridge and br=br-lan tells it to connect to the bridge network br-lan of the OpenWrt host. Line 3 creates a virtio net device with a fixed MAC address and is told to use the network backend with id=br0, which gets created in line 4. drive file=/dev/sda,cache=none,if=virtio,format=raw \ ![]() The complete command looks like this: qemu-system-x86_64 -enable-kvm -cpu host -smp 2 -m 2G \ ![]() Just use a distribution that comes with virtio drivers by default. In my example the guest is a Debian Stretch installation on /dev/sda, but you can use an image as well. If you install these packages via opkg, reboot afterwards. If your hardware supports it, also install kmod-kvm-amd or kmod-kvm-intel for better performance. You need the following packages on your device: kmod-tun qemu-bridge-helper qemu-x86_64-softmmu. Using that, you can connect the guest to every bridge network of your OpenWrt host (every Interface with option type 'bridge'). Previously I often had problems setting up the network between guest and host, but I realized that it's really easy with OpenWrt and qemu-bridge-helper and I wanted to share a quick recipe. For a project I want to host a QEMU guest on a x86 device running OpenWrt (maybe I'll write a more detailed post about what I'm doing later). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |