diff --git a/supervisor/core.py b/supervisor/core.py index 93f546530..fa5a5ba56 100644 --- a/supervisor/core.py +++ b/supervisor/core.py @@ -48,6 +48,12 @@ class Core(CoreSysAttributes): "Docker version %s is not supported by Supervisor!", self.sys_docker.info.version, ) + elif self.sys_docker.info.inside_lxc: + self.healthy = False + _LOGGER.critical( + "Detected Docker running inside LXC. Running Home Assistant with the Supervisor on LXC is not supported!" + ) + self.sys_docker.info.check_requirements() # Check if system is healthy diff --git a/supervisor/docker/__init__.py b/supervisor/docker/__init__.py index a488ba2be..7f9361ae0 100644 --- a/supervisor/docker/__init__.py +++ b/supervisor/docker/__init__.py @@ -2,6 +2,7 @@ from contextlib import suppress from ipaddress import IPv4Address import logging +from pathlib import Path from typing import Any, Dict, Optional import attr @@ -46,6 +47,11 @@ class DockerInfo: return version_local >= version_min + @property + def inside_lxc(self) -> bool: + """Return True if the docker run inside lxc.""" + return Path("/dev/lxd/sock").exists() + def check_requirements(self) -> None: """Show wrong configurations.""" if self.storage != "overlay2":