Question : I am unable to share nfs from a non-global zone.
Consider the following example.
– sysadmin creates a non-global zone and wants to share a zfs mount point from non-global zone.
– While setting ZFS parameter “sharenfs”, he encounters an error :
cannot set property for 'findisk/faktudt_users': 'sharenfs' cannot be set on dataset in a non-global zone
– Another case is when ufs file system is shared from the non-globa zone using the /etc/dfs/dfstab file or on command line. The shareall command fails :
/usr/sbin/shareall share_nfs: /var/opt/sun: Operation not supported share_nfs: /var/js: Operation not supported share_nfs: /opt/SUNWjet: Operation not supported
– The sysadmin would not be able to bring the nfs server service up. While the /var/svc/log/network-nfs-server log in the non-global zone shows errors:
[Jan 2 16:12:41 Executing start method ("/lib/svc/method/nfs-server start") ] The NFS server is not supported in a local zone [ Jan 2 16:12:43 Method "start" exited with status 0 ] [ Jan 2 16:12:43 Stopping because all processes in service exited. ] [ Jan 2 16:12:43 Executing stop method ("/lib/svc/method/nfs-server stop 2274998") ] [ Jan 2 16:12:43 Method "stop" exited with status 0 ]
This is anticipated behavior.
Although this is a limitation in solaris 10 non-global zone there are 3 alternatives which you can use to overcome this.
alternative 1 : share resources from the global zone via LOFS:
On the global zone :
1. Be superuser, or have the required rights profile.
2. Use the zonecfg command to edit non-global zone configuration
global# zonecfg -z my-zone
3. Add a file system to the configuration.
zonecfg:my-zone> add fs
4. Set the mount point for the file system, /datafiles in my-zone.
zonecfg:my-zone:fs> set dir=/datafiles
5. Specify that /export/datafiles in the global zone is to be mounted as /datafiles in my-zone.
zonecfg:my-zone:fs> set special=/export/datafiles
6. Set the file system type.
zonecfg:my-zone:fs> set type=lofs
7. End the specification.
8. Verify and commit the configuration.
zonecfg:my-zone> verify zonecfg:my-zone> commit
On the client :
# mount -F lofs (global_zone_mount_point) (local_zone_mount_point) where (global_zone_mount_point) ----> /datafiles and (local_zone_mount_point) ----> /export/datafiles/
Use third party software, but there would be no technical support from Oracle.
Use Solaris 11 Native Zones, which can be NFS servers.