Pages

Wednesday, April 27, 2011

Mounting a Windows share on a VMware ESX server throws error: “Error connecting to <IP or Name> (Connection Refused)”, “14409: Connection to <IP or Name> failed” and “SMB connection failed”.

I was recently asked by an ex-colleague about having an issue with mounting a Windows server share from within an ESX 3.5 server and my first instinct turned out to be wrong so I thought it might be worth while to write up a blog post with the specific error he encountered and stating the resolution.

Problem

  • You’ve logged into an ESX server either through SSH or the console.
  • You create a directory with MKDIR.
  • You make an attempt to mount a windows share but get the following error message:

login as: stats
stats@servervm03's password:
[stats@servervm03 stats]$ su -
Password:
[root@servervm03 root]# mkdir /mnt/esxshare
[root@servervm03 root]# mount -t smbfs -o username=stats //10.10.16.75/stats /mnt/esxshare
Error connecting to 10.10.16.75 (Connection refused)
14409: Connection to 10.10.16.75 failed
SMB connection failed
[root@servervm03 root]# ping 10.10.16.75
PING 10.10.16.75 (10.10.16.75) 56(84) bytes of data.
64 bytes from 10.10.16.75: icmp_seq=0 ttl=127 time=0.305 ms
64 bytes from 10.10.16.75: icmp_seq=1 ttl=127 time=0.257 ms

--- 10.10.16.75 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1017ms
rtt min/avg/max/mdev = 0.257/0.281/0.305/0.024 ms, pipe 2
[root@servervm03 root]#

image

Solution

Since my ex-colleague was trying to mount a Windows Server 2003 share, the first response I had with my coworker was to ensure that he has disabled the Microsoft network server: Digitally sign communcations (always) policy in the Local Security Policy under Local Policies –> Security options.  This turned out to not be the cause because he had already done it.  After spending a few minutes to think about it over the phone, I asked if he had actually enabled the SMB Client service on the ESX server with the esxcfg-firewall command and as it turns out, he hasn’t.  Here’s what he ended up having to do to get it to work:

login as: stats
stats@servervm03's password:
[stats@servervm03 stats]$ su -
Password:
[root@servervm03 root]# mkdir /mnt/esxshare
[root@servervm03 root]# mount -t smbfs -o username=stats //10.10.16.75/stats /mnt/esxshare
Error connecting to 10.10.16.75 (Connection refused)
14409: Connection to 10.10.16.75 failed
SMB connection failed
[root@servervm03 root]# ping 10.10.16.75
PING 10.10.16.75 (10.10.16.75) 56(84) bytes of data.
64 bytes from 10.10.16.75: icmp_seq=0 ttl=127 time=0.305 ms
64 bytes from 10.10.16.75: icmp_seq=1 ttl=127 time=0.257 ms

--- 10.10.16.75 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1017ms
rtt min/avg/max/mdev = 0.257/0.281/0.305/0.024 ms, pipe 2
[root@servervm03 root]# esxcfg-firewall -e smbClient
[root@servervm03 root]# mount -t smbfs -o username=stats //10.10.16.75/stats /mnt/esxshare
Password:
[root@servervm03 root]#

image

**Notice how the console now asks for the password of the login that is being used to the access the share.

What I always like to do at this point is to test the connection to the share with the touch command as such:

[root@servervm03 root]# touch /mnt/esxshare/testfile.txt

[root@servervm03 root]#

image

Once the command successfully executes, open up the share and confirm that the file was indeed created:

image

If you see the file as shown in the screenshot above, you’ve successfully created the mount.

No comments: