all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Anyone got distrobox working?
@ 2023-10-24 22:30 Fredrik Salomonsson
  2023-10-25 11:34 ` wolf
       [not found] ` <86wmtcrxkz.fsf@riseup.net>
  0 siblings, 2 replies; 4+ messages in thread
From: Fredrik Salomonsson @ 2023-10-24 22:30 UTC (permalink / raw)
  To: help-guix

Hi,

I noticed that guix has [distrobox][0] packaged but it does not seem to
work.

```sh
$ guix shell distrobox -- distrobox create -i ubuntu:22.04
Image ubuntu:22.04 not found.
Do you want to pull the image now? [Y/n]: 
Error: short-name "ubuntu:22.04" did not resolve to an alias and no containers-registries.conf(5) was found
```

```sh
guix shell distrobox -- distrobox create -i docker.io/library/ubuntu:22.04
Image docker.io/library/ubuntu:22.04 not found.
Do you want to pull the image now? [Y/n]: 
Error: open /etc/containers/policy.json: no such file or directory
```

From what I understand I need to properly setup podman with
/etc/containers populated with the right configs.  I've looked around
but I cannot find any docs or services that allows me to do that.
Checked the mailing and IRC archives but could not find any useful
information.  Apart from maybe podman does not work on guix.

Has anyone got distrobox working and if so how?

Thanks

[0] https://distrobox.it/
-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Anyone got distrobox working?
  2023-10-24 22:30 Anyone got distrobox working? Fredrik Salomonsson
@ 2023-10-25 11:34 ` wolf
  2023-10-25 17:39   ` Fredrik Salomonsson
       [not found] ` <86wmtcrxkz.fsf@riseup.net>
  1 sibling, 1 reply; 4+ messages in thread
From: wolf @ 2023-10-25 11:34 UTC (permalink / raw)
  To: Fredrik Salomonsson; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2359 bytes --]

On 2023-10-24 22:30:34 +0000, Fredrik Salomonsson wrote:
> Hi,
> 
> I noticed that guix has [distrobox][0] packaged but it does not seem to
> work.
> 
> ```sh
> $ guix shell distrobox -- distrobox create -i ubuntu:22.04
> Image ubuntu:22.04 not found.
> Do you want to pull the image now? [Y/n]: 
> Error: short-name "ubuntu:22.04" did not resolve to an alias and no containers-registries.conf(5) was found
> ```
> 
> ```sh
> guix shell distrobox -- distrobox create -i docker.io/library/ubuntu:22.04
> Image docker.io/library/ubuntu:22.04 not found.
> Do you want to pull the image now? [Y/n]: 
> Error: open /etc/containers/policy.json: no such file or directory
> ```
> 
> From what I understand I need to properly setup podman with
> /etc/containers populated with the right configs.  I've looked around
> but I cannot find any docs or services that allows me to do that.
> Checked the mailing and IRC archives but could not find any useful
> information.  Apart from maybe podman does not work on guix.

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 .

> 
> Has anyone got distrobox working and if so how?

No idea about distrobox, but the above should get the podman working.

> 
> Thanks
> 
> [0] https://distrobox.it/
> -- 
> s/Fred[re]+i[ck]+/Fredrik/g
> 

T.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Anyone got distrobox working?
  2023-10-25 11:34 ` wolf
@ 2023-10-25 17:39   ` Fredrik Salomonsson
  0 siblings, 0 replies; 4+ messages in thread
From: Fredrik Salomonsson @ 2023-10-25 17:39 UTC (permalink / raw)
  To: wolf; +Cc: help-guix

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Anyone got distrobox working?
       [not found] ` <86wmtcrxkz.fsf@riseup.net>
@ 2024-01-06  3:59   ` Csepp
  0 siblings, 0 replies; 4+ messages in thread
From: Csepp @ 2024-01-06  3:59 UTC (permalink / raw)
  To: your friendly localhost admin; +Cc: Fredrik Salomonsson, help-guix

your friendly localhost admin <pronaip@riseup.net> writes:

> Fredrik Salomonsson <plattfot@posteo.net> writes:
>
>> Hi,
>>
>> I noticed that guix has [distrobox][0] packaged but it does not seem to
>> work.
>> …
>
> I have a partial fix pending that I have used successfully to create an Arch container and run some nontrivial pacman commands in it.
> <https://yhetil.org/guix/eb8bd481e47aecea043907488a573692c6371b55.1702863974.git.raingloom@riseup.net/>
>
> Podman should also be updated, because rootless containers seem to get stuck in a stopping state, and newer releases might have a fix for that.

I slightly messed up, distrobox-init should not be wrapped, nor should its shebang line be replaced, otherwise it won’t execute inside the container, because there is no /gnu/store in there.  But that is easy enough to fix, just bind mount Guix’s folders too:

distrobox create –additional-flags ’–mount type=bind,src=/gnu,target=/gnu –mount type= bind,src=/var/guix,target=/var/guix’ –image quay.io/toolbx-images/ubuntu-toolbox:22.04 –name ubuntu-22-toolbox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-06  4:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 22:30 Anyone got distrobox working? Fredrik Salomonsson
2023-10-25 11:34 ` wolf
2023-10-25 17:39   ` Fredrik Salomonsson
     [not found] ` <86wmtcrxkz.fsf@riseup.net>
2024-01-06  3:59   ` Csepp

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.