This article describes how to use OpenWRT as a virtual machine with VMware virtualisation.
Things you need:
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
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:
ethernet0.virtualDev = "e1000"
On Fusion I had to use the IDE drive controller type.
BTW… you can download an OVA image of cc 1505 from the following location: https://dl.dropboxusercontent.com/u/7976972/openwrt15cc.ova
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?)
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:
. make a snapshot of the vm, for possible rollback . move the original disk (from openwrt downloads) on ide 0:1 . add a new disk, with a whole size, like 128 MB , on ide 0:0 . use sysrescuecdiso . start the vm with the iso . with dd copy the disc on ide 0:1 to ide 0:0 like dd if=/dev/sdb of=/dev/sda . enter fdisk /dev/sda and write the partition table (without making changes, this helps sysrescuecd to see the partitions properly) . do fsck -f on the sda2 partition . with fdisk resize the sda2 partition to occupy all the space available (but still starting with the same sector of before, normally 9135) . use resize2fs /dev/sda2 . do fsck -f /dev/sda2 . restart the machine and boot with openwrt check that the system uses the new partition . stop the machine, delete the previous hd (with less than 128mb) . restart the machine and verify that everything is ok.