OpenVPN in LXC: Failed to set devices.allow

Quentin Skousen

I have been trying to get OpenVPN working in a LXD-managed LXC container on Ubuntu 16.04. I have added the tun device to the container config via lxc config edit container and it is properly created. I have run

lxc config set mycontainer raw.lxc 'lxc.cgroup.devices.allow = c 10:200 rwm'

and it shows up in the container config, but I when I run

systemctl start [email protected]

I get this in my error log:

Jul 13 09:52:56 lb systemd[1]: Failed to reset devices.list on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Failed to set devices.allow on /system.slice/system-openvpn.slice/[email protected]: Operation not permitted
Jul 13 09:52:56 lb systemd[1]: Starting OpenVPN connection to server...
-- Subject: Unit [email protected] has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit [email protected] has begun starting up.
Jul 13 09:52:56 lb systemd[1]: Failed to reset devices.list on /system.slice/ondemand.service: Operation not permitted

Here is my container config:

$ lxc config show --expanded lb
name: lb
profiles:
- default
config:
  raw.lxc: lxc.cgroup.devices.allow = c 10:200 rwm
  volatile.base_image: f452cda3bccb2903e56d53e402b9d35334b4276783d098a879be5d74b04e62e2
  volatile.eth0.hwaddr: xx:xx:xx:xx:xx:xx
  volatile.eth1.name: eth1
  volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":231072,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":165536,"Nsid":0,"Maprange":65536}]'
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
  eth1:
    hwaddr: xx:xx:xx:xx:xx:xx
    nictype: bridged
    parent: lxdbr1
    type: nic
  root:
    path: /
    type: disk
  tun:
    path: /dev/net/tun
    type: unix-char
ephemeral: false

And the files in /dev/net:

$ ll /dev/net
total 0
drwxr-xr-x 2 root root      60 Jul 13 09:36 ./
drwxr-xr-x 9 root root     480 Jul 13 09:36 ../
crw-rw-rw- 1 root root 10, 200 Jul 13 09:36 tun
OttoEisen

You still have a raw.lxc object. And according to the poster (see Edit1) he did exactly the same, didn't work, used "device add" and it worked. Give it a try...

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to set static names for lxc-veth-devices on the host?

From Dev

nftables with openvpn and lxc

From Dev

lxc-start: failed to spawn

From Dev

lxc-start: failed to spawn

From Dev

juju charm failed in local lxc

From Dev

Allow loop mounting files inside LXC containers?

From Dev

Allow loop mounting files inside LXC containers?

From Dev

How to run openvpn in a LXC container inside debian host?

From Dev

Set up DHCP for LXC containers

From Dev

How to use lxc profile set?

From Dev

lxc-start: Invalid argument - failed to clone

From Dev

OpenVPN: Allow access only for local connections (via OpenVPN)

From Dev

Setup permanent bridge for dynamic network devices from lxc container?

From Dev

Failed to start OpenVPN connection to server. But I had removed OpenVPN

From Dev

Fail to set up dns on openvpn

From Dev

How to set up networking for lxc containers in OpenStack?

From Dev

OpenVPN - TLS key negotiation failed on Raspbian

From Dev

OpenVPN activation of network connection failed v

From Dev

lxc-attach failed to enter the namespace - EC2 Instances

From Dev

LXC container: mktemp: failed to create file via template

From Dev

Allow CALL_PHONE permission on devices with no phone

From Dev

Do all Android devices allow debugging?

From Dev

Do all Android devices allow debugging?

From Dev

Allow android 4 devices to connect to Apache HTTPS

From Dev

Allow normal users writing to intermittent block devices

From Dev

OpenVPN & iptables - allow traffic to certain specific hosts on server side

From Dev

Allow clients in network to communicate to client connected via OpenVPN

From Dev

Allow client to client communication in OpenVPN for certain IP range

From Dev

Allow to set NULL for datagridview?

Related Related

  1. 1

    how to set static names for lxc-veth-devices on the host?

  2. 2

    nftables with openvpn and lxc

  3. 3

    lxc-start: failed to spawn

  4. 4

    lxc-start: failed to spawn

  5. 5

    juju charm failed in local lxc

  6. 6

    Allow loop mounting files inside LXC containers?

  7. 7

    Allow loop mounting files inside LXC containers?

  8. 8

    How to run openvpn in a LXC container inside debian host?

  9. 9

    Set up DHCP for LXC containers

  10. 10

    How to use lxc profile set?

  11. 11

    lxc-start: Invalid argument - failed to clone

  12. 12

    OpenVPN: Allow access only for local connections (via OpenVPN)

  13. 13

    Setup permanent bridge for dynamic network devices from lxc container?

  14. 14

    Failed to start OpenVPN connection to server. But I had removed OpenVPN

  15. 15

    Fail to set up dns on openvpn

  16. 16

    How to set up networking for lxc containers in OpenStack?

  17. 17

    OpenVPN - TLS key negotiation failed on Raspbian

  18. 18

    OpenVPN activation of network connection failed v

  19. 19

    lxc-attach failed to enter the namespace - EC2 Instances

  20. 20

    LXC container: mktemp: failed to create file via template

  21. 21

    Allow CALL_PHONE permission on devices with no phone

  22. 22

    Do all Android devices allow debugging?

  23. 23

    Do all Android devices allow debugging?

  24. 24

    Allow android 4 devices to connect to Apache HTTPS

  25. 25

    Allow normal users writing to intermittent block devices

  26. 26

    OpenVPN & iptables - allow traffic to certain specific hosts on server side

  27. 27

    Allow clients in network to communicate to client connected via OpenVPN

  28. 28

    Allow client to client communication in OpenVPN for certain IP range

  29. 29

    Allow to set NULL for datagridview?

HotTag

Archive