Failed to run BalenaOS in Docker Container: Failed to start Resin acti… root partition mount service.

Hi,

I’m used GitHub - balena-os/balenaos-in-container: Run balenaOS as a docker container in the past.
Last time I know it worked without issues was April 2022. I might have used it in the meantime, but not 100% certain.
Something changed in the meantime, but I’m unsure what.
I created a similar post on the project’s Github repo: [FAILED] Failed to start Resin acti… root partition mount service. · Issue #59 · balena-os/balenaos-in-container · GitHub. I hope it’s ok to also post it here, if not please let me know.

I’m trying to use this fleet config (config.json):

{
  "applicationId": 1390541,
  "deviceType": "intel-nuc",
  "userId": 125346,
  "appUpdatePollInterval": 60000,
  "listenPort": 48484,
  "vpnPort": 443,
  "apiEndpoint": "https://api.balena-cloud.com",
  "vpnEndpoint": "cloudlink.balena-cloud.com",
  "registryEndpoint": "registry2.balena-cloud.com",
  "deltaEndpoint": "https://delta.balena-cloud.com",
  "mixpanelToken": "some token, censored, unsure if sensitive",
  "apiKey": "some api key, censored, unsure if sensitive"
}

I’m using docker desktop with wsl2:

wsl --version
WSL version: 1.2.5.0
Kernel version: 5.15.90.1
WSLg version: 1.0.51
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.1555
docker -v
Docker version 20.10.21, build baeda1f

When investigating cgroups in the docker-desktop container:

mount | grep group
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)

So I think the kernel supports both cgroups v1 and v2?

docker-compose logs: balenaos-in-container-master>docker-compose up --build[+] Building 5.6s (11/11 - Pastebin.com

docker exec -it balenaos-in-container-master-os-1 journalctl -u mnt-sysroot-active.service

> docker exec -it balenaos-in-container-master-os-1 journalctl -u mnt-sysroot-active.service
-- Logs begin at Mon 2023-05-15 08:08:42 UTC, end at Mon 2023-05-15 08:10:12 UT>
May 15 08:09:13 731cd9f59e60 resin-partition-mounter[19]: ERROR: Timeout while >
May 15 08:09:13 731cd9f59e60 systemd[1]: mnt-sysroot-active.service: Main proce>
May 15 08:09:13 731cd9f59e60 systemd[1]: mnt-sysroot-active.service: Failed wit>
May 15 08:09:13 731cd9f59e60 systemd[1]: Failed to start Resin active root part>
lines 1-5/5 (END)...skipping...
-- Logs begin at Mon 2023-05-15 08:08:42 UTC, end at Mon 2023-05-15 08:10:12 UTC. --
May 15 08:09:13 731cd9f59e60 resin-partition-mounter[19]: ERROR: Timeout while waiting for /dev/disk/by-state/active to come up.
May 15 08:09:13 731cd9f59e60 systemd[1]: mnt-sysroot-active.service: Main process exited, code=exited, status=1/FAILURE
May 15 08:09:13 731cd9f59e60 systemd[1]: mnt-sysroot-active.service: Failed with result 'exit-code'.
May 15 08:09:13 731cd9f59e60 systemd[1]: Failed to start Resin active root partition mount service.
~
~
~

I found a similar error which was seemingly not solved.

If I can provide more information, please let me know.

Oops, the similar error I posted was wrong, I meant this one: Failed to run BalenaOS in Docker Container

Balena support suggested to use GitHub - balena-labs-research/balena-virt: Easy virtualization of balenaOS
Which works perfectly!

1 Like