Trying to install in LXC container - looks to be all there but no web GUI

Afternoon all.

Trying to install hass.io onto a Ubuntu container using LXC.
Followed the instructiosn found here: https://www.home-assistant.io/hassio/installation/ using the alternative method.

Looking at LXC is seems to have installed, docker container is listed but I cannot get to any web GUI.

Looking at the output of LXC shows three containers within it:

  • 192.168.0.57 (eth0)
  • 172.30.32.1 (hassio)
  • 172.17.0.1 (docker0)

No errors during install either.

A quick netstat shows no port 8123 in use either, although there does appear to be some hassio in the process list:

ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1 225112  8932 ?        Ss   13:43   0:01 /sbin/init
root        39  0.0  0.1  78436 10912 ?        Ss   13:43   0:00 /lib/systemd/systemd-journald
root        43  0.0  0.0  33344  2956 ?        Ss   13:43   0:00 /lib/systemd/systemd-udevd
systemd+    56  0.0  0.0  80024  4968 ?        Ss   13:43   0:00 /lib/systemd/systemd-networkd
root        76  0.0  0.0  31288  3012 ?        Ss   13:43   0:00 /usr/sbin/cron -f  
root        77  0.0  0.2 170356 17048 ?        Ssl  13:43   0:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
root        78  0.0  0.0  62116  5748 ?        Ss   13:43   0:00 /lib/systemd/systemd-logind
syslog      79  0.0  0.0 193396  4244 ?        Ssl  13:43   0:00 /usr/sbin/rsyslogd -n
message+    80  0.0  0.0  50476  5052 ?        Ss   13:43   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
systemd+    83  0.0  0.0  70744  5172 ?        Ss   13:43   0:00 /lib/systemd/systemd-resolved
root        87  0.0  0.0  15952  2360 console  Ss+  13:43   0:00 /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38400,9600 linux
root      1560  0.0  0.2 187052 19976 ?        Ssl  13:45   0:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root      1753  0.0  0.0  44748  2948 ?        Ss   13:45   0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
root      1813  0.0  0.1 427128  8680 ?        Ssl  13:45   0:00 /usr/sbin/ModemManager
root      1818  0.0  0.0 288872  6656 ?        Ssl  13:45   0:00 /usr/lib/policykit-1/polkitd --no-debug
avahi     1942  0.0  0.0  47200  3764 ?        Ss   13:45   0:00 avahi-daemon: running [hassio.local]   
avahi     1943  0.0  0.0  47072   340 ?        S    13:45   0:00 avahi-daemon: chroot helper
root      3132  0.0  0.5 1477356 41196 ?       Ssl  13:46   0:01 /usr/bin/containerd
root      3284  0.0  0.2 480664 16272 ?        Ssl  13:46   0:00 /usr/sbin/NetworkManager --no-daemon
root      3300  0.0  1.4 2234280 112836 ?      Ssl  13:46   1:23 /usr/bin/dockerd -H fd://
root      3769  0.0  0.0   4624  1564 ?        Ss   13:46   0:00 /bin/sh /usr/sbin/hassio-supervisor
root      3823  0.0  0.5 1267016 47656 ?       Sl   13:46   0:00 docker run --name hassio_supervisor --security-opt apparmor:unconfined --security-opt seccomp=unconfined -v /var/run/docker.sock:/var/run/docker.sock -v /var/run/dbus:/
root      3838  0.0  0.0   9384  4668 ?        Sl   13:46   0:00 containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/400ac829176b753701d2870e8c17f9ca9576a2ab0ea4f823c11e20b121a37723 -addre
root      3855  0.0  0.5 272516 45648 ?        Ssl  13:46   0:02 python3 -m hassio
root      4145  0.0  0.0  11892  1556 ?        S    13:47   0:00 socat UDP-RECVFROM:53,fork UDP-SENDTO:127.0.0.11:53
root      5194  0.0  0.0  23188  3924 ?        Ss   13:54   0:00 /bin/bash
root      5815  0.0  0.0  39080  3368 ?        R+   14:00   0:00 ps aux

Any help appreciated!

A. What does docker ps -a show you?

B. Is the systemd service running?

C. What does journalctl -xe show you?

D. What does the log file for home assistant say?

A:
cbee9b21d558 homeassistant/qemux86-64-homeassistant “/bin/entry.sh pytho…” 14 seconds ago Created homeassistant
400ac829176b homeassistant/amd64-hassio-supervisor “python3 -m hassio” 28 minutes ago Up 28 minutes hassio_supervisor

B: Systemd appears to be running (shows up in ps -aux)

C:
Feb 15 14:19:55 hassio hassio-supervisor[3769]: 19-02-15 14:19:55 WARNING (MainThread) [hassio.tasks] Watchdog found a problem with Home Assistant Docker!
Feb 15 14:19:55 hassio hassio-supervisor[3769]: 19-02-15 14:19:55 INFO (SyncWorker_3) [hassio.docker.interface] Clean homeassistant/qemux86-64-homeassistant Docker application
Feb 15 14:19:56 hassio containerd[3132]: time=“2019-02-15T14:19:56.853026053Z” level=info msg=“shim containerd-shim started” address="/containerd-shim/moby/9e0642d27460cb0a2c20a88a1207d8c254b62dcc414d059f90502f4737bb4908/shim.sock" d
Feb 15 14:19:56 hassio containerd[3132]: time=“2019-02-15T14:19:56.952954966Z” level=info msg=“shim reaped” id=9e0642d27460cb0a2c20a88a1207d8c254b62dcc414d059f90502f4737bb4908
Feb 15 14:19:56 hassio dockerd[3300]: time=“2019-02-15T14:19:56.963586479Z” level=error msg=“stream copy error: reading from a closed fifo”
Feb 15 14:19:56 hassio dockerd[3300]: time=“2019-02-15T14:19:56.963582551Z” level=error msg=“stream copy error: reading from a closed fifo”
Feb 15 14:19:57 hassio dockerd[3300]: time=“2019-02-15T14:19:57.067066557Z” level=error msg=“9e0642d27460cb0a2c20a88a1207d8c254b62dcc414d059f90502f4737bb4908 cleanup: failed to delete container from containerd: no such container”
Feb 15 14:19:57 hassio dockerd[3300]: time=“2019-02-15T14:19:57.067147990Z” level=error msg="Handler for POST /v1.39/containers/9e0642d27460cb0a2c20a88a1207d8c254b62dcc414d059f90502f4737bb4908/start returned error: OCI runtime create
Feb 15 14:19:57 hassio hassio-supervisor[3769]: 19-02-15 14:19:57 ERROR (SyncWorker_3) [hassio.docker] Can’t start homeassistant: 500 Server Error: Internal Server Error ("OCI runtime create failed: container_linux.go:344: starting c
Feb 15 14:19:57 hassio hassio-supervisor[3769]: 19-02-15 14:19:57 ERROR (MainThread) [hassio.tasks] Watchdog Home Assistant reanimation fails!

D: There are no HA log files (looking in /var/log)

I am guessing Part C shows that things are not right!

Not what I asked. I asked about the hassio systemd service.

Seems it’s trying to use a version that is incompatible with your CPU architecture?

There won’t be any HA log files in /var/log, because the log file is in the same directory as the config file. Reading the script you installed it should be in /usr/share/hassio?

Apologies - been a long day so far!

> systemctl status hassio*
> ● hassio-apparmor.service - Hass.io AppArmor
>    Loaded: loaded (/etc/systemd/system/hassio-apparmor.service; enabled; vendor preset: enabled)
>    Active: active (exited) since Fri 2019-02-15 13:47:00 UTC; 41min ago
>   Process: 3994 ExecStart=/usr/sbin/hassio-apparmor (code=exited, status=0/SUCCESS)
>  Main PID: 3994 (code=exited, status=0/SUCCESS)
> 
> Feb 15 13:47:00 hassio systemd[1]: Starting Hass.io AppArmor...
> Feb 15 13:47:00 hassio hassio-apparmor[3994]: Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.)
> Feb 15 13:47:00 hassio hassio-apparmor[3994]: Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
> Feb 15 13:47:00 hassio hassio-apparmor[3994]: Use --subdomainfs to override.
> Feb 15 13:47:00 hassio hassio-apparmor[3994]: [Error]: Can't load profile /usr/share/hassio/apparmor/hassio-supervisor
> Feb 15 13:47:00 hassio systemd[1]: Started Hass.io AppArmor.
> 
> ● hassio-supervisor.service - Hass.io supervisor
>    Loaded: loaded (/etc/systemd/system/hassio-supervisor.service; enabled; vendor preset: enabled)
>    Active: active (running) since Fri 2019-02-15 13:46:58 UTC; 41min ago
>   Process: 3756 ExecStartPre=/usr/bin/docker stop hassio_supervisor (code=exited, status=1/FAILURE)
>  Main PID: 3769 (hassio-supervis)
>     Tasks: 19 (limit: 4915)
>    CGroup: /system.slice/hassio-supervisor.service
>            ├─3769 /bin/sh /usr/sbin/hassio-supervisor
>            └─3823 docker run --name hassio_supervisor --security-opt apparmor:unconfined --security-opt seccomp=unconfined -v /var/run/docker.sock:/var/run/docker.sock -v /var/run/dbus:/var/run/dbus -v /usr/share/hassio:/data -e SUPE
> 
> Feb 15 14:27:40 hassio hassio-supervisor[3769]: 19-02-15 14:27:40 WARNING (MainThread) [hassio.tasks] Watchdog found a problem with Home Assistant Docker!
> Feb 15 14:27:40 hassio hassio-supervisor[3769]: 19-02-15 14:27:40 INFO (SyncWorker_21) [hassio.docker.interface] Clean homeassistant/qemux86-64-homeassistant Docker application
> Feb 15 14:27:42 hassio hassio-supervisor[3769]: 19-02-15 14:27:42 ERROR (SyncWorker_21) [hassio.docker] Can't start homeassistant: 500 Server Error: Internal Server Error ("OCI runtime create failed: container_linux.go:344: starting
> Feb 15 14:27:42 hassio hassio-supervisor[3769]: 19-02-15 14:27:42 ERROR (MainThread) [hassio.tasks] Watchdog Home Assistant reanimation fails!
> Feb 15 14:27:55 hassio hassio-supervisor[3769]: 19-02-15 14:27:55 WARNING (MainThread) [hassio.tasks] Watchdog found a problem with Home Assistant Docker!
> Feb 15 14:27:55 hassio hassio-supervisor[3769]: 19-02-15 14:27:55 INFO (SyncWorker_14) [hassio.docker.interface] Clean homeassistant/qemux86-64-homeassistant Docker application
> Feb 15 14:27:57 hassio hassio-supervisor[3769]: 19-02-15 14:27:57 ERROR (SyncWorker_14) [hassio.docker] Can't start homeassistant: 500 Server Error: Internal Server Error ("OCI runtime create failed: container_linux.go:344: starting
> Feb 15 14:27:57 hassio hassio-supervisor[3769]: 19-02-15 14:27:57 ERROR (MainThread) [hassio.tasks] Watchdog Home Assistant reanimation fails!
> Feb 15 14:28:10 hassio hassio-supervisor[3769]: 19-02-15 14:28:10 WARNING (MainThread) [hassio.tasks] Watchdog found a problem with Home Assistant Docker!
> Feb 15 14:28:10 hassio hassio-supervisor[3769]: 19-02-15 14:28:10 INFO (SyncWorker_2) [hassio.docker.interface] Clean homeassistant/qemux86-64-homeassistant Docker application

There do not appear to be any logs either in /usr/share/hassio:

root@hassio:/usr/share/hassio# ls
addons  apparmor  backup  config.json  homeassistant  homeassistant.json  share  ssl  tmp  updater.json

Ran tree and there were no log dirs or *.log files anywhere.

As for the wrong version, I didn’t actually select any version, just ran the installer as per the Hass.io page…

Perhaps I should just go back to the raspberry pi version - trying to get it installed on a more powerful box under LXC.

/usr/share/hassio/homeassistant

Right, but that error generally means it’s trying to run a version that is not compatible with that CPU arch. It could be an LXC problem, but you also have apparmor issues, which are also probably an LXC problem.

Why not install docker-ce on the host, and run it from there? Or run a KVM VM?

  1. Ref the logs: thats where I looked and its an empty folder.
  2. Perhaps it is LXC putting its foot in there somewhere, I will go and have a read. I have a few things on the LXC host running so just wanted to get hass on there as well.

Many, many thanks for your speedy help as well, greatly appreciated!

This is the script you installed.

Have a read through it and verify each step completed.

https://github.com/home-assistant/hassio-build/blob/master/install/hassio_install

It appears to do it all correctly, picking up the x86_64 version.
Managed to read the truncated output of systemctl status hassio-supervisor.service and found a couple of errors relating to docker itself:

ERROR (SyncWorker_4) [hassio.docker] Can't start homeassistant: 500 Server Error: Internal Server Error ("OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:70: creating device nodes caused \\\"open /var/lib/docker/btrfs/subvolumes/b2c519f7177bf62ef1e02fba8f6de9fcc99769e720d92ba2f930ee53a897c178/dev/tty: no such device or address\\\"\"": unknown")

Which, to be honest means nothing to me as this is the first time I have played with docker (apart from installing Hass on RPi).

Something to do over the weekend though!

As an update - I don’t think this has anything to do with Hass, its looks to be LXC and a priv / unpriv container problem.

I got the hint from the /dev/tty no such device error and did a bit of digging.

I only said “I think” :slight_smile:

Hey,

i was also interested in installing hass.io to an lxc, with no luck. There is this docker thing I am struggeling with. I have also my host running several lxc containers and I have home-assistant successfully running in one. Its started with root inside the container, but if you are interested, I can post you my installation steps.

I will take a look through the installation script for hass.io soon. Maybe there is an option to port it to lxc, without docker.

That would be brilliant if you did - I gave up on Hass.io in the end. Would like to say I could help however, my knowledge doesn’t run that deep. I could try to beta test for you if needs be though.

The plain vanilla Home Assistant installed without a problem so have been playing with that - however, I did like the addons that Hass.IO provided.

Hey @happyhippy,
What hardware are you running the LXC container on? I’m possibly looking to buy a Qnap nas which supports LXC. Hoping it may be a viable and efficient way to run Hass.io

Did you get any further?

Cheers,

Linton