Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OpenWRT on VMWare
- This is how to convert an OpenWRT image into a VMWare image to build a testing environment.
- Download and convert the image to vmware
- At the linux terminal:
- wget http://downloads.openwrt.org/backfire/10.03.1-rc5/x86_generic/openwrt-x86-generic-combined-ext2.img.gz
- gzip -d openwrt*.gz
- qemu-img convert -f raw openwrt*.img -O vmdk openwrt-x86-rc5-ext2.vmdk
- Create the vmx file
- Create a file with the following:
- #!/usr/bin/vmplayer
- .encoding = "UTF-8"
- config.version = "8"
- virtualHW.version = "4"
- displayName = "OpenWrt Backfire (x86)"
- annotation = ""
- guestinfo.vmware.product.long = ""
- guestinfo.vmware.product.url = ""
- guestOS = "other26xlinux"
- nvram = "OpenWrt Backfire (x86).nvram"
- MemTrimRate = "-1"
- memsize = "128"
- numvcpus = "1"
- MemAllowAutoScaleDown = "FALSE"
- uuid.action = "create"
- checkpoint.vmState = ""
- hints.hideAll = "TRUE"
- serial0.pipe.endPoint = "server"
- serial0.present = "TRUE"
- serial0.fileType = "pipe"
- serial0.fileName = "./serial-openwrt"
- serial0.hardwareFlowControl = "TRUE"
- logging = "FALSE"
- isolation.tools.hgfs.disable = "FALSE"
- isolation.tools.dnd.disable = "FALSE"
- isolation.tools.copy.enable = "TRUE"
- isolation.tools.paste.enabled = "TRUE"
- gui.restricted = "FALSE"
- paevm = "TRUE"
- gui.fullScreenAtPowerOn = "FALSE"
- tools.syncTime = "TRUE"
- ethernet0.present = "TRUE"
- ethernet0.virtualDev = "e1000"
- ethernet0.connectionType = "bridged"
- ethernet0.addressType = "generated"
- ethernet0.generatedAddress = "00:0C:29:48:82:54"
- ethernet0.generatedAddressOffset = "0"
- ethernet1.present = "TRUE"
- ethernet1.virtualDev = "e1000"
- ethernet1.connectionType = "bridged"
- ethernet1.generatedAddressOffset = "10"
- ide0:0.present = "TRUE"
- ide0:0.fileName = "openwrt-x86-ext2.vmdk"
- ide0:0.deviceType = "disk"
- ide0:0.mode = "persistent"
- ide0:0.redo = ""
- ide0:0.startConnected = "TRUE"
- ide0:0.writeThrough = "TRUE"
- ide0:0.autodetect = "TRUE"
- # USB settings
- # This config activates USB
- usb.present = "TRUE"
- usb.generic.autoconnect = "FALSE"
- extendedConfigFile = "openwrt-x86-ext2.vmxf"
- virtualHW.productCompatibility = "hosted"
- scsi0.present = "TRUE"
- ethernet1.addressType = "generated"
- uuid.location = "56 4d ca ee 8c 21 01 c9-a7 8e a1 46 56 48 82 54"
- uuid.bios = "56 4d ca ee 8c 21 01 c9-a7 8e a1 46 56 48 82 54"
- cleanShutdown = "TRUE"
- replay.supported = "FALSE"
- replay.filename = ""
- ethernet1.generatedAddress = "00:0C:29:48:82:5E"
- vmotion.checkpointFBSize = "33554432"
- tools.remindInstall = "TRUE"
- scsi0.virtualDev = "lsilogic"
- ethernet2.present = "TRUE"
- ethernet2.vnet = "/dev/vmnet2"
- ethernet2.connectionType = "custom"
- ethernet2.wakeOnPcktRcv = "FALSE"
- ethernet2.addressType = "generated"
- ethernet2.generatedAddress = "00:0C:29:48:82:68"
- ethernet2.generatedAddressOffset = "20"
- ethernet0.linkStatePropagation.enable = "TRUE"
- ethernet1.linkStatePropagation.enable = "TRUE"
- ethernet2.startConnected = "FALSE"
- usb.autoConnect.device0 = ""
- usb:1.speed = "2"
- serial1.present = "FALSE"
- floppy0.present = "FALSE"
- sound.present = "FALSE"
- Enable SSH and disable telnet
- At the vmware terminal:
- telnet 192.168.1.1
- passwd
- Temporary network configuration
- At the vmware terminal:
- iptables –I INPUT –p tcp –dport 22 –j ACCEPT
- ifconfig br-lan <IP> up
- route add default gw <GW>
- Network configuration
- At the linux terminal via ssh:
- MYIP=10.10.10.10
- GWIP=10.10.10.20
- MASK=255.255.255.0
- BCAST=10.10.10.255
- uci set network.lan=interface
- uci set network.lan.type=bridge
- uci set network.lan.proto=static
- uci set network.lan.ipaddr=$MYIP
- uci set network.lan.netmask=$MASK
- uci set network.lan.gateway=$GWIP
- uci set network.lan.broadcast=$BCAST
- uci set network.lan.dns=$GWIP
- uci set network.lan.resolv_dns=$GWIP
- uci set network.lan.device="eth0 eth1"
- uci set network.lan.ifname="br-lan"
- uci set network.lan.up=1
- uci commit
- Package update & upgrade
- At the linux terminal via ssh:
- opkg update
- opkg upgrade
- Links
- http://wiki.openwrt.org/oldwiki/runningkamikazeonvmwarehowto
- https://forum.openwrt.org/viewtopic.php?pid=36757
- http://www.andor2.de/mediawiki/index.php/OpenWRT_unter_VMWare
- QEMU tutorial: http://wiki.leipzig.freifunk.net/Vhost-Spielereien
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement