Search Type:
Search for:

Language:

Product:
Category:
No categories for selected product

NFS support inside containers in Parallels Virtuozzo Containers 4.x

Article ID: 5494 
Last Review: Nov,2 2009
Author: Kolomoets Alexey
Last updated by: Kolomoets Alexey APPLIES TO:
  • Virtuozzo Containers for Linux 4.0

Resolution

In Parallels Virtuozzo Containers 4.x one may mount NFS share from within a container.

Let us assume we have the container #101 based on CentOS OS. The steps outlined below will allow to mount share named as '/share' from the NFS server nfs.domain.com as '/mnt' from within the container #101.

First, for NFS mounts to work in containers you must load the module 'nfs' on the Virtuozzo hardware server itself:
# modprobe nfs

Then, to allow a container to use NFS filesystem, you will need to start it with "nfs" feature enabled:
# vzctl set 101 --features nfs:on --save
# vzctl start 101

If the container is running while you set the 'nfs' feature, you will need to restart it:
# vzctl restart 101

After it is done you should see 'nfs' in the list of available filesystems inside the container #101:
# vzctl exec 101 cat /proc/filesystems
    ext2
    ext3
nodev    rpc_pipefs
nodev    autofs
nodev    proc
nodev    sysfs
nodev    tmpfs
nodev    devpts
nodev    nfs

Next, you need to install the packages 'nfs-utils' and 'nfs-utils-lib' in the container, it may be done using the utility 'yum':
# yum install nfs-utils nfs-utils-lib

Note: if you have Debian- or Ubuntu-based container then you need to install the package 'nfs-common' instead of 'nfs-utils' and 'nfs-utils-lib'. Use the utility 'apt-get':
# apt-get install nfs-common

Now you may mount NFS share from within the container #101:
- start the service 'portmap':
# /etc/init.d/portmap start

- mount NFS share:
# mount -t nfs nfs.domain.com:/share /mnt

In case you see error like this:

mount: mount to NFS server 'nfs.domain.com' failed: RPC Error: Program not registered.


please make sure that nfs server is running on nfs source node:
# /etc/init.d/nfs status

You may also want to make service 'portmap' to start automatically when the container is booting, use the utility 'chkconfig':
# chkconfig --level 3 portmap on


And finally, you may add the feature 'nfs' to every new Container you will create, it may be done using scripts 'vps.create' or 'vps.clone'. Please refer to this article for more details - How do I automate actions after container creating/cloning.
Keywords: NFS inside container


Subscription for changes to this article Subscription for changes to this article

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
* - required fields
 
 
 
 
 
 
For Home
For Business
For Hosters
For SaaS
For Developers
 
Desktop Virtualization
- Parallels Desktop Switch to Mac Edition
- Parallels Desktop for Mac
- Parallels Desktop 4 for Windows & Linux
- Parallels Workstation Extreme
- Parallels Solution for Windows 7
Server Virtualization
- Parallels Server for Mac
- Parallels Server 4 Bare Metal
- Parallels Virtuozzo Containers
Automation
- Parallels Operations Automation
- Parallels Business Automation
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
More Products