Giter Club home page Giter Club logo

Comments (5)

stelb avatar stelb commented on July 19, 2024 1

Probably this: microsoft/WSL#4189

from footloose.

stelb avatar stelb commented on July 19, 2024

Your download failed, as the link returns 404..
And your footloose is a textfile interpreted as shellscript and not a binary.
See e.g. docker/compose#6268

from footloose.

jwillmer avatar jwillmer commented on July 19, 2024

Oh, O.K., I did not notice that. Maybe someone should update the readme with a working link. Thank you!

from footloose.

jwillmer avatar jwillmer commented on July 19, 2024

I managed to download the correct footlose binary but running the image does not work:

$ footloose config create --replicas 3
$ footloose create
INFO[0000] Creating SSH key: cluster-key ...
INFO[0000] Pulling image: quay.io/footloose/centos7:0.6.3 ...
INFO[0020] Creating machine: cluster-node0 ...
INFO[0024] Creating machine: cluster-node1 ...
INFO[0026] Creating machine: cluster-node2 ...

$ docker ps
CONTAINER ID   IMAGE                             COMMAND        CREATED         STATUS         PORTS                   NAMES
8bca3e514a00   quay.io/footloose/centos7:0.6.3   "/sbin/init"   3 seconds ago   Up 2 seconds   0.0.0.0:52943->22/tcp   cluster-node2
7344014663fa   quay.io/footloose/centos7:0.6.3   "/sbin/init"   5 seconds ago   Up 4 seconds   0.0.0.0:52942->22/tcp   cluster-node1
a022131323f7   quay.io/footloose/centos7:0.6.3   "/sbin/init"   7 seconds ago   Up 5 seconds   0.0.0.0:52941->22/tcp   cluster-node0

$ docker logs 8bca3e514a00
Failed to mount cgroup at /sys/fs/cgroup/systemd: Operation not permitted
[!!!!!!] Failed to mount API filesystems, freezing.

from footloose.

marzelin avatar marzelin commented on July 19, 2024

You need SystemD but WSL2 doesn't have SystemD running as an init process like typical distributions (and it's hard to start it because it requires PID 1) but there's a workaround:

# Install the required packages for SystemD
apt install -yqq fontconfig daemonize

# Create the starting script for SystemD
vi /etc/profile.d/00-wsl2-systemd.sh
SYSTEMD_PID=$(ps -ef | grep '/lib/systemd/systemd --system-unit=basic.target$' | grep -v unshare | awk '{print $2}')

if [ -z "$SYSTEMD_PID" ]; then
   sudo /usr/bin/daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
   SYSTEMD_PID=$(ps -ef | grep '/lib/systemd/systemd --system-unit=basic.target$' | grep -v unshare | awk '{print $2}')
fi

if [ -n "$SYSTEMD_PID" ] && [ "$SYSTEMD_PID" != "1" ]; then
    exec sudo /usr/bin/nsenter -t $SYSTEMD_PID -a su - $LOGNAME
fi

Terminate wsl from powershell:

wsl --shutdown

After this /sys/fs/cgroup/systemd should be able to be mounted and you should get your vms running.

from footloose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.