Allow to specify more than one networking adapter for vbox

Note: this patch introduces an incompatibility in the
`linuxkit run vbox` arguments.

It wasn't impossible to specify more than one network adapter
to the `linuxkit run vbox` command.

This patch allows to specify more than one `-networking` argument to specify
different network adapters.

For instance:
~~~sh
linuxkit run vbox -networking type=nat -networking type=hostonly,adapter=vboxnet0
~~~
will setup the VM with 2 NICs.

It is also possible to get rid of the `type` argument.

Signed-off-by: Brice Figureau <brice@daysofwonder.com>
This commit is contained in:
Brice Figureau
2018-07-27 19:30:25 +02:00
parent f1f128c6dd
commit 02e5f70589
2 changed files with 76 additions and 22 deletions

View File

@@ -20,11 +20,20 @@ stdio, providing interactive access to the VM.
## Disks
The Virtualbox backend support configuring a persistent disk using the
standard `linuxkit` `-disk` syntax. Multiple disks are
standard `linuxkit` `-disk` syntax. Multiple disks are
supported and can be created in `raw` format; other formats that VirtualBox
supports can be attached
supports can be attached. Note that additional drives are attached to the
SATA Controller, unlike the VM disk which is on the IDE Controller.
## Networking
You can select the networking mode, which defaults to the standard `nat`, but
some networking modes may require additional configuration.
You can select the networking mode, which defaults to the standard `nat`, by using the
`-networking` command-line option. Some networking modes (`hostonly`, `bridge`) will require
the additional `adapter` parameter to the `-networking` option:
~~~
-networking hostonly,adapter=vboxnet0
~~~
You can specify more than one `-networking` option to setup multiple adapters. It is
recommended to setup the first adapter as `nat`.