OpenWrt on VMware / Virtualbox HowTo: Still up-to-date?

  1. OpenWrt on VMware HowTo
    • Still links to 14.07 / 15.05 images
    • Has anybody sucessfully tried the linked How To with a more recent OpenWrt version, e.g. 17.01, 18.06, or even the upcoming 19.07?
    • If Yes: Can you please review the page for correctness and update it where necessary?
  2. OpenWrt on VirtualBox HowTo
    • Seeing the change history, it seems to be reasonably up-to date
    • Links to snapshots instead of stable release
      • Any reason for chosing snapshots, not stable release?
      • I guess the instructions are also applicable to stable release, right? If yes, a short note on the linked page would be nice.
1 Like

Disclaimer, I haven't used virtualbox in ~10 years and never had any access to VMware; I'm quite actively using qemu-kvm, mostly for non-OpenWrt, but occasionally also for quick OpenWrt tests.

Is there a particular reason why either of them directly links to a specific image at all, rather than just referring to the normal x86/ x86_64 images? If the hypervisor can't cope with the current version, there'd be a serious problem (most likely on the hypervisor side, as OpenWrt is 'just another linux distro')[0].

In general there shouldn't be anything OpenWrt specific in virtualizing it, the user just has to be proficient to configure their hypervisor of choice. Getting the hypervisor side networking obviously isn't as easy as for normal client operating systems, given that two independent (virtual or bridged) interfaces are needed, depending on the requirements with direct access to the wired network in order to provide networking services to real iron.

--
[0] yes, choosing the correct emulation types, virtio drivers where possible, etc. are somewhat hypervisor specific. but in general, the virtual hardware is just another x86 system - and OpenWrt should work with any default environment, perhaps not in an optimal way, but it should work.

3 Likes

Use virtualbox. it's relatively up to date.... forking the lower network stuff to another page might help to cleanup the page and keep subjective hypervisor specifics differentiated..... ( don't have the wifi-fu to do that )

disk expansion / conversion can be tweaked/clarified a little...

( i think SNAPSHOT was referenced because RELEASE is a moving target... aka... docs will soon be stale.... needs a dyno-tag for the current release? )

1 Like

Hello,

Just a couple of quick observations about the VirtualBox install. There are several errors there – I suggest not making any more small changes until the whole process is checked.

The Snapshot and Stable files are a completely different size (with and without Luci, for a start). The instruction to resize to 128 MB is very out of date as even the Snapshot image is already bigger than 128 MB, so trying to shrink it will produce an error. I guess that resizing is to allow room to install Luci, so may not be necessary for a Stable image anyway.

The name of the image to download is not consistent. Sometime it is referred to as combined-squashfs, sometimes as combined-ext4. The difference between those two files should be explained and which file should be used for which situation. If the choice of image depends on the OS of the VBox host machine, then it's probably better to separate the first part (obtaining and preparing the image) into sections for Windows hosts and Linux hosts.

I will try to go through the whole procedure in the next days, but I only have Linux hosts for VBox.

1 Like

Apologies, this is my fault as I edited the page yesterday.... "thinking aloud" as it just had snapshot before, i was intending to digest why/cover both...

In future I will do such things on temp pages... saying that, i'm glad you provided feedback as it really accelerates good documentation.

I reverted it, so it is now how it was..... you'll notice there is a comment saying choose ext4 on linux.... from the top of my head.... it is not a linux thing? but more in relation to resizing.....

But it s definately a good point to clearly state the difference better.... which i also noticed last night.....

How do I create a template playground/wip page? cant seem to find the doc for that...atm... easy before..... brain fuzz day me thinks.... ( closest I found: https://openwrt.org/wiki/wikirules )

Just create a page in the inbox, e.g. https://openwrt.org/inbox/yourexperimentalpage (rename as needed).

1 Like

Hi

I made some instructions on how to install LEDE on Virtualbox.

https://quantumwarp.com/kb/articles/25-dsl-broadband/899-run-lede-as-a-virtualbox-virtual-machine

Are you guys updating the official documentation? If you are, you have my permission to use my article.

shoulders

2 Likes

I found more information on the different images right there in the wiki. :wink:

It would be sensible to just link to that wiki page, rather than duplicate the same information about the location of the image files and the similarities/differences between them. After all, using a virtual machine is essentially the same as installing on bare metal. For the VirtualBox wiki page, it's just necessary to explain how to make the .vdi disk and the appropriate configuration of the virtual machine.

There is also some third-party documentation on this site. I have sent a message to the site owner asking permission to use some of his work as the basis for any wiki edits here.

Edit to add: Hello @shoulders , it was me that contacted you – thanks for your response!

1 Like

The one big thing that I could never figure out was, is there a way to add a configurable switch to a VBox installation. This would make it far more useful to be used in the real world for (i.e. VLAN).

use openvswitch for this....

fwiw: here is my playpage: https://openwrt.org/inbox/virtualbox-advanced

1 Like

I guess the explanation is that some people do not touch the topic of virtualization outside of the OpenWrt project scope.

However, as a long-term libvirt user I understand and agree with you, the only OpenWrt-specific point is replacing rtl8139 with e1000 as the default one doesn't work.

OpenWrt supports virtio just fine, which would be even more efficient than qemu's e1000 emulation:

$ qemu-system-x86_64 \
	-machine accel=kvm:tcg \
	-monitor stdio \
	-rtc base=utc \
	-cpu kvm64,+vmx \
	-smp 2 \
	-m 1024 \
	-device VGA \
	-device virtio-net-pci,mac=XX:XX:XX:XX:XX:X0,netdev=tap-br-lan0 \
		-netdev tap,ifname=tap-br-lan0,script=no,id=tap-br-lan0 \
	-device virtio-net-pci,mac=XX:XX:XX:XX:XX:X1,netdev=tap-br-jail0 \
		-netdev tap,ifname=tap-br-jail0,script=no,id=tap-br-jail0 \
	-drive file=/XXX/openwrt-x86-64-combined-squashfs.img,if=none,discard=unmap,index=0,media=disk,format=raw,id=hd0 \
		-device virtio-scsi-pci,id=scsi \
		-device scsi-hd,drive=hd0 \
	-device virtio-rng-pci

Edit: The example above depends on tap-br-lan0 and tap-br-jail0 being provided (with correct access restrictions) by your networking dæmon (ifupdown, systemd-networkd, connman, etc.), using it verbatim requires an according host networking configuration (which is outside of the scope of this little brief, basically a dedicated TAP interface bridged to a physical host interface).

2 Likes

I mean the default network adapter model for libvirt which is used by virt-manager and Gnome Boxes.
By the way, thanks, I set the model to virtio and it seems to work fine.

I'm personally not using libvirt/ virt-manager, but yes, unless configured, qemu defaults to emulating r8139 (which makes sense, as 'any' OS should have (bad-) drivers for it, the same way it defaults to IDE as emulated storage backend, but this is less serious for 'normal' OpenWrt uses) - but using it (or e1000, but less so) comes with a hefty performance penalty, as using it requires a significant overhead. The VirtI/O backend allows much faster operations for storage and networking.

1 Like

I set up a vm on ESXi a few weeks ago wiith 18.06.2 image from https://archive.openwrt.org/releases/18.06.2/targets/x86/64/combined-ext4.img.gz as base disk. You can use the wiki just with the new img-file.
Works fine, having a separate network within vmware, reachable by openvpn only.

A current attempt to update / improve the documentation in the wiki: Improve "Run OpenWrt in VirtualBox" guide

2 Likes

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Hey guys, I've created OpenWrt Vagrant image following OpenWrt on VirtualBox HowTo . Also, here is a git repo with instructions on how to build and run your own box.

At the end of the day, you will only need to execute vagrant up to start a fresh copy of OpenWrt VM.