Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

FUSE

1,328 bytes added, 16:28, 10 March 2022
Container tuning
This page describes how to setup FUSE (filesystem in userspace) inside a VEcontainer.
[http://git.openvz.org/?p=linux-2.6.18-openvz;a=blob;h=a584f05403a412e778cf359e84d3690d5a22d1e4;hb=045f4a5fcb8c2625fe7505a8d9d4ebffd7e0d905;f=Documentation/filesystems/fuse.txt FUSE] is a filesystem in which data and metadata are provided by an ordinary userspace process. The filesystem can be accessed normally through the kernel interface.
== Setup ==
=== Kernel ===
* Download appropriate kernel from [http://download.openvz.org/ openvz.org] or compile kernel with <code>CONFIG_FUSE_FS</code> option set* Debian/Ubuntu: You can alternatively add the line <code>fuse</code> into /etc/modules, and apply immediately with the command: <pre>modprobe --first-time fuse</pre>
=== Libfuse Userspace ===Compile You have to fuse libraries and some fuse filesystem modules (here we use sshfs as an example). The best way to have it installed is to use the packages from your distro vendor. An alternative is compiling the stuff from source. ==== Gentoo ====  # emerge sys-fs/sshfs-fuse ==== Fedora ====  # yum install fuse-sshfs ==== Debian/Ubuntu ========= Debian 5.0 (lenny) =====FUSE cannot be installed due to udev/hotplug dependency (explained in [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503953 bug report 503953]) ===== Ubuntu, Debian 6.0 (squeeze), Debian 4.0 (etch) and older ===== # apt-get install sshfs (Debian 4.0 note: see [[Installing udev in VE based on Debian-4.0]]) ==== Compiling from source ====If there are no packages provided for you distribution, you have to compile from source. First, compile libfuse in a VE container without kernel module
<pre>
# vzctl enter 100
</pre>
{{note| Sometimes <code>libfuse.so.X</code> is unseen by your programs. Usually this file is installed in <code>/usr/local/lib</code> directory so don't forget to add it this directory into your <code>/etc/ld.so.conf</code>and then run <code>ldconfig</code>.}}
=== Filesystem ===Download Next, download and compile filesystem.
<pre>
# vzctl enter 100
</pre>
=== VE Container tuning ===You need to make a characted character device named <code>/dev/fuse</code> and grant your VE container permissions to it
<pre>
# vzctl set 100 --devices c:10:229:rw --save
...
</pre>
 
Or more simply:
<pre>
# vzctl set 103 --devnodes fuse:rw --save
...
</pre>
 
Note that restart (or moving to root container device cgroup before mounting) might be required.
=== Mounting filesystem ===
After this you may try to mount FUSE in a VEcontainer.
<pre>
# vzctl enter 100
# sshfs <nowiki>root@foo.org</nowiki>:/root /mnt/foo.org.root
</pre>
In case of <code>sshfs</code> after umounting an appropriate daemon must be killed. This may be done by the following command:
<pre>
# fusermount -u moutpointmountpoint
</pre>
== Using fusectl filesystem ==
Fusectl is a helper filesystem for FUSE. You may mount it in a VE container as well.
<pre>
# vzctl enter 100
# mount -t fusectl none /fuse_ctl
</pre>
 
== External links ==
 
* [http://fuse.sourceforge.net/ FUSE site]
[[Category:HOWTO]]
Anonymous user