Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:guide-user:virtualization:virtualbox-advanced [2020/01/11 08:59] – [Linux VirtualBox Auto Create] someothertime | docs: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, | This guide extends the basic VirtualBox HowTo with broader setup recommendations, | ||
| + | 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 ==== | ||
| - | As the operating system within VirtualBox is basically an x86_64 host, having a general grasp of the hard drive partition setup, bootloader operation | + | As the operating system within VirtualBox is basically an x86_64 host, having a general grasp of the hard drive partition setup, bootloader operation |
| ==== squashfs vs ext4 ==== | ==== squashfs vs ext4 ==== | ||
| Line 15: | Line 16: | ||
| {{: | {{: | ||
| - | ===Using | + | ===Using squashfs: |
| - | * With squashfs you can sysupgrade at any time to update the kernel, which is useful if you are tracking snapshot to have the latest and greatest | + | * sysupgrade at any time to update the kernel, which is useful if you are tracking snapshot to have the latest and greatest |
| - | * With squashfs you can factory reset | + | * factory reset |
| - | * While the defualt size of read-write partition in a squashfs image is 128MB it' | + | * the default |
| * If you need more space for data you can always increase the virtual disk size and add a data partition (which will be preserved on sysupgrade), | * If you need more space for data you can always increase the virtual disk size and add a data partition (which will be preserved on sysupgrade), | ||
| - | For most other devices, the squashfs image is actually | + | Squashfs images are neat when you are using the [[docs: |
| - | Since you have Virtualbox anyway, why not have a Debian or Ubuntu VM and use the Imagebuilder too. It's a very convenient way of tracking snapshot to have the latest and greatest, and the only practical way to do so for most other devices supported by OpenWrt, so this is more or less the best " | + | Since you have Virtualbox anyway, why not have a Debian or Ubuntu VM and use the Imagebuilder too. It's a very convenient way of tracking snapshot(master) |
| - | Note, if you use the Imagebuilder, | + | NB: With Imagebuilder, |
| - | ===Using | + | ===Using ext4:=== |
| - | * With ext4 you lose the ability to sysupgrade but you can keep updating packages over and over. | + | * With ext4 you lose the ability to sysupgrade but you can keep updating packages over and over. ( todo: clarify see final sentence ) |
| + | * Depending on your hdd durability, there is more wear but most users have zero issues. Kindof mute for vm's. | ||
| * Updating the kernel must be done manually by mounting the first partition (**/ | * Updating the kernel must be done manually by mounting the first partition (**/ | ||
| * With ext4 you can increase the partition size to your heart' | * With ext4 you can increase the partition size to your heart' | ||
| - | This type of image mimics a more conventional Linux distro like Debian or Ubuntu, where you have packages and you keep updating or installing them as needed. But afaik this is a bit of a pain to do if you try to follow snapshot, as OpenWrt does not implement the ability to have multiple kernels with kernel modules (the Linux " | + | This type of image mimics a more conventional Linux distro like Debian or Ubuntu, where you have packages and you keep updating or installing them as needed. But afaik this is a bit of a pain to do if you try to follow snapshot, as OpenWrt does not implement the ability to have multiple |
| So when you go and update the kernel or the kernel modules (packages that start with **kmod-xxxx.ipk**) you will probably experience breakage or will have to fight against opkg that refuses to install them as they are not compatible with the kernel in use. I //think// that you could actually do this if you install the kernel first, which is a virtual package, and then install the kmod packages and then reboot immediately, | So when you go and update the kernel or the kernel modules (packages that start with **kmod-xxxx.ipk**) you will probably experience breakage or will have to fight against opkg that refuses to install them as they are not compatible with the kernel in use. I //think// that you could actually do this if you install the kernel first, which is a virtual package, and then install the kmod packages and then reboot immediately, | ||
| + | Therefore, using sysupgrade to flash a new combined-ext.bin will typically zap the " | ||
| ==== VirtualBox Networking Basics ==== | ==== VirtualBox Networking Basics ==== | ||
| Knowledge of the basic network types offered by VirtualBox will help you immensely... | Knowledge of the basic network types offered by VirtualBox will help you immensely... | ||
| Line 99: | Line 102: | ||
| --nictype1 82540EM \ | --nictype1 82540EM \ | ||
| --nic2 " | --nic2 " | ||
| - | --nictype2 82540EM | + | --nictype2 82540EM |
| $VBOXMANAGE storagectl $VMNAME \ | $VBOXMANAGE storagectl $VMNAME \ | ||
| Line 138: | Line 141: | ||
| VMNAME=" | VMNAME=" | ||
| - | lannicspeed=" | + | lannicspeed=" |
| - | wannicspeed=" | + | wannicspeed=" |
| VBoxManage bandwidthctl " | VBoxManage bandwidthctl " | ||
| Line 145: | Line 148: | ||
| VBoxManage modifyvm " | VBoxManage modifyvm " | ||
| VBoxManage modifyvm " | VBoxManage modifyvm " | ||
| + | </ | ||
| + | |||
| + | |||
| + | === 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 " | ||
| + | |||
| + | This can be used for clients... with openwrt on a "real router" | ||
| + | |||
| + | |||
| + | This example shows clientVM' | ||
| + | <code bash> | ||
| + | |||
| + | ######################################################### | ||
| + | NIC=" | ||
| + | ip link add link $NIC name $NIC.50 type vlan id 50 | ||
| + | ip link set dev $NIC.50 up | ||
| + | |||
| + | ######################################################### | ||
| + | In VirtualBox change bridge for a VM to interface NIC.50 | ||
| + | |||
| + | ######################################################### | ||
| + | #-Go to switch... add vlan 50 tagged on same port as pc/server + cpu1 | ||
| + | #-Go to interfaces... add interface... NAME + INTERFACE: | ||
| + | |||
| + | |||
| + | ################################## | ||
| + | #ip -d link show $NIC.50 | ||
| + | #ip link delete $NIC.50 | ||
| + | #tcpdump -nnei $NIC -vvv | ||
| + | |||
| </ | </ | ||
| Line 161: | Line 197: | ||
| {{: | {{: | ||
| + | |||
| As show in the diagram; | As show in the diagram; | ||
| Line 169: | 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 | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | === CLI Install LUCI on snapshot === | ||
| + | {{: | ||
| + | |||
| + | |||
| + | |||
| ==== Buildroot Export ==== | ==== Buildroot Export ==== | ||
| Line 218: | Line 267: | ||
| Then change the correct VM> | Then change the correct VM> | ||
| + | NOTE: You may need to set the vbox-nic promiscous mode to Allow if bridging to a host bridge | ||
| + | https:// | ||
| + | |||
| + | |||
| + | ==== ToDo Serial and SSH console examples ==== | ||
| + | |||
| + | ==== Video of Boot ==== | ||
| + | For boot-time debugging purposes... you would generally want to attach a vbox-console. One nice and easy trick is to use the capture facility of VirtualBox. Not so handy for copy paste but this method has it's own advantages. | ||
| + | |||
| + | Settings => Display => Recording [x] Enable Recording | ||
| + | |||
| + | ( NB: you must repeat this every boot, you can find the default .webm file in the VirtualBox machines directory ) | ||
| ===== Tips beyond the Basic ===== | ===== Tips beyond the Basic ===== | ||
| * vnic0 ( LAN ) is key. Get access to it... Know how it works at each level of abstraction. | * vnic0 ( LAN ) is key. Get access to it... Know how it works at each level of abstraction. | ||
| Line 261: | Line 322: | ||
| [5] Image filesystems and alteration in detail | [5] Image filesystems and alteration in detail | ||
| [[https:// | [[https:// | ||
| + | |||
| + | [7] forum re: macos 80211 bridging issues | ||
| + | [[https:// | ||
| + | |||