I’m trying to use the MicroVM library to run a graphical cloud-hypervisor virtual machine with just the packages cage and vlc. I have a configuration to set this up locally, but I though I’d focus on the nix run microvm#graphics which is producing the exact same results.
When I run:
nix run microvm#graphics
/nix/store/[hash]-run-graphics vlc
I get errors like:
evaluation warning: cloud-hypervisor supports systemd-notify via vsock, but `microvm.vsock.cid` must be set to enable this.
error: Cannot build '/nix/store/4h33mcpbgs2xkhsvk4l6pp1zc0mp0mia-cargo-deps-vendor-staging.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/2skg6s6l4k6bqn6anr0wgkqwh614yp51-cargo-deps-vendor-staging
Last 15 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/vixyacvra255sbi3qkz0sy3i7xz1nk66-source
> source root is source
> Running phase: patchPhase
> applying patch /nix/store/291drdqbl10kwr02fz9brjymkkmfvczv-musl-1.2.6.patch
> patching file virtio-devices/src/seccomp_filters.rs
> patching file vmm/src/seccomp_filters.rs
> applying patch /nix/store/v4sbhcbm6ijzbl9knpfh3rwhapgm08d5-0001-build-use-local-vhost.patch
> patching file Cargo.lock
> Hunk #1 FAILED at 2304.
> Hunk #2 FAILED at 2317.
> 2 out of 2 hunks FAILED -- saving rejects to file Cargo.lock.rej
> patching file Cargo.toml
> Hunk #1 FAILED at 55.
> 1 out of 1 hunk FAILED -- saving rejects to file Cargo.toml.rej
For full logs, run:
nix log /nix/store/4h33mcpbgs2xkhsvk4l6pp1zc0mp0mia-cargo-deps-vendor-staging.drv
error: Cannot build '/nix/store/rlpmifbpxh7xdxrwp8xd27l59sd8p852-cargo-deps-vendor.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/0kzrnimrvgs72ryp6jjldm73y2zbb6j7-cargo-deps-vendor
error: Cannot build '/nix/store/ah1lfh59p34h94ihkxxy1djj00f9x5l0-cloud-hypervisor-53.0.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/i1gg47hzrhm6jr4ssjv4czb9pwclknma-cloud-hypervisor-53.0
/nix/store/r1bz6bhsf52ybvbjw7wf2vh4qi79cx5j-cloud-hypervisor-53.0-debug
error: Cannot build '/nix/store/kllyy2l206jdihfrr71lgrjf2qhixngk-microvm-graphical-microvm-microvm-balloon.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/xzrfa5kphwnikqkns7p950g9dk6cvwli-microvm-graphical-microvm-microvm-balloon
error: Cannot build '/nix/store/vnkp49v6mhrp961mg4d1kll5smj4n5ab-microvm-cloud-hypervisor-graphical-microvm.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/zfy4lpmkg5bif9p9lkq5gfa69l94wyp2-microvm-cloud-hypervisor-graphical-microvm
error: builder for '/nix/store/4h33mcpbgs2xkhsvk4l6pp1zc0mp0mia-cargo-deps-vendor-staging.drv' failed with exit code 1;
last 15 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/vixyacvra255sbi3qkz0sy3i7xz1nk66-source
> source root is source
> Running phase: patchPhase
> applying patch /nix/store/291drdqbl10kwr02fz9brjymkkmfvczv-musl-1.2.6.patch
> patching file virtio-devices/src/seccomp_filters.rs
> patching file vmm/src/seccomp_filters.rs
> applying patch /nix/store/v4sbhcbm6ijzbl9knpfh3rwhapgm08d5-0001-build-use-local-vhost.patch
> patching file Cargo.lock
> Hunk #1 FAILED at 2304.
> Hunk #2 FAILED at 2317.
> 2 out of 2 hunks FAILED -- saving rejects to file Cargo.lock.rej
> patching file Cargo.toml
> Hunk #1 FAILED at 55.
> 1 out of 1 hunk FAILED -- saving rejects to file Cargo.toml.rej
For full logs, run:
nix log /nix/store/4h33mcpbgs2xkhsvk4l6pp1zc0mp0mia-cargo-deps-vendor-staging.drv
error: 1 dependencies of derivation '/nix/store/rlpmifbpxh7xdxrwp8xd27l59sd8p852-cargo-deps-vendor.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ah1lfh59p34h94ihkxxy1djj00f9x5l0-cloud-hypervisor-53.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9gkngqwmr3xd3963fw9jg41in1y5sfva-microvm-graphical-microvm-microvm-run.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kllyy2l206jdihfrr71lgrjf2qhixngk-microvm-graphical-microvm-microvm-balloon.drv' failed to build
error: 2 dependencies of derivation '/nix/store/vnkp49v6mhrp961mg4d1kll5smj4n5ab-microvm-cloud-hypervisor-graphical-microvm.drv' failed to build
when I try to do that (with github:microvm-nix/microvm.nix#graphics replacing microvm#graphics), but I don’t get Cannot build, which is usually either caused by a hash mismatch or a deeper issue with your Nix store.
Huh, interesting. I’ve updated the output of the command to the full, exact output. In the meantime, I can try running that command that repairs the Nix store.
Ah, that’s the same error, but for some reason your Nix is outputting lines like:
Either way, there is an issue with how microvm.nix patches cloud-hypervisor. microvm.nix uses the packaging in Spectrum to get a build of cloud-hypervisor with graphical acceleration patches. See:
Unfortunately I don’t see a version of the graphical acceleration patches for cloud-hypervisor 53.0.
You can try rebasing them by hand if you’re really interested enough, but I don’t know how much work that would be. Or if any other microvm.nix backends support graphics.
Either way, this is worth filing as an issue with microvm.nix.