Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

krun ls fails due to system event #19

Open
RossComputerGuy opened this issue May 30, 2024 · 4 comments
Open

krun ls fails due to system event #19

RossComputerGuy opened this issue May 30, 2024 · 4 comments

Comments

@RossComputerGuy
Copy link

$ RUST_LOG=debug krun --net=TSI ls / 
[2024-05-30T01:48:08Z DEBUG krun] env vars env=["LD_LIBRARY_PATH=/nix/store/86zx04zbngd4skkrxfd5ndhx8f6ap24v-pipewire-1.0.6-jack/lib", "MESA_LOADER_DRIVER_OVERRIDE=asahi", "PATH=/run/wrappers/bin:/home/ross/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/home/ross/.nix-profile/bin:/nix/profile/bin:/home/ross/.local/state/nix/profile/bin:/etc/profiles/per-user/ross/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/nix/store/5mal6aa0s9fxnqibmybkz19bxh8scig2-gcc-wrapper-13.2.0/bin:/nix/store/5pfllkhmmdrwi5z1da1009lx128kfbbq-binutils-wrapper-2.41/bin:/nix/store/xyg13851ggmvasxadqxk6l3cyqgaff2n-pciutils-3.12.0/bin:/nix/store/nppl7x028hckyrmba7q8w8pn0b7rf1kr-pkgconf-wrapper-2.1.1/bin", "RUST_LOG=debug"]
[2024-05-30T01:48:08Z INFO  vmm::linux::vstate] Guest memory starts at 0xfffe03c30000
[2024-05-30T01:48:08Z INFO  vmm::linux::vstate] Guest memory starts at 0xfffc03c30000
[2024-05-30T01:48:08Z DEBUG devices::virtio::gpu::device] virtio_gpu: set_shm_region
[2024-05-30T01:48:09Z ERROR vmm::linux::vstate] Unexpected exit reason on vcpu run: SystemEvent(2, [0])
[2024-05-30T01:48:09Z INFO  vmm] Vmm is stopping.
@teohhanhui
Copy link
Collaborator

Do not set RUST_LOG as it'd always fail. Also, you want to use passt, not TSI.

@RossComputerGuy
Copy link
Author

Okay, this is what happens:

$ krun ls
No IPv4 nameserver available for DHCP
No IPv6 nameserver available for NDP/DHCPv6
FAIL: 1

@slp
Copy link
Collaborator

slp commented May 30, 2024

Is there an easy way for trying this on nix?

@RossComputerGuy
Copy link
Author

RossComputerGuy commented May 30, 2024

Is there an easy way for trying this on nix?

Yes, I have made this overlay:

final: prev: {
  virglrenderer = prev.virglrenderer.overrideAttrs (f: p: {
    version = "git+84efb186c1dacc0838770027f73a09d065a5bbdf";

    src = prev.fetchurl {
      url = "https://gitlab.freedesktop.org/slp/virglrenderer/-/archive/84efb186c1dacc0838770027f73a09d065a5bbdf/virglrenderer-84efb186c1dacc0838770027f73a09d065a5bbdf.tar.bz2";
      hash = "sha256-fskcDk5agQhc1GI0f8m920gBoQPfh3rXb/5ZxwKSLaA=";
    };

    mesonFlags = [
      "-Ddrm-msm-experimental=true"
      "-Ddrm-asahi-experimental=true"
    ];
  });

  libkrun = (prev.libkrun.override {
    libkrunfw = prev.libkrunfw.overrideAttrs (f: p: {
      version = "git+bb1506b92ed78da880fc1a2f0e1180040f1a7a36";

      src = prev.fetchFromGitHub {
        owner = "containers";
        repo = f.pname;
        rev = "bb1506b92ed78da880fc1a2f0e1180040f1a7a36";
        hash = "sha256-BN6v33iKgs+7n3ITaeERVg3S06xdQMH7PIAYtRpQ7UU=";
      };

      kernelSrc = prev.fetchurl {
        url = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.6.22.tar.xz";
        hash = "sha256-I+PntWQHJQ9UEb2rlXY9C8TjoZ36Qx2VHffqyr1hovQ=";
      };

      nativeBuildInputs = p.nativeBuildInputs ++ (with final; [ perl openssl ]);

      # Needed for Apple Silicon
      postPatch = p.postPatch + ''
        cp ${config.boot.kernelPackages.kernel.configfile} config-libkrunfw_aarch64
      '';

      meta.platforms = p.meta.platforms ++ [ "aarch64-linux" ];
    });
  }).overrideAttrs (f: p: {
    version = "git+0bea04816f4dc414a947aa7675e169cbbfbd45dc";

    src = prev.fetchFromGitHub {
      owner = "containers";
      repo = f.pname;
      rev = "0bea04816f4dc414a947aa7675e169cbbfbd45dc";
      hash = "sha256-eo48jhc6L92+ycSMwBtFO0qhbtanx+SXm1eJgYlsass=";
    };

    nativeBuildInputs = p.nativeBuildInputs ++ (with final; [
      pkg-config
      llvmPackages_latest.clang
    ]);

    buildInputs = p.buildInputs ++ (with final; [
      libepoxy
      libdrm
      pipewire
      virglrenderer
    ]);

    env.LIBCLANG_PATH = "${final.llvmPackages_latest.clang-unwrapped.lib}/lib/libclang.so";

    cargoDeps = final.rustPlatform.fetchCargoTarball {
      inherit (f) src;
      hash = "sha256-Mj0GceQBiGCt0KPXp3StjnuzWhvBNxdSUCoroM2awIY=";
    };

    makeFlags = p.makeFlags ++ [
      "GPU=1"
      "SND=1"
      "NET=1"
    ];
  });

  krunvm = (prev.krunvm.override {
    inherit (final) libkrun;
  }).overrideAttrs (f: p: {
    version = "git+5494d84a66bee3b802a0392cf8d662158ac7287d";

    src = prev.fetchFromGitHub {
      owner = "containers";
      repo = f.pname;
      rev = "5494d84a66bee3b802a0392cf8d662158ac7287d";
      hash = "sha256-BfNRGMiA8CigYvsNnMz5Lqj2l0xMu833tLcB80WmFFU=";
    };

    cargoDeps = prev.rustPlatform.fetchCargoTarball {
      inherit (f) src;
      hash = "sha256-yie39jVAH0N+5ZBTv+1NzNV+CJoDadF1nNWrirCfEBc=";
    };
  });

  krun = final.rustPlatform.buildRustPackage rec {
    pname = "krun";
    version = "git+${src.rev}";

    src = prev.fetchFromGitHub {
      owner = "slp";
      repo = "krun";
      rev = "5a8542a5066bd1a4d8bad99236f05ea3ac687ef7";
      hash = "sha256-3w1JHqzpkF11+3yHN3yPu2dKdi4qXdO8HY+7ICugAZA=";
    };

    cargoHash = "sha256-dtj3TiszBBsMtlJaaIyTmCNAGZy/zuSGSK8OOTb5Xmg=";

    nativeBuildInputs = [
      final.rustPlatform.bindgenHook
    ];

    buildInputs = [
      libkrun
    ];

    cargoLock.lockFile = "${src}/Cargo.lock";
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants