LXC: Cant get access to the host wifi from inside the linux container


i am trying since alot of weeks to find a way to connect a wifi-card from host to a debian-lxc.
I did setup a container and got standard eth0 and loop-network.
I did set up a guest-wifi and can reach it like i do with lan, but it is not available as wifi-card on LXC.
I also can ping the guest-adress from HOST to LXC and from LXC to HOST.

See LXC-Config below:

Network configuration

lxc.network.type = veth
lxc.network.link = br-lan
lxc.network.name = eth0
lxc.network.ipv4 =
lxc.network.script.up = /usr/share/lxc/hooks/tx-off
lxc.network.hwaddr = 22:e4:3c:a8:29:3f
lxc.network.flags = up

Guest-Wlan configuration

lxc.network.type = veth
lxc.network.link = br-guest_turris
lxc.network.name = guest_wlan
lxc.network.ipv4 =
lxc.network.script.up = /usr/share/lxc/hooks/tx-off
lxc.network.hwaddr = 00:e1:4c:a8:28:4f
lxc.network.flags = up

So that do work, but on “iw dev” do not show any wifi card available.
ifconfig shows the lo, eth0 and my added bridged guest-lan.
The Guest-Wlan configuration ist bridged to wlan1.
I would like to have the phys wlan0 or wlan1 or a subset of wlan1 (like guest-wlan) on LXC available so i could scan the wlan and connect to from inside the linux container.

So how do i configure the host and linux container to have a wifi card recognized on LXC for a scan and connect ?

Would be nice if anyone on here could help a newbie to manage this.


If i remember correctly LXC does NOT support wifi cards. I also tried this in the past maybe a year ago or so. That is generally what i can remember. I even went on their IRC channel to ask this question.

However, back then and now we are still on version 1.1.5 which isn’t being supported anymore since back in 2016. The latest version of LXC is at the moment 2.1. MAYBE the possibility to be able to use wifi-cards is supported in a version past 1.1.5, but not sure for now.

root@K-Router:~# opkg info lxc
Package: lxc
Version: 1.1.5-10
Depends: libc
Status: install user installed
Section: utils
Architecture: mvebu
Maintainer: Luka Perkov <luka@openwrt.org>
Size: 1038
Filename: lxc_1.1.5-10_mvebu.ipk
Source: feeds/packages/utils/lxc
Description: LXC is the userspace control package for Linux Containers, a lightweight
 virtual system mechanism sometimes described as "chroot on steroids".
Installed-Time: 1520498259

Thanx alot for the info.
I will check out whether versions above 1.1.5-10 got direct wifi support inside LXC.

So what i have read was, that even in LXC 1.0 there was a wlan phys possibility and a bugfix on this.
(and even in 2014 there as a bugfix on wlan phys)

LXC 1.0.9 release announcement 23rd of November 2016
This is the ninth bugfix release for LXC 1.0.
Security fix for CVE-2016-8649

lxc: let lxc-start support wlan phys

But i tried phys on container-config for wlan0 and it doesnt work.

lxc.network.type = phys
lxc.network.link = wlan0

Wondering whether it will work this way on LXC 2.0
I thought, all NICs configured on host will be accessable on container too.
But maybe i am doing something wrong on configuration.

You also thanks for the info.

You COULD test it out by using a wifi dongle in your pc/laptop. With that using Virtualbox and run first Ubuntu or some Linux distro that is up to date. That way you could test if using Ubuntu with latest version of LXC the wifi does work or not. If it does work, then maybe use openwrt Virtualbox with wifi-dongle and LXC (which will be version 1.1.5).

Before experimenting with this, as a reminder to use a wifi-dongle that is supported in Linux out of the box, OR being able to install the drivers in it by compiling or getting them from a repository.

Let me know how it goes.


thanks for the hint with the USB-Stick.
I will configure the USB-Port on Turris and stick in the Wifi-USB stick.
Maybe then it does work (?)
Still just wondering why the phys-NIC does not work with version 1. There is a phys-type which should do the setup or do i understand something wrong and made a wrong setup to have the physically cards on LXC available ?

Like i said, i configured a guest-wlan with a bridged network-interface for the guest-wlan and did set up the firewall to let traffic go through from and into the LXC, which worked so far (even a configured DHCP worked).
See “lxc.network.type = veth” above with link to the bridged “br-guest_turris”-network interface.
But this is a virtual ethernet i am connecting to which do not show the phys wifi-card inside the LXC.
Using phys as network-type instead of veth to get access to the phys wifi card failed (maybe i am doing something wrong with configuration).

If i have to set up a pc with a virtual machine i dont need the LXC, because then i have a solution to connect to the other machine over WiFi.
It would just be interesting to know in a test whether a LXC 2.x do work then with wifi-stick.
I will maybe test it out in a last step on the virtual machine with LXC - just to know whether it does work so far.
But nicer would be to have it working on Turris Omnia because i got two wifi-cards active.

Just wondering - why not to upgrade LXC on Turris Omnia 2 to the LXC v2.x ?
Do i brick the Omnia configuration then ? Is there something to know before to go for an upgrade ?
Maybe Turris will set it up with an update ?

But for now i will try to set up the USB to have the stick available (btw, using debian jessie as LXC).


Hi Pex,

That it is not working, it could be because of the version of LXC (not supporting for example those wifi-cards), or a bug, but a newer version of LXC maybe supporting them through virtualization. That is why i suggested to use a USB-wifi-dongle with virtualization running on your own computer. In there having even Debian Jessie, but also up-to-date version of LXC.

Often the maintainers or creators are other guys than of the Turris team. I have asked previously this question, but i have not received a answer to the question of why not upgrading. Maybe lower priority? Anyways i do not know. However the whole break-up issue with LEDE & OpenWRT, now finally being resolved this could also be something of the past and in the near future having LXC also updated in the openwrt repository, which would mean we with Turris-OS also would get a newer version of it.

I guess the Turris-team is especially concentrating on bugs and updating more important software (openVPN, libreSSL, dnsmasq, KRACK(wifi security just recently)…etc). As those pieces of software can be a direct security issue, while LXC is rather local. If nobody has direct access to your network, having LXC even be outdated for nearly 5 years, would be no problem, as long as it works for basic purposes of having a LXC running. Indeed i would also have LXC updated to a newer version as a lot more commands and functionality have been added. That way getting more experience of using LXC.

If you would like to upgrade, you need to create your own package, which i have not done it myself so far. To create your own package you need to cross-compile if i remember correctly, but also have certain guidelines to work by. As i have said, i haven’t done it myself, so i can’t really help you in this.

But it’s the best that you first experiment through virtualbox/vmware on your own computer. I have in the past used openwrt on VirtualBox which worked as i expected to. You could also try LEDE latest version but i am not sure if they have a *.vdi file available to use.