Mounting a Windows share on ESX is very easy with the smbmount command.
Before you start, create a directory where the share should be mounted. For instance, /mnt/tmp. Just issue the command:
mkdir /mnt/tmp
Then, use smbmount as follows (one line):
smbmount //<server>/<share> /mnt/tmp -o username=<domain>\\<user>,password=<password>
where
- <server>: name of the Windows server
- <share>: sharename on the server; you can also use c$, d$, ...
- <domain>: domain of the server or the servername if you use an account local to the server; note the double backslashes behind the domain or server name
- <user>: domain account or server account
- <password>: password of <user>
If you now go to /mnt/tmp, you should see the files that are in the share.
A couple of gotchas here:
- Make sure you allow outgoing SMB connections in the ESX firewall: command to do this is esxcfg-firewall --enableService smbClient
- Make sure that the Windows server does not have SMB signing policies. Even policies that state "if client agrees" should be disabled!
The last gotcha is usually causing the most trouble. When there are signing policies in effect, you will notice that mounting works perfectly. However, when you try to use the mount, you will get the error: stale NFS file handle.
Among other uses, smb mounts are handy to easily restore full vm VCB backups. After you mount the share where the backup files are located, you can use the vcbRestore command to restore the vm to your ESX box.



