astro / microvm.nix

NixOS MicroVMs
https://astro.github.io/microvm.nix/
MIT License
1.42k stars 103 forks source link

Grahics example fails with error #173

Closed PAB-me-uk closed 11 months ago

PAB-me-uk commented 11 months ago

Hi,

I get the below when attempting to run the graphic example, please can you assist?

nix run microvm#graphics neverball          
warning: ignoring untrusted substituter 'https://microvm.cachix.org'
[2023-12-22T17:56:05.124632544+00:00 INFO  crosvm] crosvm started.
[2023-12-22T17:56:05.124726960+00:00 INFO  crosvm] CLI arguments parsed.
[2023-12-22T17:56:05.242074426+00:00 INFO  devices::virtio::vhost::user::device::handler::sys::unix] vhost-user connection closed
[2023-12-22T17:56:05.242197616+00:00 INFO  crosvm] exiting with success
Error booting VM: VmBoot(DeviceManager(CreateVirtioGpu(VhostUserGetProtocolFeatures(VhostUserProtocol(InvalidMessage)))))

I am not sure why your cache is not trusted I did select Y when prompted after using nix registry add microvm github:astro/microvm.nix to install.

Also is there an easy method to increase logging of underlying tool etc so I could gather more information or debug myself?

Thanks for all your hard work on this project!

ghost commented 11 months ago

I am not sure why your cache is not trusted I did select Y when prompted after using nix registry add microvm github:astro/microvm.nix to install.

I think you haven't added your user to nix trusted users list.

PAB-me-uk commented 11 months ago

Rather than make my user a trusted user I added the following to my nix config:

  nix.settings.trusted-substituters = [
    "https://microvm.cachix.org"
  ];

I now get the following output:

nix run microvm#graphics neverball
[2023-12-24T14:48:38.528980405+00:00 INFO  crosvm] crosvm started.
[2023-12-24T14:48:38.529091863+00:00 INFO  crosvm] CLI arguments parsed.
[2023-12-24T14:48:38.645483346+00:00 INFO  devices::virtio::vhost::user::device::handler::sys::unix] vhost-user connection closed
[2023-12-24T14:48:38.645615794+00:00 INFO  crosvm] exiting with success
Error booting VM: VmBoot(DeviceManager(CreateVirtioGpu(VhostUserGetProtocolFeatures(VhostUserProtocol(InvalidMessage)))))

and the following in logs:

Dec 24 14:50:07 nixos-omen nix-daemon[8738]: accepted connection from pid 21438, user pab
Dec 24 14:50:07 nixos-omen nix-daemon[8738]: accepted connection from pid 21443, user pab
Dec 24 14:50:11 nixos-omen crosvm[27590]:  [src/main.rs:835] crosvm started.
Dec 24 14:50:11 nixos-omen crosvm[27590]:  [src/main.rs:693] CLI arguments parsed.
Dec 24 14:50:11 nixos-omen crosvm[27590]:  [devices/src/virtio/vhost/user/device/handler/sys/unix.rs:39] vhost-user connection closed
Dec 24 14:50:11 nixos-omen crosvm[27590]:  [src/main.rs:840] exiting with success

how can I debug further?

kuruczgy commented 11 months ago

I would guess that graphics with cloud-hypervisor is broken. Could you try changing the graphics example to use hypervisor = "crosvm"?

astro commented 11 months ago

Unless the cloud-hypervisor patch gets updated, I am going to remove it.

We could switch to the probably slower waypipe over vsock, or wait for the qemu-specific https://github.com/NixOS/nixpkgs/pull/275820

kuruczgy commented 11 months ago

Since @alyssais chose cloud-hypervisor as the primary vmm for SpectrumOS, I expect that she will have an updated patch for it eventually.

alyssais commented 11 months ago

I've had an updated patch for it since before this issue was opened. :P

https://spectrum-os.org/git/spectrum/tree/pkgs/cloud-hypervisor?id=5240ec4a5a9c3a58d3990502e7d931c041961b45

astro commented 11 months ago

Also, @alyssais moved the pkg into a smaller repo which is now updatable easily through flake inputs: f26fd86

Thanks to everyone involved!