This changes the CLI specification for disks, as it needs to be able to
be repeated.
```
linuxkit run qemu -disk name,size=1G,format=qcow2 ...
```
Options may be omitted.
Currently other local backends may not support multiple disks, but this
can be added in future. Code for cloud backends has not changed as the
disk support is specific to the platform.
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Adds a new --networking option to simplify selection of networking modes
for `linuxkit run hyperkit`. The new modes are "docker-for-mac",
"vpnkit" and "none".
By default docker-for-mac will be used for networking. HyperKit will
then connect to the default VPNKit socket location used by Docker for
Mac.
In vpnkit-mode a new VPNKit instance is started and the socket
"vpnkit_eth.sock" is created in the state directory. This mode also
enables port forwarding via 9p and vsock. The vpnkit mode optionally
accepts a path to an existing VPNKit socket. This allows two or more VMs
to be connected to the same virtual network - but only the VM that
created the the socket can use port forwarding.
Mode "none" disables networking.
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
Add a new flag to set the VPNKit ethernet socket path. Defaults to the
standard location for the socket in Docker for Mac.
This flag can be used to connect to the VPNKit instance started by
another linuxkit VM launched with `-start-vpnkit`. VMs connected to the
same VPNKit instance will be on the same virtual internal network.
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
Adds a flag to launch a new vpnkit instance. This enables port
forwarding via a 9p mount (tag:port) if the guest supports it. Vsock
port 62373 is also opened so vpnkit can forward connections back to the
guest.
If -start-vpnkit is not specified HyperKit will connect to the
vpnkit instance managed by Docker for Mac, as before.
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
- '-disk-size' is now defaults to MB (but can be GB when appending 'G')
- The disk will be created if it doesn't exist (didn't happen in qemu)
Update the documentation.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
For all output formats except kernel+initrd, you must use the full path of
the file they want to run. Make the options auto detect.
Split the uefi option to mean "use uefi firmware" not be ISO specific.
Allow specifying a bootable disk image, so we can test disk image output
formats with qemu too.
Add a test case for qcow2 boot under qemu.
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
- show errors by outputting stderr
- as no input is wired up, fails as requests a tty, so don't do that
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Otherwise escape codes (arrow keys etc) do not work.
This is done only when stdin is a tty.
For clarity spell `--tty-` and `--interactive` out in full rather than using
the short versions.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
When `-vsock-ports` is specified, the listed guest vsock
ports will be made available through unix domain sockets
in the state directory.
Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
The state directory is used to store any user data disk images
and the .vmx file. At run time, it is also used to keep
various other files, such as the nvram, log and lock files, etc.
While at it, also clean up the code a little more and fix the
handling of the "-disk-size" argument when no "-disk" argument
is specified. This brings it in line with the other runners.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
There is no need to prefix local variables and try to name
variables which refer to the same/simialr thing the same
across runners.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
The state directory is used to store:
- the disk image, if not specified via '-disk'
- the ISO for metadata, if '-data' is used
- the Unix domain socket for virtio sockets
- the PID of the hyperkit process
- a JSON file with the hyperkit configuration
This patch also enables the virtio socket device for the VM.
While at it, also fix .gitignore to ignore kernel images again.
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
- What I did
Added the capability to re-use or create a disk from the linuxkit
VMware cli
- How I did it
Using the vmware-diskmanager that comes with Fusion/Workstation
- How to verify it
Run linuxkit run vmware with the -disk -disk-size arguments
- Description for the changelog
Persistent disk functionality added into the VMware backend.
- A picture of a cute animal (not mandatory but encouraged)
nope
Signed-off-by: Dan Finneran <daniel.finneran@gmail.com>
Only subcommand is currently `create` which is a thin wrapper to create an iso
file in the format expected by `pkg/metadata`.
Currently very basic and just takes the content on the command line but could
be extended to read from a file etc.
Signed-off-by: Ian Campbell <ian.campbell@docker.com>
In the WIP code in `moby` we now have a standard base tarball format,
that includes the kernel and cmdline as files in `/boot` so that the
entire output of the yaml file can default to a single tarball. Then
this can be split back up by LinuxKit into initrd, kernel and cmdline
as needed. This will probably become the only output of the `moby build`
stage, with a `moby package` stage dealing with output formats.
We may remove the output format specification from the yaml file as well,
and just have it in the command.
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
- Use 'disk-size' for disk size
- Use 'disk' for the path to the disk image
- Use 'fw' for the path to the EFI firmware
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This fixes a regression where `linuxkit push gcp` no longer allows for a
custom destination to be provided via the `-img-name` flag or the
`CLOUDSDK_IMAGE_NAME` environment variable
Signed-off-by: Dave Tucker <dt@docker.com>
Previously we hardcoded `bzImage` which is not used for all
use cases or architectures.
fix#1630
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
To use `-drive` as an analog for `-hda` or `-hdb`, etc. the qemu
docs note that "media" and "index" are required flags. Local
testing shows that drive shows up properly as `/dev/sda` after
this change.
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Updated go-compile to be able to compile remotely. Note I
did not update the oter users of go-compile as it does not affect
them.
Update `go get` instructions to fetch new one, or `make && make install`
will still work.
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This currently only changes the `gcp` target, but is the new
model - the `build` command will only do things locally, then
you need to `push` to an image store such as GCP or other ones
in order to `run` for platforms that cannot boot directly from
a local image.
Fix#1618
Signed-off-by: Justin Cormack <justin.cormack@docker.com>