Connecting to Windows share from ESX Server

I keep all my OS and software media as ISO files on my PC.  At work we have an ISO library on a filer NAS share.  When creating virtual machines on ESX it’s much more efficient to install OS’s and applications by mounting an ISO image.  Its possible to connect to window shares from your ESX servers to access and mount your ISO’s

First you need to enable samba services on your ESX server’s firewall:

(from the ESX server console)

esxcfg-firewall -e smbClient

Next you need to create a location for your mount point.  Because the “vmimages” folder is visable from VirtualCenter, put the mount point in that folder

mkdir /vmimages/iso

Next you need to enable netfs – netfs is a file system interface to the networking stack of the ESX OS

chkconfig netfs on
service netfs start

Now you can mount the share in ESX.  Make sure the username you use is valid on the Windows host.  If its a domain member, use the “domainusername” format

mount -t smbfs -o username=<enter username>,password=<enter password> //servername/sharename /vmimages/iso

Now browse to the vmimages folder under your datastore and there you have it

VirtualCenter

This entry was posted in Virtualization. Bookmark the permalink.

9 Responses to Connecting to Windows share from ESX Server

  1. Manny Aragones says:

    A very common problem on default ESX installations is (and a problem I’m experiencing when trying this procedure is):

    when ls on the vmimages directory I get: ‘Stale NFS file handle’ and the folder is not visible from the VI client under vmimages.

  2. tony says:

    Sounds like Samba isn’t running. Have you checked the firewall setting within ESX? I’ve done this exact procedure at least a dozen times without issue. Could you elaborate on your hardware config a bit more?

  3. Charles says:

    Very good doco. Works like a charm on ESX 3

  4. Jan Fabo says:

    Hi, I want to ask, how can I do this procedure vise-versa. More exactly, how could I connect /vmimages dir to w2k3 through Map network drive ommmand?
    The reason for doing this is that I’ve physically 2x300GB hdd’s in ESX3.5 hardware, but ESX offers only one of them to use as datastore, on the other one is esx server installed. Truly, I don’t have much money to buy NAS or more SATA disks, so I want to use at least 200GB of hdd, where is esx. 500GB will be enough for VM’s, VM’s data and iso’s.
    If you know how to do this more professional I’d be very thankfull.
    Jan

  5. tony says:

    Secure FTP should work

  6. Naku says:

    In configuring my Win 2k3 server, would I add the vmimages directory and share it out, in or for the ESX server to see it?

    • tony says:

      You need to create the share first on your W2K3 server (give Everyone READ permissions at a minimum). Then you’re mounting the Windows SMB share within ESX.

  7. Austin says:

    This doesn’t work on ESXi 4.1. None of the
    mount, netfs, sftp, winscp, etc…programs are on there. I just need to be able to rsynce the VM directories to a NAS and then again fro mthe NAS offiste to another NAS.

    I’m afraid to start installing stuff on ESXi 4.1. I don’t want to mess it up.

  8. I lately came across your blog and have been learning along. I thought I would leave my first comment. I dont know what to say except that I’ve loved reading. Fine blog. I will keep visiting this blog quite frequently.

Leave a Reply

Your email address will not be published. Required fields are marked *