Advertisement
opexxx

OpenWRT on VMWare.txt

Aug 12th, 2013
983
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.14 KB | None | 0 0
  1. OpenWRT on VMWare
  2.  
  3. This is how to convert an OpenWRT image into a VMWare image to build a testing environment.
  4. Download and convert the image to vmware
  5.  
  6. At the linux terminal:
  7.  
  8. wget http://downloads.openwrt.org/backfire/10.03.1-rc5/x86_generic/openwrt-x86-generic-combined-ext2.img.gz
  9. gzip -d openwrt*.gz
  10.  
  11. qemu-img convert -f raw openwrt*.img -O vmdk openwrt-x86-rc5-ext2.vmdk
  12.  
  13. Create the vmx file
  14.  
  15. Create a file with the following:
  16.  
  17. #!/usr/bin/vmplayer
  18. .encoding = "UTF-8"
  19. config.version = "8"
  20. virtualHW.version = "4"
  21. displayName = "OpenWrt Backfire (x86)"
  22. annotation = ""
  23. guestinfo.vmware.product.long = ""
  24. guestinfo.vmware.product.url = ""
  25. guestOS = "other26xlinux"
  26. nvram = "OpenWrt Backfire (x86).nvram"
  27. MemTrimRate = "-1"
  28. memsize = "128"
  29. numvcpus = "1"
  30. MemAllowAutoScaleDown = "FALSE"
  31. uuid.action = "create"
  32. checkpoint.vmState = ""
  33. hints.hideAll = "TRUE"
  34. serial0.pipe.endPoint = "server"
  35. serial0.present = "TRUE"
  36. serial0.fileType = "pipe"
  37. serial0.fileName = "./serial-openwrt"
  38. serial0.hardwareFlowControl = "TRUE"
  39. logging = "FALSE"
  40. isolation.tools.hgfs.disable = "FALSE"
  41. isolation.tools.dnd.disable = "FALSE"
  42. isolation.tools.copy.enable = "TRUE"
  43. isolation.tools.paste.enabled = "TRUE"
  44. gui.restricted = "FALSE"
  45. paevm = "TRUE"
  46. gui.fullScreenAtPowerOn = "FALSE"
  47. tools.syncTime = "TRUE"
  48. ethernet0.present = "TRUE"
  49. ethernet0.virtualDev = "e1000"
  50. ethernet0.connectionType = "bridged"
  51. ethernet0.addressType = "generated"
  52. ethernet0.generatedAddress = "00:0C:29:48:82:54"
  53. ethernet0.generatedAddressOffset = "0"
  54. ethernet1.present = "TRUE"
  55. ethernet1.virtualDev = "e1000"
  56. ethernet1.connectionType = "bridged"
  57. ethernet1.generatedAddressOffset = "10"
  58. ide0:0.present = "TRUE"
  59. ide0:0.fileName = "openwrt-x86-ext2.vmdk"
  60. ide0:0.deviceType = "disk"
  61. ide0:0.mode = "persistent"
  62. ide0:0.redo = ""
  63. ide0:0.startConnected = "TRUE"
  64. ide0:0.writeThrough = "TRUE"
  65. ide0:0.autodetect = "TRUE"
  66. # USB settings
  67. # This config activates USB
  68. usb.present = "TRUE"
  69. usb.generic.autoconnect = "FALSE"
  70.  
  71. extendedConfigFile = "openwrt-x86-ext2.vmxf"
  72. virtualHW.productCompatibility = "hosted"
  73. scsi0.present = "TRUE"
  74. ethernet1.addressType = "generated"
  75. uuid.location = "56 4d ca ee 8c 21 01 c9-a7 8e a1 46 56 48 82 54"
  76. uuid.bios = "56 4d ca ee 8c 21 01 c9-a7 8e a1 46 56 48 82 54"
  77. cleanShutdown = "TRUE"
  78. replay.supported = "FALSE"
  79. replay.filename = ""
  80. ethernet1.generatedAddress = "00:0C:29:48:82:5E"
  81. vmotion.checkpointFBSize = "33554432"
  82. tools.remindInstall = "TRUE"
  83. scsi0.virtualDev = "lsilogic"
  84. ethernet2.present = "TRUE"
  85. ethernet2.vnet = "/dev/vmnet2"
  86. ethernet2.connectionType = "custom"
  87. ethernet2.wakeOnPcktRcv = "FALSE"
  88. ethernet2.addressType = "generated"
  89. ethernet2.generatedAddress = "00:0C:29:48:82:68"
  90. ethernet2.generatedAddressOffset = "20"
  91. ethernet0.linkStatePropagation.enable = "TRUE"
  92. ethernet1.linkStatePropagation.enable = "TRUE"
  93. ethernet2.startConnected = "FALSE"
  94. usb.autoConnect.device0 = ""
  95. usb:1.speed = "2"
  96. serial1.present = "FALSE"
  97. floppy0.present = "FALSE"
  98. sound.present = "FALSE"
  99.  
  100. Enable SSH and disable telnet
  101.  
  102. At the vmware terminal:
  103.  
  104. telnet 192.168.1.1
  105. passwd
  106.  
  107. Temporary network configuration
  108.  
  109. At the vmware terminal:
  110.  
  111. iptables –I INPUT –p tcp –dport 22 –j ACCEPT
  112. ifconfig br-lan <IP> up
  113. route add default gw <GW>
  114.  
  115. Network configuration
  116.  
  117. At the linux terminal via ssh:
  118.  
  119. MYIP=10.10.10.10
  120. GWIP=10.10.10.20
  121. MASK=255.255.255.0
  122. BCAST=10.10.10.255
  123. uci set network.lan=interface
  124. uci set network.lan.type=bridge
  125. uci set network.lan.proto=static
  126. uci set network.lan.ipaddr=$MYIP
  127. uci set network.lan.netmask=$MASK
  128. uci set network.lan.gateway=$GWIP
  129. uci set network.lan.broadcast=$BCAST
  130. uci set network.lan.dns=$GWIP
  131. uci set network.lan.resolv_dns=$GWIP
  132. uci set network.lan.device="eth0 eth1"
  133. uci set network.lan.ifname="br-lan"
  134. uci set network.lan.up=1
  135. uci commit
  136.  
  137. Package update & upgrade
  138.  
  139. At the linux terminal via ssh:
  140.  
  141. opkg update
  142. opkg upgrade
  143.  
  144. Links
  145.  
  146.     http://wiki.openwrt.org/oldwiki/runningkamikazeonvmwarehowto
  147.     https://forum.openwrt.org/viewtopic.php?pid=36757
  148.     http://www.andor2.de/mediawiki/index.php/OpenWRT_unter_VMWare
  149.     QEMU tutorial: http://wiki.leipzig.freifunk.net/Vhost-Spielereien
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement