I used combined-ext4 everywhere instead of combined-squashfs. I just thought that ext4 is more easier to deal with.
But also I copied a short description with differences between them.
I made some direct links to for downloads.
Things to do:
0. TBH is think that is would be great to make a separate VDI file which is already converted from img and ready to be used by VBox.
The network configuration section seems too complicated. On my VM I just made one network adapter with bridge and on VM changed /etc/config/network to
config interface 'lan'
option proto 'dhcp'
option ifname 'eth0'
Not sure that I did it correctly but with such config I can ping my VM from host and the VM has an access to host and internet, which I guess is a desirable config for 95% of users.
But as for me this or similar config should be shipped by default because now it's nailed the static IP 192.168.1.1.
It also would be nice to update screenshots because some of them contains LEDE which may confuse newcomers.
This is incorrect, ext4 doesn't provide support for factory resets - the whole filesystem image is writeable, if you mess it up, it's dead for good. With squashfs, you still retain a known good rootfs below the overlay, which can be used for firstboot.
What if one needs: VMDK (for VMWare Player instead), VHD (for Hyper-V), HDD (for Parallels), QCOW or QED (for QEMU), or other format?
VirtualBox is not the only hypervisor solution; and all hypervisors can convert raw IMG files (or has complimentary software installed that does so).
Except if you then need to e.g. bridge PHYs in LAN, then you'd have to put it back. Also, you just seem to wanna bridge into your Hypervisor's network; but note that there's no such thing in full-cloud hypervisors (e.g. VSphere).
Wow, that wouldn't work for most people who want to use OpenWrt as a real production router in VM.
Thank you, got it.
The whole my point is to make it easy for newcomers who wants to try and learn OpenWrt before risking with their own router. They may not have any previous experience with Linux. And we can encourage users to try and play with OpenWrt first. As far I know the VBox is most user friendly for newcomers, at least it's free. So it will be good to make the VBox Howto written for such non experienced users.
That's why each additional step adds a lot of complexity for them:
Converting img file by running a command line. I guess that VMWare/QEMU users can do this themselves but for newcommers it would be great just to give them already prepared image that can be directly used from VBox. This can be even be the whole VM.
The typical usage will be: run VM, the VM receives an IP via regular DHCP. user tries to login into it with ssh and configure it and install some packages. Also user can open VM's Luci site directly from his browser.
To be fair, getting the host networking right will not be easy for these hypothetical newcomers…
In most cases jumping into the deep end and testing it on real, physical hardware should be considerably easier for most users, than the much more 'virtual wiring' necessary to configure the hypervisor in a way to really test OpenWrt. The later does require some rather exhaustive knowledge to routing and how it all fits together, while the physical hardware clearly labels WAN and LAN and gives to physical wires to connect as you see fit.
--
speaking as someone making very heavy use of virtualization for testing purposes, including OpenWrt, myself, but on linux/ qemu(kvm)
A beginner is always going to stumble with "virtuality" and hot-linking to external instructions for much of the "finnicky" networking concepts is likely the most viable option. ( as is keeping them as minimal and clear as possible ).
For using squashfs images with libvirt/KVM, one need to expand the image first. Or else the booted system doesn't have any space to write the configuration to.
First create a 300MB blank img file, then write the openwrt-xxx-combined-squashfs.img to the created file with conv=notrunc option.
n@n:~/Downloads$ dd if=/dev/zero of=openwrt.img bs=1M count=300
300+0 records in
300+0 records out
314572800 bytes (315 MB, 300 MiB) copied, 0.11842 s, 2.7 GB/s
n@n:~/Downloads$ dd if=openwrt-19.07.3-x86-64-combined-squashfs.img of=openwrt.img conv=notrunc
39854+1 records in
39854+1 records out
20405356 bytes (20 MB, 19 MiB) copied, 0.16736 s, 122 MB/s
n@n:~/Downloads$ ls -lah openwrt*
-rw-rw-r-- 1 n n 20M Aug 13 16:50 openwrt-19.07.3-x86-64-combined-squashfs.img
-rw-rw-r-- 1 n n 300M Aug 13 16:54 openwrt.img
Tip: The resultant 300MB openwrt.img can be conveniently compressed with gzip to a 7MB file for transmission.
Squashfs img partition:
Disk /dev/loop0: 300 MiB, 314572800 bytes, 614400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x339542e9
Device Boot Start End Sectors Size Id Type
/dev/loop0p1 * 512 33279 32768 16M 83 Linux
/dev/loop0p2 33792 558079 524288 256M 83 Linux