Closed rwmjones closed 7 months ago
Note my tarball was prepared with SELinux labels. systemd will refuse to boot hard if it finds an unlabelled filesystem, so if you have that you'll need to either do selinux=0
or g.touch("/.autorelabel")
in the Python script.
The domain should go away on its own at shut down (since it is --transient
), but you could also kill it with virsh destroy <N>
. However the _VARS.fd
file is left over afterwards (libvirt bug) so you have to delete that manually else it will interfere with future boots of any same-named VM.
Functionally what the python script above does is fine, but FWIW, the creation of a /boot
partition is redundant in this particular setup. The above fully boots from just the ESP partition, so the /boot
partition isn't adding any value. IOW, the whole thing would functionally work fine with merely the ESP and root FS partitions.
Thanks for reaching out, @rwmjones.
Are you sure this is the right repo to reach out to? I created github.com/vrothberg/bootc-playground just to make it easier to play with the various disk images and possibilities of using bootc. The Makefile was mostly intended to write the command lines once. In other words, it's just a pet project to make my life easier and to share it with others if they want to play with bootc and don't have much experience fiddling with virt-install.
Shall we move this issue over to https://github.com/containers/bootc? I think we'll reach the right audience there.
Sure, Vivek pointed me to this one. Can we copy the issue over somehow?
Sure, Vivek pointed me to this one. Can we copy the issue over somehow?
I thought it would be possible to move issues across projects (i.e., from github.com/vrothberg
to github.com/containers
) but it doesn't seem to work actually, sorry.
Can you recreate the issue over at https://github.com/containers/bootc?
Vivek asked me to look this one over and I have a few suggestions which I'll attach here.
First of all, nbdkit could really do with a plugin that automates everything below. The hard part (for me) is to find and download the container data. Surely there are APIs to do that, but I've no idea how. So we could collaborate on that.
Secondly you can make a bootable disk image directly in various ways. You need to choose your poison^Wboot method. Possibilities include extlinux or direct kernel booting (
qemu -kernel
). But here I'm going to use UEFI -> shim -> kernel which has the advantage that it is compatible with Secure Boot. Note this requires a newish feature in Fedora 38 called Unified Kernel Image.So say you've got a
*.tar.gz
containing the files in your operating system. The following script will create a bootable qcow2 file from it. Note the script does not need to be run as root (and ideally should not be run as root).To boot this as a transient VM:
(That
rm
command is because of a bug in libvirt)To create the
*.tar.gz
file for testing purposes I used this script, but I guess in your case you'd somehow get podman to give you the tarball. (See my nbdkit request above).