Commit Graph

40 Commits

Author SHA1 Message Date
Alberto Faria 3f91463462 docs: Fix some links
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-10-04 15:16:23 +01:00
Alberto Faria 138b168e33 docs: Fix QEMU emulator dependency names
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-08-11 18:41:54 +01:00
Alberto Faria fc5d916371 docs: List skopeo as a runtime dependency
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-07-18 19:26:02 +01:00
Alberto Faria 58da5ed7f2 Revamp docs
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>
2024-07-17 23:11:26 +01:00
Alberto Faria 132cc4c52a Add --bootc-disk-size option
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>
2024-07-11 15:31:21 +01:00
Alberto Faria a9118ee63c Add support for running bootc bootable containers
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>
2024-07-11 15:31:11 +01:00
Alberto Faria 6bdeaa4cf1 docs: Update example.gif to use a Fedora 40 containerdisk
Also drop the -it and --rm flags and the now-unnecessary "" argument.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-04-28 16:51:22 +01:00
Alberto Faria 01eb9bd485 create: Add an --emulated flag
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>
2024-04-28 01:17:47 +01:00
Alberto Faria 9fbf17928e Switch to Fedora 40 everywhere
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>
2024-04-25 01:10:54 +01:00
Alberto Faria bb3309afe3 create: Always require absolute paths for custom options
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-04-13 15:59:32 +01:00
Alberto Faria 99d74d5acd docs: Add Fedora install instructions
crun-vm is now packaged in Fedora 38 and above.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-03-22 07:39:21 +00:00
Alberto Faria 4dbd7bc986 Drop options --vfio-pci and --vfio-pci-mdev
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>
2024-03-21 18:38:58 +00:00
Alberto Faria 1c173e4595 src/commands/exec: Add --as option to set user to ssh as, and default to root
Closes #10

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-03-21 17:15:35 +00:00
Alberto Faria 464252c53d Don't use `--security-opt label=disable` with Docker
crun-vm now works with Docker without this option on Fedora 39.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-03-15 13:02:02 +00:00
Alberto Faria 982af4f4db docs: Remove placeholder "Internals" page for now
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-03-01 22:40:49 +00:00
Alberto Faria f517340817 src/commands/exec: Try to avoid exec errors while the VM is booting
Instead make exec block until the VM's SSH server is ready.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-02-16 18:41:10 +00:00
Alberto Faria acbe5de5af docs: Add dependency on openssh-clients Fedora package
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-02-14 11:21:21 +00:00
Eric Blake e3344483f4 docs: various tweaks from a first-time reader
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>
2024-01-26 09:19:45 -06:00
Alberto Faria 41d6f8c33b src/commands/create: Set RLIMIT_NOFILE for the container
This precludes the need to increase Docker's global limit.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-20 01:11:43 +00:00
Alberto Faria 7ba69c3fa6 docs/example.gif: Update as per renaming to crun-vm
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-13 16:24:48 +00:00
Daniel J Walsh 557708a336
Change name from crun-qemu to crun-vm
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-01-12 13:02:54 -05:00
Alberto Faria 2d36a767a5 Add --blockdev custom option
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>
2024-01-10 17:34:09 +00:00
Alberto Faria 8262faaec8 Prefer --password to --cloud-init in examples
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-10 11:36:32 +00:00
Alberto Faria 727172048c docs: List package libselinux-devel as a dependency on Fedora
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-09 11:48:16 +00:00
Alberto Faria 976e140fa5 docs: Move --vfio-pci[-mdev] into the "Advanced options" section
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-06 16:36:54 +00:00
Alberto Faria ea9efd8f32 Add --merge-libvirt-xml custom option
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>
2024-01-06 16:36:51 +00:00
Alberto Faria 02261c17b5 Add --print-libvirt-xml custom flag
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>
2024-01-06 14:41:14 +00:00
Alberto Faria f1ff0a149f docs: Don't encourage block device passthrough using -v or --mount
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-03 19:52:10 +00:00
Alberto Faria ed4ce6381f README: Add example GIF
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-02 23:09:16 +00:00
Alberto Faria 27abddf328 docs: Use Markdown alerts for warnings
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-02 21:03:50 +00:00
Alberto Faria cd9301b736 Rename flag --persist-changes to --persistent
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-01 16:19:07 +00:00
Alberto Faria 4490df95af Ensure mandatory cloud-init files are present when --cloud-init is given
Signed-off-by: Alberto Faria <afaria@redhat.com>
2024-01-01 01:27:52 +00:00
Alberto Faria d93edfea29 Restrict --password option to the default user
The current approach causes other default user configurations to be
lost.

Signed-off-by: Alberto Faria <afaria@redhat.com>
2023-12-28 14:21:55 +00:00
Alberto Faria 5fcae6dd78 Add --password option to set user password
Signed-off-by: Alberto Faria <afaria@redhat.com>
2023-12-28 13:47:11 +00:00
Alberto Faria 5551f88ef9 src/commands/create: Allow bind mounting regular files as block devices
Signed-off-by: Alberto Faria <afaria@redhat.com>
2023-12-25 19:57:00 +00:00
Alberto Faria fe437e92ed docs: Minor tweak
Signed-off-by: Alberto Faria <afaria@redhat.com>
2023-12-25 10:25:50 +00:00
Alberto Faria 8c550f5666 docs: Write "crun-qemu" in plain text
Signed-off-by: Alberto Faria <afaria@redhat.com>
2023-12-24 23:44:52 +00:00
Alberto Faria 8d544918d5 Add --persist-changes option
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>
2023-12-24 23:30:19 +00:00
Alberto Faria 3bfeefdb23 Fix typo
Signed-off-by: Alberto Faria <afaria@redhat.com>
2023-12-24 15:40:45 +00:00
Alberto Faria 0c99f46501 Reorganize documentation
Signed-off-by: Alberto Faria <afaria@redhat.com>
2023-12-24 15:36:00 +00:00