newsnowlabs / runcvm

RunCVM (Run Container VM) is an experimental open-source Docker container runtime, for launching standard container workloads - as well as Systemd, Docker, even OpenWrt - in VMs using 'docker run`
Apache License 2.0
72 stars 4 forks source link

Attempting Demo in openwrt wiki #18

Closed bytepoet closed 2 months ago

bytepoet commented 3 months ago

The below is on a fresh VM in the cloud. I would expect it to pull the docker container and drop me into a shell with the openwrt runtime but i get the following:

root@Echo:~# curl -s -o - https://raw.githubusercontent.com/newsnowlabs/runcvm/main/runcvm-scripts/runcvm-install-runtime.sh | sudo sh

RunCVM Runtime Installer
========================

- Checking dockerd ...
  - Detected running dockerd
- Installing RunCVM package to /runcvm ...
Unable to find image 'newsnowlabs/runcvm:latest' locally
latest: Pulling from newsnowlabs/runcvm
619be1103602: Pull complete
a07e2fefe21c: Pull complete
96916ed279cd: Pull complete
22a95dc40711: Pull complete
b540c293122b: Pull complete
96a720e0bd46: Pull complete
b579ff7665d1: Pull complete
2d514f5a4405: Pull complete
4f1a1816ece1: Pull complete
90d774275160: Pull complete
405d887a1ed2: Pull complete
4da19ba264f3: Pull complete
b13e9f561dc5: Pull complete
Digest: sha256:3bc1625a5f3e8f801b60050eaed48f82a78544c6dfe785e51f1372e09a498fa2
Status: Downloaded newer image for newsnowlabs/runcvm:latest
- Installed RunCVM package to /opt/runcvm
- Detected /etc/docker
  - Creating empty daemon.json
  - Adding runcvm to daemon.json runtimes property ...
    - Done
  - Preparing to restart dockerd ...
    - Detected systemd
    - Preparing to run: systemctl restart docker
    - Restarting dockerd with: systemctl restart docker
    - Waiting for dockerd to restart ...
    - Restarted dockerd successfully
  - Verification of RunCVM runtime in Docker completed
- Checking rp_filter ...
  - sys.net.ipv4.conf.all.rp_filter is set to 2; assuming no further action needed
- RunCVM installation/upgrade complete.

root@Echo:~# docker run --runtime=runcvm --name ubuntu1 --rm -it ubuntu
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
bccd10f490ab: Pull complete
Digest: sha256:77906da86b60585ce12215807090eb327e7386c8fafb5402369e421f44eff17e
Status: Downloaded newer image for ubuntu:latest
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/containerd/io.containerd.runtime.v2.task/moby/8eee79d4c8be4ab7683d9626d29f0a3f0523b189a60b112d8f231bfa4f7a   abeb4/log.json: no such file or directory): /opt/runcvm/scripts/runcvm-runtime did not terminate successfully: exit status 127: /opt/runcvm/sc   cripts/runcvm-runtime: line 555: /usr/bin/runc: No such file or directory
: unknown.
ERRO[0003] error waiting for container:

Attempted on 2x hosts.
Linux Echo 5.15.0-101-generic #111-Ubuntu SMP Tue Mar 5 20:16:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Linux woof 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1
Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1

root@Echo:~# runc -v
runc version 1.1.7-0ubuntu1~22.04.2
spec: 1.0.2-dev
go: go1.18.1
libseccomp: 2.5.3

root@woof:~# runc -v
runc version 1.1.7-0ubuntu1~22.04.2
spec: 1.0.2-dev
go: go1.18.1
libseccomp: 2.5.3

Any help is appreciated.

struanb commented 3 months ago

Thanks for raising this issue. My first suspicion is that Docker isn't installed in the standard location, because of this log excerpt:

/usr/bin/runc: No such file or directory

It's likely that RunCVM currently requires Docker to be installed in a standard location/installed from Docker's packages. We might be able to address this, once we understand the issue.

Please elaborate on your system environment, ie Linux distribution name and version, and how you have Docker installed (e.g. using Docker's packages, the distribution's packages, Snap, or other).

Also please provide the output of which runc.

jimaek commented 3 months ago

Same issue, I installed docker using apt install docker.io The solution is to do this ln -s /usr/sbin/runc /usr/bin/runc

Would be great if the installation script could auto detect this :)

struanb commented 3 months ago

@jimaek That's excellent news. In your case it looks like you're using the Ubuntu or Debian distribution packages rather than the Docker packages RunCVM has been developed against.

I'll raise an issue to find a way to address this (preferably without having to tamper with the filesystem by creating a symlink but by finding the installed runc path and using that).

In the meantime it's great to have a workaround.

@bytepoet Are you using the docker.io package too?

struanb commented 3 months ago

@jimaek Your issue is now here: https://github.com/newsnowlabs/runcvm/issues/20

I'll keep the current issue open for now in case it turns out the specifics of @bytepoet's case are different.

jimaek commented 3 months ago

Thank you!

bytepoet commented 2 months ago

@jimaek this was exactly the issue! thanks for this.

@struanb I appreciate the attention you've given, thanks for making this project.