Download
VirtualBox 4.1.20 for Windows hosts x86/amd64
OperWrt image file for VirtualBox ver 10.03.1 (This one not work for me, ext-2 error and read only file system occur)
Raw image (This one work for me. See below to convert to vdi format)
Convert img to native VirtualBox format
- Unzip the raw image to VirtualBox folder (C:\Program Files\Oracle\VirtualBox)
- Open Ms DOS Command Prompt
- Enter C:\Program Files\Oracle\VirtualBox (This is the location where virtualbox install)
- Enter VBoxManage convertfromraw --format VDI openwrt-x86-generic-combined-ext4.img openwrt.vdi
- Now you have a new vdi file named openwrt.vdi
If you don't want to scratch your head to converting the vdi file. Here I provided a converted vdi which the network is already configure nicely.
Install VirtualBox
- Run VirtualBox-4.1.20-80170-Win.exe
- Follow on screen instructions until complete installation (always use default settings)
Setup VirtualBox
- Run VirtualBox
- VirtualBox main screen should appear as shown in figure below.
- Click New to create a new Virtual Machine.
- Click Next to continue.
- Choose a name for the machine, it can be any name. Here I use OpenWRT
- Choose Linux for the Operating System
- Choose Linux 2.6 for Version
- Click Next to continue as shown in figure below
- Select the amount of memory, keep the default setting.
- Click Next to continue
- Choose Use existing hard disk since you want to use the OpenWRT image file as the new virtual disk
- Click the file icon to select the OpenWRT image file as shown in figure below
- Click Next to continue
- Finally click Create button to finish
Starting OpenWRT in VirtualBox
OpenWRT just stop working due to OpenWRT vdi image file does not support SATA Controller.
Figure below shows the Storage settings where OpenWRT vdi image file is loaded under SATA Controller. We must move the image file from SATA Controller to IDE Controller
- Click on Settings icon
- Click on Storage section
- Right click SATA Controller
- Select Remove Controller
- Right click IDE Controller
- Select Choose existing disk
- Select OpenWRT vdi image file as shown in figure below
Again OpenWRT stop working as shown in figure below. To solve this problem we have to enable Serial Port with Port Mode disconnected.
Just enable serial port without touching other settings.
Start the VM (You must press Enter virtual machine boots but doesn't activate the console), OpenWRT is running as shown in figure below.
Setting up Network
I configured two network adapters for the virtual machine. The first adapter use "NAT" & the second adapter use "Bridge". The first adapter allows you to download additional OpenWrt software packages via the internet connection of the host system. While the second network adapter is connected to the Ethernet adapter of the host system, which itself could then be connected to the network switch.
Modify Network Configuration File
The /etc/config/network configuration must match with the above network system. Use vim to edit the file.
vim /etc/config/network |
vim /etc/config/network
# Copyright (C) 2006 OpenWrt.org
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
config interface wan
option ifname eth0
option proto dhcp
config interface lan
option ifname eth1
option proto static
option ipaddr 192.168.1.11
option netmask 255.255.255.0
|

Here is a working vdi file which the network settings is configure based on above settings.