Skip to content

Instantly share code, notes, and snippets.

@stokito
Forked from jayluxferro/OpenWrt_Virtualbox.md
Last active August 13, 2022 10:11
Show Gist options
  • Save stokito/533e2c1d2bc7809ceed124da3ab48567 to your computer and use it in GitHub Desktop.
Save stokito/533e2c1d2bc7809ceed124da3ab48567 to your computer and use it in GitHub Desktop.
How to run OpenWrt in VirtualBox

The official doc seems too complicated OpenWrt on VirtualBox HowTo

  1. Download and install VirtualBox. On Windows add to PATH envs C:\Program Files\Oracle\VirtualBox
  2. Get an OpenWrt image openwrt-x86-64-combined-ext4.img.gz from targets/x86/64/ folder. Direct snapshot download
  3. Uncompress the image: gunzip openwrt.img.gz
  4. Convert it to native VirtualBox format:
VBoxManage convertfromraw --format VDI openwrt.img openwrt.vdi

Now start VBox and create a Linux 2.6 machine and attach the drive to it. Network set to Bridge mode. After start press Enter and you'll get to a console. You must set a password with passwd command. Then you need to change network settigns so that OpenWrt will take it's IP from DHCP gateway on the network. Edit vi /etc/config/network and change proto to dhcp and remove ipaddr, netmask, ip6assign:

config interface 'lan'
        option device 'br-lan'
        option proto 'dhcp'

Or use uci:

uci set network.lan.proto=dhcp
uci delete network.lan.ipaddr
uci delete network.lan.netmask
uci delete network.lan.ip6assign
uci commit

Restart network service restart network. Then see an ip address with ifconfig. Then you can open Luci admin in browser by the IP.

Additionally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment