Posts Tagged ‘ udev ’

Install fuse powered filesystems within an LXC container

I’m running a Debian Squeeze in an LXC container, and i needed to install SSHFS within the container, a FUSE based filesystem which lets you to mount remote filesystems through SSH. It shouldn’t be a problem, but fuse-utils depends on udev, and as you may know, LXC containers do not support udev, which will cause problems during the install.
While installing the udev package you’ll get some errors related with device creation like the following one:

Populating the new /dev filesystem temporarily mounted on /tmp/udev.EgkS50/...
mknod: `//tmp/udev.EgkS50/ppp': Operation not permitted

In order to solve this i had to allow those new devices to be created in your container’s configuration file by adding the following lines:

#ppp
lxc.cgroup.devices.allow = c 108:0 rwm
#fuse
lxc.cgroup.devices.allow = c 10:229 rwm
#loop0
lxc.cgroup.devices.allow = b 7:0 rwm
#tun
lxc.cgroup.devices.allow = c 10:200 rwm

Now start your container and login.
Then, because the udev install will break your created devices, you should backup them:

user@host:~$ sudo cp -a /dev /dev.old

Go and install your fuse based filesystem, i’ll be installing sshfs:

user@host:~$ sudo apt-get install sshfs

Restore your old devices:

user@host:~$ sudo cp -a /dev.old/* /dev/

Create the fuse device:

user@host:~$ sudo mknod /dev/fuse c 10 229

Avoid udev to boot by disabling its init scripts:

user@host:~$ sudo update-rc.d -f udev disable

And that’s it, you should now be able to mount your fuse powered filesystem :-)

Advertisements