It is possible to use FUSE (filesystem in userspace) to mount an ISO image inside a container.
Make sure that the
fusemodule is loaded on the Hardware Node:
~# lsmod | grep fuse
If it is not there, use:
~# modprobe fuse ~# lsmod|grep fuse fuse 45320 0
If it is needed to load it automatically on boot, configure it in accordance with the corresponding OS instructions:
Grant Container #101 the permission to work with the
/dev/fusecharacter device, and create a corresponding device inside a container (run these commands on the PVC server):
new syntax, using the device name:
~# vzctl set 101 --save --devnodes "fuse:rw"
Note: if the container already had some devnodes configured, it is needed to add them in the above command, e.g.:
~# vzctl set 101 --save --devnodes "fuse:rw net/tun:rw"
old syntax, using the device major and minor IDs:
~# vzctl set 101 --save --devices c:10:229:rw ~# vzctl exec 101 mknod -m 666 /dev/fuse c 10 229 ~# vzctl exec 101 cp -a /dev/fuse /lib/udev/devices/
If the file
/dev/fusealready exists, make sure it has proper access permissions. Also, if the directory
/lib/udev/devicesdoes not exist, you must create it and set correct access permissions:
~# vzctl exec 101 mkdir /lib/udev/devices ~# vzctl exec 101 chmod 755 /lib/udev/devices/
Check these files:
~# vzctl exec 101 ls -l /lib/udev/devices/fuse crw-rw-rw- 1 root root 10, 229 Oct 25 19:37 /lib/udev/devices/fuse ~# vzctl exec 101 ls -l /dev/fuse crw-rw-rw- 1 root root 10, 229 Oct 25 19:37 /dev/fuse
Install "fuseiso" packages and fuse them into a container. The names of the packages may be different on different Linux distributions: For Debian and Ubuntu, install the fuseiso and fuse-utils packages (available in the repository). For RHEL/CentOS 3/4/5, use DAG's packages, fuse-iso and fuse. For Fedora 7/8, both fuseiso and fuse are available from the main/updates repositories for Fedora 6: fuse is available from the "extras" repository, and you can use dries for fuse-iso. To mount an ISO image, run the command inside a container:
~# fuseiso IMAGE.iso /mnt
Replace IMAGE.iso in the command above with the exact name of the ISO image (including the path) on the filesystem, and replace
/mntwith the path to where you want the ISO image to be mounted.
To unmount the image, use this command:
~# fusermount -u /mnt
/mntwith the exact path to where the ISO image is mounted.