This article describes how to use OpenWrt as a virtual machine with VMware virtualization.
First of all, you need to download the image from list above on your machine. After that you extract & convert it to a vmdk image:
gunzip openwrt-x86-generic-combined-ext4.img.gz qemu-img convert -f raw -O vmdk openwrt-x86-generic-combined-ext4.img openwrt-x86-generic-combined-ext4.vmdk
or
yum -y install qemu-img wget https://downloads.openwrt.org/chaos_calmer/15.05/x86/64/openwrt-15.05-x86-64-combined-ext4.img.gz gunzip openwrt-15.05-x86-64-combined-ext4.img.gz qemu-img convert -f raw -O vmdk openwrt-15.05-x86-64-combined-ext4.img openwrt-15.05-x86-64-combined-ext4.vmdk
or on a Mac
brew install qemu qemu-img convert -f raw -O vmdk ~/Downloads/openwrt-15.05-x86-64-combined-ext4.img openwrt-15.05-x86-64-combined-ext4.vmdk
after that, just create a new VM in Fusion, Workstation, or ESXi with “Linux\Other Linux 32-bit” with LSI BUS Logic & add the vmdk there. Use Intel PRO/1000 Network adapters. This may require editing the .vmx file to include following definition: (On Workstation 10, the e1000 gave a corrupted vmx file. Using V6 machine type did work. So it seems somewhere between V6.5 and V10 VMware dropped support for the e1000 driver and/or the virtualDev keyword.)
ethernet0.virtualDev = "e1000"
On Fusion I had to use the IDE drive controller type. This also applies to recent ESXi versions, just switch the Virtual Device Node from default SCSI controller 0 to IDE 0. Also, recent OpenWRT and ESXi versions do support running VMXNET3 virtual NIC so you can achieve 10GE speeds.
NB: The first network interface is LAN, and the second is WAN.
⚠️This info is obsolete⚠️
Follow these steps to get an Up to Date VM with the latest code running on ESX in 15 minutes:
ifconfig | more to see the DHCP assigned IP address for the Bridge assigned to the NICvi /etc/config/networkiperf3 -s iperf3 -c <ip-address-of-the-server>Here are some results from my system:
As you can see - the OpenWrt virtual machine running on VMware ESX is very capable of keeping up with your home internet router needs! And this is with only 1 virtual CPU and no tuning at all.
Here's a wish list of things we would like to accomplish with OpenWrt - consider this technical debt.
(Is there a better place to make these requests?)
Disk size and problems with veeam backup and enlarging the disk Veeam backup and VMware will complain about the size of the virtual disk provided by the OpenWrt download because the disk is not multiple of 1KB. (this means: no backups available, and could be crucial in production environments)
VMware won't let you enlarge the disk in the normal way, so one simple way is:
sysrescuecdisodd if=/dev/sdb of=/dev/sdafdisk /dev/sda and write the partition table (without making changes, this helps sysrescuecd to see the partitions properly)fsck -f on the sda2 partitionfdisk resize the sda2 partition to occupy all the space available (but still starting with the same sector of before, normally 9135)resize2fs /dev/sda2fsck -f /dev/sda2Please use these images in your home and work labs and provide any feedback you might have.
Feel free to update this wiki page with your results.
There is some feedback that the newer images are not booting properly. Has anyone else run into this issue?
<html> <blockquote class=“twitter-tweet” data-lang=“en”><p lang=“en” dir=“ltr”><a href=“https://twitter.com/iben”>@iben</a> learn , well, your quickstart ova works great. Following the instructions in the paragraph above it by the letter doesn't. /shrug .</p>— Phoenixxl (@Phoenixxl) <a href=“https://twitter.com/Phoenixxl/status/775043516070260740”>September 11, 2016</a></blockquote> <script async src=“//platform.twitter.com/widgets.js” charset=“utf-8”></script> </html>
Here is an upgraded OVA VM export with version 19.07.5, using ext4 instead of squashfs and an extended /overlay filesystem, with DHCP enabled instead of a static IP for br-lan interface: https://www.dropbox.com/s/4b0dy8d8iqf8a91/OpenWRT_x86_64_19.07.05.ova?dl=0
After import of the previous OVA-file to VMware Sphere, I was able to upgrade to the latest OpenWrt version (21-00-RC3).
This machine, OpenWRT-21 has
VMDK (1st method): e1000 interface is found/loads intermittently.
Corresponds to Seg Fault errors in kmodloader when loading libuclibc.