Mount A loop Device In An OpenVZ Container

Mount A loop Device In An OpenVZ Container

Category : How-to

Get Social!

You can pass a loop device through to an OpenVZ container with the vzctl command. You’ll need to mount the loop device on your host, as there is no support within an OpenVZ container to mount the device within the container. This means that the source of the loop device will also need to be available on the guest.

Note: This has been disabled in the latest versions of vzctl.

The device will then be passed through to the container so that it can be used by the container.

Run the vzctl command with the Container ID and loop device name that you’d like to use.

vzctl set [CTID] --devnodes [LOOP]:rw

For example, to pass loop0 through to Container ID 100 use:

vzctl set 100 --devnodes loop0:rw


Leave a Reply

Visit our advertisers

Quick Poll

How often do you change the password for the computer(s) you use?

Visit our advertisers