help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anyone got distrobox working?


From: Fredrik Salomonsson
Subject: Re: Anyone got distrobox working?
Date: Wed, 25 Oct 2023 17:39:28 +0000

Hi,

wolf <wolf@wolfsden.cz> writes:

> Podman does work, but there is no built in service to configure it correctly.
> Snippet from my system configuration:
>
>     (simple-service 'subugid-config etc-service-type
>                     `(("subuid" ,(plain-file "subuid" "wolf:100000:65536\n"))
>                       ("subgid" ,(plain-file "subgid" 
> "wolf:100000:65536\n"))))
>     (simple-service 'containers etc-service-type
>                     `(("containers/storage.conf" ,(plain-file 
> "containers-storage.conf" "[storage]\ndriver = \"btrfs\"\n"))
>                       ("containers/policy.json" ,(local-file 
> "files/policy.json"))))
>
> And files/policy.json:
>
>     {
>         "default": [
>             {
>                 "type": "insecureAcceptAnything"
>             }
>         ],
>         "transports":
>         {
>             "docker-daemon":
>             {
>                 "": [{"type":"insecureAcceptAnything"}]
>             }
>         }
>     }
>
> After that, guix shell podman -- podman run --rm hello-world .
>

Thanks for sharing you configuration.  I think I got podman working with
the following system services:

```scheme
      (simple-service 'subugid-config etc-service-type
                      `(("subuid" ,(plain-file "subuid" 
"plattfot:100000:65536\n"))
                        ("subgid" ,(plain-file "subgid" 
"plattfot:100000:65536\n"))))
      (simple-service 'containers etc-service-type
                      `(("containers/storage.conf" ,(plain-file 
"containers-storage.conf"
                                                                "\
[storage]
driver = \"btrfs\"
"))
                        ("containers/policy.json" ,(plain-file "policy.json"
                                                               "\
{
    \"default\": [
        {
            \"type\": \"insecureAcceptAnything\"
        }
    ],
    \"transports\":
    {
        \"docker-daemon\":
        {
            \"\": [{\"type\":\"insecureAcceptAnything\"}]
        }
    }
}
"))
                        ("containers/registries.conf" ,(plain-file 
"registries.conf"
                                                                "\
unqualified-search-registries = ['quay.io', 'docker.io']
[[registry]]
location='localhost:5000'
insecure=true
"))))
```

The hello-world from docker.io works, the one from quay.io does not.
But might be an issue on their side.

>> Has anyone got distrobox working and if so how?
>
> No idea about distrobox, but the above should get the podman working.

I got further with distrobox now when podman seems to be correctly
setup.

```
guix shell distrobox -- distrobox create -i docker.io/library/ubuntu:22.04
```

Works, but I cannot enter the container:

```
$ guix shell distrobox conmon runc -- distrobox enter ubuntu-22-04
Container ubuntu-22-04 is not running.
Starting container ubuntu-22-04
run this command to follow along:

 /gnu/store/yph7wgfp922w7ck6pclgq10mcg7j5gxi-podman-4.4.1/bin/podman logs -f 
ubuntu-22-04

 Error: could not start entrypoint.
+ '[' -n '' ']'
+ printf 'distrobox: Installing basic packages...\n'
++ basename /gnu/store/3g4msmrx9sswxzccv578h5cyk4a80zpg-bash-5.1.16/bin/bash
+ shell_pkg=bash
+ '[' bash = ash ']'
+ '[' 0 -ne 0 ']'
+ test -x find
+ test -x apk
+ test -x apt-get
+ test -x dnf
+ test -x emerge
+ test -x microdnf
+ test -x pacman
+ test -x slackpkg
+ test -x swupd
+ test -x xbps-install
+ test -x yum
+ test -x zypper
+ printf 'Error: could not find a supported package manager.\n'
+ printf 'Error: could not set up base dependencies.\n'
+ exit 127
+ '[' 127 -ne 0 ']'
+ printf 'Error: An error occurred\n'
distrobox: Installing basic packages...
Error: could not find a supported package manager.
Error: could not set up base dependencies.
Error: An error occurred
```

Looks like there are some missing OCI binaries, I used `--verbose` and
rerun it and saw this in the output:

```
$ guix shell distrobox conmon runc -- distrobox enter ubuntu-22-04 --verbose
…
DEBU[0000] [graphdriver] trying provided driver "btrfs" 
DEBU[0000] Initializing event backend file              
DEBU[0000] Configured OCI runtime crun-wasm initialization failed: no valid 
executable found for OCI runtime crun-wasm: invalid argument 
DEBU[0000] using runtime "runc" from $PATH: 
"/gnu/store/vfgxc5n2ygac691iivfjmd3nn9ywk9wx-profile/sbin/runc" 
DEBU[0000] Configured OCI runtime kata initialization failed: no valid 
executable found for OCI runtime kata: invalid argument 
DEBU[0000] Configured OCI runtime youki initialization failed: no valid 
executable found for OCI runtime youki: invalid argument 
DEBU[0000] Configured OCI runtime ocijail initialization failed: no valid 
executable found for OCI runtime ocijail: invalid argument 
DEBU[0000] Configured OCI runtime runj initialization failed: no valid 
executable found for OCI runtime runj: invalid argument 
DEBU[0000] Configured OCI runtime runsc initialization failed: no valid 
executable found for OCI runtime runsc: invalid argument 
DEBU[0000] Configured OCI runtime krun initialization failed: no valid 
executable found for OCI runtime krun: invalid argument 
DEBU[0000] Using OCI runtime 
"/gnu/store/gadwcvv4ynlk267wisxcdl91kjzqmc49-crun-1.4.5/bin/crun" 
INFO[0000] Setting parallel job count to 73             
+ '[' -n '' ']'
+ printf 'distrobox: Installing basic packages...\n'
…
```

So I'll keep digging when I have time.

-- 
s/Fred[re]+i[ck]+/Fredrik/g



reply via email to

[Prev in Thread] Current Thread [Next in Thread]