I'm running Windows 10 on a PC which can see a Centos 7 server on the network. That server is hosting several VMs running Centos 7 on a different sub-net (i.e. 192.168.122.xxx). The Centos Host and the Windows PC are running on 192.168.0.xxx.

The virtualisation is done with Virtual Machine Manager (libvert) and the VMs can see the Centos Host and the Internet.

My question is around getting the Centos Host to forward the SMB ports successfully so the PC can connect to the VMs Samba share via it. I basically want to map a drive letter in Windows 10 to a folder in the VMs.

Samba is installed and configured on the VM and looks fine. I don't think Windows is getting past the Centos Host and gives an error indicating it cannot connect to the target on the port for "file and print sharing resource".

I've tried:

  • Disabling SELinux on the Centos Host and VM.
  • Configuring firewalld on the Centos Host to accept ports 137,138,139,445.
  • Adding port-forwarding to the firewalld config on the Centos Host for those ports.

Windows client can only access the standard Samba ports (139 and 445), so you can't map to folders in multiple VMs because you can't use custom ports. Hence, I would suggest you use NFS to share a folder (or folders) from each VM into the host, and then share the folder that houses those NFS maps to your external Windows client.

You might also find a script I wrote few years ago useful, as it ensures the NFS maps are established and maintained in an environment where the systems have dependencies of each other (e.g. a virtualized environment). You can find it on Github at github.com/vwal/nfs_automount.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.