Turis MOX - LXC debian

I’m trying to create a LXC container Debian stretch, repo.turris.cz, architecture arm64 but I can not configure my network. Can you help me?

Log from LXC container:

root@mox:~# cat /srv/lxc/debian/debian.log
      lxc-start debian 20190127200250.341 ERROR    lxc_network - network.c:instantiate_veth:130 - Failed to create veth pair "veth5VRAC3" and "vethAKPFDY": Not supported
      lxc-start debian 20190127200250.342 ERROR    lxc_network - network.c:lxc_create_network_priv:2402 - Failed to create network device
      lxc-start debian 20190127200250.342 ERROR    lxc_start - start.c:lxc_spawn:1206 - Failed to create the network.
      lxc-start debian 20190127200250.342 ERROR    lxc_start - start.c:__lxc_start:1459 - Failed to spawn container "debian".
      lxc-start debian 20190127200250.343 ERROR    lxc_container - lxccontainer.c:wait_on_daemonized_start:760 - Received container state "STOPPING" instead of "RUNNING"
      lxc-start debian 20190127200250.344 ERROR    lxc_start_ui - tools/lxc_start.c:main:371 - The container failed to start.
      lxc-start debian 20190127200250.344 ERROR    lxc_start_ui - tools/lxc_start.c:main:373 - To get more details, run the container in foreground mode.
      lxc-start debian 20190127200250.345 ERROR    lxc_start_ui - tools/lxc_start.c:main:375 - Additional information can be obtained by setting the --logfile and --logpriority options.

LXC container config:

root@mox:~# cat /srv/lxc/debian/config
    # Template used to create this container: /usr/share/lxc/templates/lxc-download
    # Parameters passed to the template:
    # For additional config options, please look at lxc.container.conf(5)

    # Uncomment the following line to support nesting containers:
    #lxc.include = /usr/share/lxc/config/nesting.conf
    # (Be aware this has security implications)


    # Distribution configuration
    lxc.include = /usr/share/lxc/config/debian.common.conf
    lxc.arch = linux64

    # Container specific configuration
    lxc.rootfs.path = dir:/srv/lxc/debian/rootfs
    lxc.uts.name = debian

    # Network configuration
    lxc.net.0.type = veth
    lxc.net.0.name = eth0
    lxc.net.0.link = br-lan
    lxc.net.0.flags = up

Turis MOX network config:

br-lan    Link encap:Ethernet  HWaddr D8:58:D7:00:B6:B8
          inet addr:192.168.100.1  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::da58:d7ff:fe00:b6b8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:122438 errors:0 dropped:0 overruns:0 frame:0
          TX packets:157570 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:64120040 (61.1 MiB)  TX bytes:164806216 (157.1 MiB)

Turris:
image

Check whether kmod-veth is installed and if installed whether it has been loaded.

Amazing, thank you for directing me to the right path.

opkg install kmod-veth
reboot

It solve my problem.

Just out of curiosity do you know why I do not see the possibility of creating LXC containers from REPO in LUCI interface but it work in SSH?

Depends, if you did not use the Foris LCX plugin than you should make sure that all necessary LXC packages are installed. My preference is via user.lua for pkgupdate

Install("luci-app-lxc", "luci-app-lxc", "lxc-attach", "lxc-auto", "lxc-autostart", "lxc-cgroup", "lxc-checkconfig", "lxc-clone", "lxc-config", "lxc-console", "lxc-destroy", "lxc-device", "lxc-execute", "lxc-freeze", "lxc-info", "lxc-init", "lxc-ls", "lxc-lua", "lxc-monitor", "lxc-monitord", "lxc-snapshot", "lxc-start", "lxc-stop", "lxc-unfreeze", "lxc-unshare", "lxc-user-nic", "lxc-usernsexec", "lxc-wait")

I would love to install it in the Foris interface, but unfortunately it does not work in Turris OS 4. I already reported it as a bug. And unfortunately, I’ve never been able to find a list of software to install for each of the available plugins in Foris. To be able to imitate it manually in SSH.

https://repo.turris.cz/☞🐉/lists/
https://repo.turris.cz/☞🐉/packages/mox/

I expressed myself in a wrong way. I do not know the list of packages that are installed, for example, when I install the NAS plugin in Foris.

The are all listed in the respective package, e.g. NAS

https://repo.turris.cz/☞🐉/lists/nas.lua

I’m sorry, the first link is what I was looking for. :slight_smile: Thank you.

I would love to install it in the Foris interface, …, I already reported it as a bug.

We are aware of this issue and in the next release of Turris OS 4.0, it will be fixed.

For now, you can add following rows to /etc/config/updater:

config pkglists 'pkglists'
	list lists 'lxc'

Just out of curiosity do you know why I do not see the possibility of creating LXC containers from REPO in LUCI interface but it work in SSH?

I will check it and let you know.

Thank you, it sounded like a better solution than add contentent from files like “lists/luci-controls.lua” into the file “/etc/updater/user.lua”.

The LXC example worked well, but the next time I came across the problem. Probably the name to be entered in the configuration /etc/config/updater does not match the file name of the list files from repo.

What name should I add when I want to install this plugin?
image

That’s why I continued adding to the file “/etc/updater/user.lua”.

When I added the content “https://repo.turris.cz/hbk/lists/luci-controls.lua” I came across this error.

I already find it … it is “netutils”.

Here is the config:
root@mox:~# cat /etc/config/updater

config override 'override'
        option disable '0'

config turris 'turris'
        option version 'hbk'
        list lists ''

config l10n 'l10n'
        list langs 'cs'

config approvals 'approvals'
        option need '1'

config pkglists 'pkglists'
        list lists 'luci-controls'
        list lists 'lxc'
        list lists 'netutils'

Updater still reports an error.

For NAS plugin missing mountd. It looks like there were not all the required packages on the repo server.

All these reported issues are already fixed in next version of Turris OS 4.0.

For example mountd is no longer available as it was replaced by blockd.

When will the new version of Turris 4.0 be available for upgrde?

I’m sorry, but from now what I’ve had the chance to test, it feels to me, like this version is not ready for testing by the public. Thus Turris MOX at this stage is unusable for deployment.

Is it possible to install a stable, lower version of Turris OS to Turris MOX?

I have been able to check what’s wrong and fixed it and send it to OpenWrt, which was merged.
But for now, just only one issue is fixed as unfortunately, they are two.

luci-app-lxc wasn’t aware of aarch64 architecture and LXC containers are provided by two servers.

You’d need to add to file /usr/lib/lua/luci/controller/lxc.lua this row, which you can find in my commit and then you will be able to see LXC images from images.linuxcontainers.org.

Thank you for reporting!

When will the new version of Turris 4.0 be available for upgrde?

Soon.

Wonderful, thank you.
It’s great that you respond to these requests and are preparing a fix.

So, What is the patch to retrieve the template from your repository repo.turris.cz?

I can confirm that it now works in version TurrisOS 4.0-alpha2. But only from the repository “image.linuxcontainers.org”.

I came across a strange situation. The LXC container is created from Luci, it exists on the disk, but it does not appear in Luci interface.

TurrisOS 4.0-alpha2