Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-user:virtualization:virtualbox-advanced [2020/01/16 11:39] – old revision restored (2020/01/16 10:17) someothertimedocs:guide-user:virtualization:virtualbox-advanced [2020/08/15 16:11] (current) – [Resources] add flink re: 80211 bridging issues someothertime
Line 5: Line 5:
 This guide extends the basic VirtualBox HowTo with broader setup recommendations, samples and common "gotcha-s". This guide extends the basic VirtualBox HowTo with broader setup recommendations, samples and common "gotcha-s".
  
 +NOTE: Use a wired virtualbox host (unless you are really confident with virtualbox i.e. 80211 bridging issues ).
 ===== Prerequisite Concepts ===== ===== Prerequisite Concepts =====
 ==== x86_64 Basics ==== ==== x86_64 Basics ====
Line 140: Line 141:
  
 VMNAME="openwrtx64-20191002-2352" VMNAME="openwrtx64-20191002-2352"
-lannicspeed="350k" #.35MBps use m for mbps +lannicspeed="350k" # .35mb/use m for mbps 
-wannicspeed="360k"+wannicspeed="360k" #
  
 VBoxManage bandwidthctl "$VMNAME" add Limitlan --type network --limit $lannicspeed VBoxManage bandwidthctl "$VMNAME" add Limitlan --type network --limit $lannicspeed
Line 147: Line 148:
 VBoxManage modifyvm "$VMNAME" --nicbandwidthgroup1 Limitlan #assign to nic1 VBoxManage modifyvm "$VMNAME" --nicbandwidthgroup1 Limitlan #assign to nic1
 VBoxManage modifyvm "$VMNAME" --nicbandwidthgroup2 Limitwan #assign to nic2 VBoxManage modifyvm "$VMNAME" --nicbandwidthgroup2 Limitwan #assign to nic2
 +</code>
 +
 +
 +=== Tagging for VM' ===
 +
 +Note: example ip link is non-permanent... see your distro for appropriate place to configure your host nic for a vlan.
 +
 +You can use a single cable as a "trunk". This essentially turns your wired link into a managed switch as you will tag VLAN per vm upstream on the wired link.
 +
 +This can be used for clients... with openwrt on a "real router" running several vlans over a single LAN port. Or you could use this method for an OpenWrtVM... tag several of it's interfaces outside of the guest software... "mimicking" a managed switch.
 +
 +
 +This example shows clientVM's to an upstream OpenWrt router.
 +<code bash>
 +
 +######################################################### Step1 ONHOST
 +NIC="enp0s25"
 +ip link add link $NIC name $NIC.50 type vlan id 50
 +ip link set dev $NIC.50 up
 +
 +######################################################### Step2
 +In VirtualBox change bridge for a VM to interface NIC.50
 +
 +######################################################### Step3 In Openwrt
 +#-Go to switch... add vlan 50 tagged on same port as pc/server + cpu1
 +#-Go to interfaces... add interface... NAME + INTERFACE:ethNcpu.50 + IP:192.168.50.1 etc. etc.
 +
 +
 +################################## debugging on host
 +#ip -d link show $NIC.50
 +#ip link delete $NIC.50
 +#tcpdump -nnei $NIC -vvv
 +
 </code> </code>
  
Line 163: Line 197:
  
 {{:media:netdiag1b.png?direct&600|}} {{:media:netdiag1b.png?direct&600|}}
 +
  
 As show in the diagram; As show in the diagram;
Line 171: Line 206:
  
 You now have a powerful internal router for VPN and any other service you wish. Leaving the edge router to do simple routing, nat and firewalling tasks. Give some clients your normal LAN gateway and some clients the OpenWrt VM, and presto! poor mans PBR ;). You now have a powerful internal router for VPN and any other service you wish. Leaving the edge router to do simple routing, nat and firewalling tasks. Give some clients your normal LAN gateway and some clients the OpenWrt VM, and presto! poor mans PBR ;).
 +
 +=== CLI Basic Network Access Setup (vi dhcp) ===
 +* use gateway and dns options for static ip
 +
 +{{:media:vbox-simple-opkg-as-client.webm?direct&600|}}
 +
 +
 +=== CLI Install LUCI on snapshot ===
 +{{:media:vbox-simple-opkg-add-luci-to-snapshot.webm?direct&600|}}
 +
 +
 +
  
 ==== Buildroot Export ==== ==== Buildroot Export ====
Line 219: Line 266:
  
 Then change the correct VM>bridged-to interface to br201 in VirtualBox. Then change the correct VM>bridged-to interface to br201 in VirtualBox.
 +
 +NOTE: You may need to set the vbox-nic promiscous mode to Allow if bridging to a host bridge
 +https://forum.openwrt.org/t/only-the-first-interface-in-br-lan-is-working-properly-with-a-virtualbox-x86-64-openwrt/62539/5
 +
  
 ==== ToDo Serial and SSH console examples ==== ==== ToDo Serial and SSH console examples ====
Line 271: Line 322:
 [5] Image filesystems and alteration in detail [5] Image filesystems and alteration in detail
 [[https://quantumwarp.com/kb/articles/25-dsl-broadband/899-run-lede-as-a-virtualbox-virtual-machine]] [[https://quantumwarp.com/kb/articles/25-dsl-broadband/899-run-lede-as-a-virtualbox-virtual-machine]]
 +
 +[7] forum re: macos 80211 bridging issues
 +[[https://forum.openwrt.org/t/virtualbox-openwrt-works-fine-but-clients-connecting-to-vm-router-have-no-internet/71398]]
 +
  
  • Last modified: 2020/01/16 11:39
  • by someothertime