erikarvstedt / extra-container

Run declarative NixOS containers without full system rebuilds

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to create container on Ubuntu 20.04.2 LTS

aanderse opened this issue Β· comments

Hello πŸ‘‹

I run an example from the website:

sudo extra-container create --start <<'EOF'
{
  containers.foobar = {
    privateNetwork = true;
    hostAddress = "10.250.0.1";
    localAddress = "10.250.0.2";

    config = { pkgs, ... }: {
      systemd.services.hello = {
        wantedBy = [ "multi-user.target" ];
        script = ''
          while true; do
            echo hello | ${pkgs.netcat}/bin/nc -lN 50
          done
        '';
      };
      networking.firewall.allowedTCPPorts = [ 50 ];
    };
  };
}
EOF

The container fails to start, though. Here is the error:

container foobar[3550533]: Spawning container foobar on /var/lib/containers/foobar.
container foobar[3550533]: Press ^] three times within 1s to kill container.
container foobar[3550539]: /etc/localtime does not point into /usr/share/zoneinfo/, not updating container timezone.
container foobar[3550540]: Failed to mount sysfs (type sysfs) on /sys/full (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC ""): No such file or directory
container foobar[3550533]: Failed to register machine: Machine 'foobar' already exists
systemd[1]: container@foobar.service: Main process exited, code=exited, status=1/FAILURE

A few points:

  • Failed to register machine: Machine 'foobar' already exists - I have never created a foobar container on this machine before
  • Failed to mount sysfs (type sysfs) on /sys/full (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC ""): No such file or directory - /sys/full doesn't exist... should it?

Do you have any ideas on how to resolve this? Any and all help is greatly appreciated πŸ™‡

Thanks!

commented

In case upgrading to 22.04.2 LTS is an option for you, I just wanted to let you know it has been working well for me under that version of Ubuntu.

Thanks for letting me know @msteen!

Please reopen if using 22.04.2 LTS is not an option for you.