Difference between revisions of "Mount ISO image in a OpenVZ container"

From vpsget wiki
Jump to: navigation, search
Line 3: Line 3:
 
Original page can be found here: http://openvz.org/Mount_ISO_image_in_a_container
 
Original page can be found here: http://openvz.org/Mount_ISO_image_in_a_container
  
You need to install '''fuseiso''' and '''fuse''' into 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
  
To mount an ISO image, do next command inside container:
+
 
 +
You need to install  '''fuseiso''' and '''fuse''' or '''fuse-utils''' into container.
  
 
Run on a node:
 
Run on a node:
Line 14: Line 21:
 
  vzctl exec <CT_ID> mknod /dev/fuse c 10 229
 
  vzctl exec <CT_ID> mknod /dev/fuse c 10 229
  
 +
To mount an ISO image, do next command inside container:
 
Run inside VPS
 
Run inside VPS
 
  fuseiso image.iso /mnt/disk
 
  fuseiso image.iso /mnt/disk

Revision as of 18:10, 18 November 2016

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.