VMware Cloud Community
RColbert
Enthusiast
Enthusiast

NFS Export from ESX 3 COS

I am trying to find a way to export an IDE partition from the console of an ESX 3.0 server. I can export it and have access via a UDP nfs session but for reliability, I want a TCP connection. Does anyone know how to make the console nfsd export via TCP? When I do an rpcinfo -p, it only shows UDP listeners for nfs.

0 Kudos
61 Replies
bpowers7
Contributor
Contributor

I just got this to work on ESX 3.5 by modifying the steps slightly (using ALL of the feedback from within this thread - Thanks All!)

Here were the steps I followed:

-


NOTE: DO NOT RUN THE COMPILE ON A PRODUCTION MACHINE!

-


1) As with any modification to an OS, make a backup of the things you're going to possible change. In this case, the modules folder in /lib/modules.

cp 2.4.21-37.0.2.ELvmnix 2.4.21-37.0.2.ELvmnix.old

2) cd /usr/src/linux-2.4/configs

3) nano vmnix.config, search for CONFIG_NFSD_TCP and change the commented line to:

CONFIG_NFSD_TCP=y

4) cp vmnix.config kernel-2.4.21-i686-vmnix.config

5) cd /usr/src/linux-2.4

6) Verify that the 'Makefile' has the required updates. Change the end of the EXTRAVERSION line from ELcustom to ELvmnix

7) make mrproper

😎 make oldconfig

9) make dep

10) nano /usr/src/linux-2.4.21-57.EL/include/linux/version.h and edit the following line (or add it if it doesn't exist) THIS MUST BE THE RECORDED BUILD VERSION FROM THE VC CLIENT:

#define VMNIX_BUILD "103908"

11) make modules

12) If the build completed properly, you can copy the newly created nfsd.o module.

cp /usr/src/linux-2.4.21-57.EL/fs/nfsd/nfsd.o /lib/modules/2.4.21-57.ELvmnix/kernel/fs/nfsd/

Service and Firewall Configuration

13) nano /etc/init.d/nfs

14) change line 6 to be:

  1. chkconfig: - 50 20

This causes the nfs daemons to start BEFORE the vmware-late process (which mounts NFS stores) when you run step 13

15) chkconfig --level 345 nfs on

16) chkconfig --level 345 portmap on

17) esxcfg-firewall -o 111,tcp,in,sunrpc

18) esxcfg-firewall -o 111,udp,in,sunrpc

19) esxcfg-firewall -o 369,tcp,in,rpc2portmap

20) esxcfg-firewall -o 369,udp,in,rpc2portmap

21) esxcfg-firewall -o 808,tcp,in,mountd

22) esxcfg-firewall -o 2049,tcp,in,nfs

23) esxcfg-firewall -o 2049,udp,in,nfs

24) nano /etc/sysconfig/nfs and add:

MOUNTD_PORT=808

This forces the mountd daemon to listen on port 808 otherwise it chooses one at random and won't allow inbound connections through the firewall.

Create your /etc/exports file accordingly and verify your mount points are all working.

Restart the server and you will now have a working TCP NFS daemon on the ESX 3 COS. From there, you can export your folder and mount it using the VI Client.

To confirm everything is funtioning, run rpcinfo -p to get the port and transport list of RPC services. The line to look for has "_2049 tcp nfs_" in it.

If "2049 tcp nfs" is not shown, you probably have the original nfsd.o module loaded. 1st thing to try:

1) service nfs stop

2) Check to see if nsfd has it's module currently loaded by running lsmod. Unload the current nfsd.o module:

rmmod nfsd

3) recompile or recopy the NEW nfsd.o module to:

/lib/modules/2.4.21-57.ELvmnix/kernel/fs/nfsd/

4) Then do a modprobe nfsd. See if it loads - if you get no error, that's a good sign. Do another lsmod and see if it's there.

5) Start nfs again and see if it is listening on the correct port:

service nfs start

rpcinfo -p

6) If all else fails, reboot and see if the correct module is loaded and the ports are open.

Hope that helps!

Enjoy!

0 Kudos
mblake4u
Contributor
Contributor

Hi,

Can anyone please tell me if this is possible with ESXi 3.5 update 2?

Many thanks,

Michael

0 Kudos