Mic92 / vmsh

Shell into a virtualized linux, with your own tools
https://vmsh.thalheim.io
MIT License
131 stars 7 forks source link

thread 'main' panicked #427

Open luochen1990 opened 1 year ago

luochen1990 commented 1 year ago
$ journalctl -u microvm@gitlab-runner-vm.service --no-pager --since='20min ago'
8月 05 17:06:00 fxpc-nixos microvm@gitlab-runner-vm[433245]: gitlab-runner-vm login: [53577.194296] INFO: task kworker/0:2:101 blocked for more than 122 seconds.
8月 05 17:06:00 fxpc-nixos microvm@gitlab-runner-vm[433245]: [53577.198428]       Not tainted 6.1.42 #1-NixOS
8月 05 17:06:00 fxpc-nixos microvm@gitlab-runner-vm[433245]: [53577.200947] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
8月 05 17:08:02 fxpc-nixos microvm@gitlab-runner-vm[433245]: [53700.075358] INFO: task kworker/0:2:101 blocked for more than 245 seconds.

$ vmsh console 433245                                                                                                                                                   101 ↵
thread 'main' panicked at 'Mismatch between definition and access of `backing-file`. Could not downcast to TypeId { t: 6626540671867581809 }, need to downcast to TypeId { t: 14115429553192329069 }
', /build/cargo-vendor-dir/clap_builder-4.3.19/src/parser/error.rs:32:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Mic92 commented 1 year ago

What hypervisor did you use?

luochen1990 commented 1 year ago

Following are my full nixos config about microvm, I havn't manually specify hypervisor, so it should be the default value qemu :

{ config, pkgs, inputs, ... }:
{
  imports = [
    inputs.microvm.nixosModules.host
  ];

  config = {

    # DOC: https://astro.github.io/microvm.nix/declarative.html
    microvm.vms = {
      gitlab-runner-vm = {
        config = {
          # It is highly recommended to share the host's nix-store
          # with the VMs to prevent building huge images.
          microvm.shares = [{
            source = "/nix/store";
            mountPoint = "/nix/.ro-store";
            tag = "ro-store";
            proto = "virtiofs";
          }];

          microvm.interfaces = [
            {
              type = "user";
              id = config.mainInterface; # interface name on the host
              mac = "02:00:00:00:00:01"; # Ethernet address of the MicroVM's interface, not the host's
            }
          ];

          # This is necessary to import the host's nix-store database
          microvm.writableStoreOverlay = "/nix/.rw-store";

          # Any other configuration for your MicroVM

          # Gitlab Runner
          services.gitlab-runner = {
            enable = true;
            services = {
              mygitlab = {
                registrationConfigFile = "/path/to/config";
                executor = "shell";
                #dockerImage = "nixos/nix:latest";
              };
            };
          };

          #Workaround of https://github.com/NixOS/nixpkgs/issues/245365
          virtualisation.docker = {
            listenOptions = [ "/run/docker.sock" "127.0.0.1:2375" ];
          };
          systemd.services.gitlab-runner.environment.DOCKER_HOST = "tcp://127.0.0.1:2375";
          networking.proxy.allProxy = null; #Workaround of https://github.com/docker-archive/toolbox/issues/539

        };
      };
    };

  };
}