“mknod: `/lib/udev/devices/ppp’: Operation not permitted” when updating Ubuntu 10.04 on virtual LXC machine

Today I wanted to update my virtual LXC Ubuntu and I got an error:

Initializing package states... Done
The following partially installed packages will be configured:
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Setting up udev (151-12.1) ...
mknod: `/lib/udev/devices/ppp': Operation not permitted
dpkg: error processing udev (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

This happens because I restricted access to my hardware in a configuration file:

lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
# /dev/pts/* - pts namespaces are "coming soon"
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm

Only listed devices are allowed to access.

First we need to know major and minor numbers of this device. On the host system (the same Ubuntu, the same version 10.04) run:

root@servukas:~# ls -l /lib/udev/devices/ppp
crw------- 1 root root 108, 0 2010-07-17 06:55 /lib/udev/devices/ppp

Notice bolded numbers 108 and 0.

So there is a way to add line:

lxc.cgroup.devices.allow = c 108:0 rwm

to LXC virtual machines config file and recreate a virtual machine. But I don’t like downtimes.

Another way is to add this option on-the-fly. On the host system run:

root@servukas:# cat > /cgroup/hostingas/devices.allow
c 108:0 rwm

Press ctrl+d when finished typing.

Repeat these steps with /lib/udev/devices/loop0 (b 7:0 rwm) and /lib/udev/devices/net/tun (c 10:200 rwm) to successfully update udev.

7 comments to “mknod: `/lib/udev/devices/ppp’: Operation not permitted” when updating Ubuntu 10.04 on virtual LXC machine

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>