Add a quick start to the README, reorganize and make the main
documentation less reference-like, and add a man page.
Signed-off-by: Alberto Faria <afaria@redhat.com>
It allows settings the disk size of the VM image that is generated from
a bootc container image.
Also improve the default disk size by basing it on the container image
size.
Signed-off-by: Alberto Faria <afaria@redhat.com>
We attempt to detect if a container image is bootable. We can't easily
retrieve the image's labels, so we check if /usr/lib/bootc/install
exists and is a directory. If so, it is a bootable container. If it is a
bootable container but we're not running under Podman, we fail with an
error.
Once our container's entrypoint starts running, a background process on
the host (outside the container) queries Podman for the image's name and
ID, which the OCI runtime does not get but bootc-install needs. It then
saves the container image as an OCI archive.
It then runs the original container to generate the VM image. We do this
using krun [1] so that elevated privileges aren't necessary. Our
entrypoint blocks until this is done, and all subsequent logic remains
the same.
We could potentially avoid the OCI archive creation step by mounting the
host's container storage into the container running under krun. This
isn't trivial to achieve due to SELinux label and context mismatches
between the host and the krun environment, so we leave this optimization
for a future date.
Closes#26.
[1] https://github.com/containers/crun/blob/main/krun.1.md
Signed-off-by: Alberto Faria <afaria@redhat.com>
Instead of falling back to system emulation when /dev/kvm is not
available, let the user decide explicitly whether they want
hardware-assisted KVM virtualization or full emulation.
Signed-off-by: Alberto Faria <afaria@redhat.com>
Containerdisks now set their entrypoint to "no-entrypoint", so we can
drop the empty "" argument to podman-run and equivalents in most cases.
Signed-off-by: Alberto Faria <afaria@redhat.com>
Using these options requires binding the device to the vfio-pci driver
in the host, and may require special configuration of locked memory
limits.
Without these options, the user has to customize the libvirt XML
directly to achieve PCI device passthrough, which should make it clearer
that they have to take care of all these details.
Signed-off-by: Alberto Faria <afaria@redhat.com>
In step 1, since editing /etc is not desirable for rootless Podman,
mention the alternative location that will have the same effect.
In step 2, there's no need for the disclaimer paragraph about Docker
lacking --latest in an example that already can't use Docker because
of lack of --rootfs a couple paragraphs above. And even for Podman,
make it clear that the initial example is limited, in that the qcow2
image has no ssh keys, root password, or alternative users installed
yet.
Signed-off-by: Eric Blake <eblake@redhat.com>
It allows passing regular files and block devices in any format that
QEMU understands (e.g., raw, qcow2) through to the guest as block
devices.
Signed-off-by: Alberto Faria <afaria@redhat.com>
Use it to pass in an XML file to be merged into the generated libvirt
domain XML definition. It may be specified multiple times.
Signed-off-by: Alberto Faria <afaria@redhat.com>
When specified, the container does not launch a VM but instead simply
outputs the generated libvirt domain XML and exits.
Signed-off-by: Alberto Faria <afaria@redhat.com>
When used in conjunction with --rootfs, changes are propagated back to
the user's original image file.
Signed-off-by: Alberto Faria <afaria@redhat.com>