It will create an output similar to this: Qemu-img create -f qcow2 example.img 100M To mark a virtual machine for the autostart, type: virsh autostart openwrt.The standard command for creating a basic hard disk image is this. Remember that the console requires ctrl+5 to exit. network bridge=br0, model=e1000 -network bridge=br3, model=e1000 -import If you want to interact with the system from command line, use virsh.įor example to force the shutdown of a virtual machine virsh destroy openwrt or to delete the virtual machine (but not the disk file) virsh undefine openwrt. network bridge=br0, model=e1000 -import # be careful to the model, e1000 let's openwrt recognize the interface. disk path= /root /openwrt_kvm /openwrt-x86-generic-combined-ext4.img, bus=ide \ Virt-install -name=openwrt -ram= 256 -vcpus= 1 -os-type=linux \ We can issue the following command, using the x86 generic image placed in the folder /root/openwrt_kvm/: The additional packages, apart from QEMU, will help here. Then we need to create our virtual machine. Prepare debian (7.1 in the test) for virtualization Someone with more knowledge could explain why this happens but as workaround one can use a more complete linux system (for example Debian) as base and then virtualize ( virtualization OR qemu OR kvm OR hypervisor in the address bar) openwrt, that in the end requires really a little resources most of the time, or one can assign plenty of resources because at the end the base system is quite powerful.
Moreover software like Nmap will fail to be bind to certain interfaces. The request will be always routed to the interface with higher metric also using ping -I 8.8.8.8. OpenWrt is able to run on that system, but for example, is not able to manage the possibility of having two WAN connections with different metric. One of this x86 compatible hardware family are systems based on Intel Atom and ICH8M chipset (maybe also others), like the Lex twitter system 3I525U. Normally OpenWrt works on most of the hardware mentioned in the table of hardware (search in this wiki), and also on most of the hardware that support Intel x86 ISA or x86 in the address bar.Īnyway some embedded x86 board have particular hardware that is not always well supported by the OpenWrt platform, even if all the kmod packages are included in the basic image. This example uses OpenWrt virtualized using Debian, QEMU with KVM and a Lex twitter system with Intel Atom D525 and ICH8M chipset. Virsh attach-device my-machine- 1 /tmp /new-interface- 0.1.xml Advanced boot methods # Where the ‘0d:84:f4’ is 3 unique bytes dd status=none bs= 1 count= 3 if= /dev /urandom | hexdump -e '/1 "%x"\n' # cat /tmp/hostdev-net0.xml hostdev-net0 $ ( uuidgen ) This will take effect after the next reboot.Īlternatively by unloading and reloading the IGB module.Ĭreate XML files for each NIC you want to support virtualization on: (taken from mailing list post by Philip Prindeville) M virt -nographic -m 64 -kernel $IMAGE # cleanup, delete tap interface created earlier ip addr flush dev $LAN ip link set dev $LAN down netdev tap, id=lan, ifname= $LAN, script=no, downscript=no \ # configure interface with static ip to avoid overlapping routes ip addr add 192.168.1.101 / 24 dev $LAN # create tap interface which will be connected to OpenWrt LAN NIC ip tuntap add mode tap $LAN ip link set dev $LAN up Save the script and edit IMAGE variable to reflect your OpenWrt version, then run it under sudo #!/bin/sh IMAGE=lede-17.01.0-r3205-59508e3-armvirt-zImage-initramfs Note: This setup requires some privileges ( CAP_NET_ADMIN and CAP_MKNOD under Linux) so it's easier to run it under sudo (the example uses an armvirt system, adjust for your setup) If you want to check how LUCI works or to poke around with LUCI-apps this setup is for you. drive file=openwrt-armvirt- 64-rootfs-squashfs.img, format=raw, if=virtio \īoth variants provide two network interfaces to OpenWrt: Persistent (squashfs) variant (with openwrt-armvirt-64-Image and openwrt-armvirt-64-rootfs-squashfs.img): kernel openwrt-armvirt- 64-Image-initramfs \ Qemu-system-aarch64 -m 1024 -smp 2 -cpu host -M virt, highmem=off \ Non-persistent variant (with openwrt-armvirt-64-Image-initramfs): It is possible to use native virtualisation on Apple arm64 hardware under MacOS (high performance variant)