Table of Contents
OpenWrt in VirtualBox
This documents descripes howto run the OpenWrt x86 port in VirtualBox.
Prerequisites
- Download and install VirtualBox
- Get an OpenWrt image:
- Download vdi image (ex. attitude_adjustment/12.09/x86/)
- Download and convert raw image (ex. attitude_adjustment/12.09/x86/)
- Compile your own image (Target System → x86 and Target Images → Build VirtualBox image files) (ext4 needs to be enabled first)
Convert OpenWrt raw image
This step is only required for older releases and snapshots. 10.03.1 and later provides native VirtualBox images.
Uncompress your image if needed:
gunzip openwrt.img.gz
Convert it to native VirtualBox format:
VBoxManage convertfromraw --format VDI openwrt.img openwrt.vdi
VM Setup in VirtualBox
- Start VirtualBox
- Click New
- Click Next
- Choose a Name for your virtual machine
- Choose
Linuxfor your Operating System - Choose
Linux 2.6for your Version - Click Next
- Optionally decrease RAM size from
256 MBto something smaller - Click Next
- Choose Use existing hard disk
- Click the file icon to open Virtual Media Manager
- Click Add and your
.vdior.vmdkfile using the dialog - Select your drive from the list and click Select
- Click Next and Finish
- Right click your machine's entry on the machine list and choose Settings
- add a disconnected, serial port to the machine (default is none available)
Troubleshooting
- If your virtual machine won't boot, make sure your hard disk is connected using IDE (not SATA)
- Right click your machine's entry on the machine list and choose Settings then select Storage
- If you see that your hard disk image is connected to a SATA controller; under Storage Tree select the SATA Controller entry and then click Remove Controller
- Click Add Controller and then select IDE Controller
- Select the IDE Controller you just added and then click Add Attachment and choose Add Hard Disk
- Add your OpenWRT image as before
- If your virtual machine still won't boot, make sure you have a Serial Port enabled.
- Enable a serial port under Settings then Serial Ports
- If your virtual machine boots but doesn't activate the console
- Press Enter
- If you rebuild the disk image, and VirtualBox complains about invalid UUIDs for the disk
- You need to remove the disk from the VM, and _also_ from the Virtual Media Manager, the add the disk image to the VM again
Set up networking with clients
- In the VirtualBox Settings for Network configure:
- Adapter 1 to internal network with name OpenWrt-lan
- Adapter 2 to Bridged adapter or NAT
- Boot up OpenWrt and add to /etc/config/network
config 'interface' 'wan' option 'proto' 'dhcp' option 'ifname' 'eth1' - Start the wan with ifup wan
- Create a new Virtual machine with your client operating system of choice
- On the client set Adapter 1 to internal network with name OpenWrt-lan
- Boot client
doc/howto/virtualbox.txt · Last modified: 2013/04/15 16:34 by karlp









