Mount ISO image in a OpenVZ container

From vpsget wiki
Revision as of 18:10, 18 November 2016 by Ndi (talk | contribs)
Jump to: navigation, search

This page describes how to mount ISO image inside a container.

Original page can be found here: http://openvz.org/Mount_ISO_image_in_a_container

Check/install the fuse module on server node:

lsmod | grep fuse
modprobe fuse

You may add to load module on node reboot Create /etc/sysconfig/modules/custom.modules and insert/add:

modprobe fuse


You need to install fuseiso and fuse or fuse-utils into container.

Run on a node:

vzctl set <CT_ID> --devnodes fuse:rw --save

OR alternative you can run the next commands on node:

vzctl set <CT_ID> --devices c:10:229:rw --save
vzctl exec <CT_ID> mknod /dev/fuse c 10 229

To mount an ISO image, do next command inside container: Run inside VPS

fuseiso image.iso /mnt/disk

NOTE that depending on OS inside container some things may be differ: for Debian and Ubuntu, install fuseiso and fuse-utils packages (available in repository) for RHEL/CentOS 3/4/5, use DAG's packages fuse-iso and fuse

For example for Debian 8 it's also necessary to run the next command inside container before install fuse:

mknod /dev/fuse c 10 229

It may not work if run on the node using vzctl exec in some cases. SO just keep in mind this.