Skip to content

Unable to self compile on macOS m1 #111

Closed

Description

@pftbest

I have krunvm installed from brew and I'm trying to compile this project with build_on_krunvm scripts. Both of them fail with a different message. At first glance they look like a network issue, but when I run alpine image both apk and curl work fine in alpine and can connect to the internet just fine. So I'm not sure what it is.

./build_on_krunvm.sh
microVM created with name: libkrunfw-builder
Updating and loading repositories:
 Fedora 43 - aarch64                   ???% [ <=>              ] |   0.0   B/s |   0.0   B |  00m01s
>>> Curl error (56): Failure when receiving data from the peer for https://mirrors.fedoraproject.org
(process:208): GLib-WARNING **: 10:45:13.661: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
 Fedora 43 - aarch64                                        ???% |   0.0   B/s |   0.0   B |  00m03s
>>> Curl error (56): Failure when receiving data from the peer for https://mirrors.fedoraproject.org
>>> Cannot prepare internal mirrorlist: ftruncate() failed: No such file or directory
 Fedora 43 - aarch64 - Updates                              100% |   5.9 KiB/s |   9.4 KiB |  00m02s
>>> Cannot prepare internal mirrorlist: Error while reading xml: No such file or directory
 Fedora 43 openh264 (From Cisco) - aarch64                  100% |   1.2 KiB/s | 987.0   B |  00m01s
>>> Cannot prepare internal mirrorlist: Error while reading xml: No such file or directory
Failed to download metadata (metalink: "https://mirrors.fedoraproject.org/metalink?repo=fedora-43&arch=aarch64") for repository "fedora": Cannot prepare internal mirrorlist: ftruncate() failed: No such file or directory
Error installing dnf-builddep on VM
./build_on_krunvm_debian.sh
microVM created with name: libkrunfw-builder
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Reading package lists... Done
E: Unable to determine file size for fd 7 - fstat (2: No such file or directory)
E: The repository 'http://deb.debian.org/debian bookworm InRelease' provides only weak security information.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Unable to determine file size for fd 7 - fstat (2: No such file or directory)
E: The repository 'http://deb.debian.org/debian bookworm-updates InRelease' provides only weak security information.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Unable to determine file size for fd 7 - fstat (2: No such file or directory)
E: The repository 'http://deb.debian.org/debian-security bookworm-security InRelease' provides only weak security information.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Error updating debian repository
$ krunvm create --name test alpine
microVM created with name: test
$ krunvm start test
/ # apk add curl
( 1/10) Installing brotli-libs (1.2.0-r0)
( 2/10) Installing c-ares (1.34.6-r0)
( 3/10) Installing libunistring (1.4.1-r0)
( 4/10) Installing libidn2 (2.3.8-r0)
( 5/10) Installing nghttp2-libs (1.68.0-r0)
( 6/10) Installing nghttp3 (1.13.1-r0)
( 7/10) Installing libpsl (0.21.5-r3)
( 8/10) Installing zstd-libs (1.5.7-r2)
( 9/10) Installing libcurl (8.17.0-r1)
(10/10) Installing curl (8.17.0-r1)
Executing busybox-1.37.0-r30.trigger
OK: 13.6 MiB in 26 packages
/ #
/ # curl http://deb.debian.org/debian
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://ftp.debian.org/debian/">here</a>.</p>
<hr>
<address>Apache Server at ftp.debian.org Port 80</address>
</body></html>
/ #

Activity

  1. pftbest commented on Feb 9, 2026

    @pftbest
    Author

    Updated krunvm to version 0.2.6 and now it works. It was a bug in the previous version.

  2. slp commented on Feb 9, 2026

    @slp
    Collaborator

    As a reference, the problem was a combination of libkrun/libkrun#513 and libkrun/krunvm#79. I've just released new versions of both to address the problem.

  3. slp commented on Feb 9, 2026

    @slp
    Collaborator

    BTW, thanks @pftbest for the issue report!

  4. pftbest commented on Feb 9, 2026

    @pftbest
    Author

    @slp Thanks! Unfortunately I've run into yet another issue. For some reason removing temporary directories sometimes does not work inside the VM. For example when I try to install some package in debian I get this errors all the time

    rm: cannot remove '/var/lib/dpkg/tmp.ci': Directory not empty
    

    When I manually look into this directory it seems empty, however when I run rm -rf command it fails and immediately after that there is a file called control that automatically disappears after around 5 seconds.

    I also see a similar issue when compiling linux kernel, it also complains about removing some temporaries.

    At this point I'm not even sure this is krunvm fault, maybe I have some software running on the host that creates this control files? I don't see any mention of them in libkrun.

    root@debs:/#
    root@debs:/#
    root@debs:/# ls -al /var/lib/dpkg/tmp.ci
    total 0
    root@debs:/#
    root@debs:/#
    root@debs:/#
    root@debs:/#
    root@debs:/# rm -rf /var/lib/dpkg/tmp.ci/
    rm: cannot remove '/var/lib/dpkg/tmp.ci/': Directory not empty
    root@debs:/#
    root@debs:/#
    root@debs:/# ls -al /var/lib/dpkg/tmp.ci
    total 4
    -rw-r--r-- 1 root root 688 Sep  2  2022 control
    root@debs:/#
    root@debs:/#
    root@debs:/# ls -al /var/lib/dpkg/tmp.ci
    total 0
    root@debs:/#
    root@debs:/#
    root@debs:/#
    

    EDIT: Managed to read the file, it was created by debian apt-get, it is part of deb package that was extracted into this dir. But for some reason guest doesn't see it, until you try to remove the dir, then it sees it for a couple of seconds.

  5. slp commented on Feb 10, 2026

    @slp
    Collaborator

    @slp Thanks! Unfortunately I've run into yet another issue. For some reason removing temporary directories sometimes does not work inside the VM. For example when I try to install some package in debian I get this errors all the time

    rm: cannot remove '/var/lib/dpkg/tmp.ci': Directory not empty
    

    Could you please create an issue in libkrun to track this one?

  6. pftbest commented on Feb 10, 2026

    @pftbest
    Author

    done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions