Home Site Stocks Machine

Access the host file system with CIFS

The proper way to share folders with the host system is CIFS. Compared with the "Shared Folders" feature from VMware and with the older SMBFS it e.g. enables applications to inform you that the file you are working on has been changed by another application. So you can work better on the same file with the host and the guest in parallel. Not only that the Shared Folders facility from VMware lacks this feature, but accessing files and folders from both sides is deemed to cause instabilities by VMware themselves. Furthermore Player users must access shares with CIFS or SMBFS, because VMware Player can't enable Shared Folders at all.

So far however there seems to be one drawback. The host system needs a static ip address. For stand-alone PCs this is in most cases no problem but if your machine is in a network you'll have to check whether the ip address is automatically assigned by DHCP or if it is static.

How to set up CIFS in the Debian Linux VMware appliance

0) Make sure your VMware installation is ok. For instance I had an "unknown (network) device" in my Windows installation resulting from installing and deinstalling different versions of VMware. Take care to reboot after deinstalling or better after installing, too. That was what I probably missed once. The "unknown device" negated all my attempts to get CIFS working. Another showstopper is a deactivated ethernet connection in your Debian system (check it with Desktop->Administration->Networking)

1) Give the stand-alone Windows host a static ip address or check whether a networked host has a static address or not:

  - log in as Administrator
  - go to:

    control panel->network and communication settings->LAN connection->
      context menu->properties->select Internet protocol (TCP/IP)->click button properties

  - enter (and click ok for the two dialogs):

    IP-Address:  192.168.1.2
    Subnetmask: 255.255.255.0

2) In the Linux guest system edit your /etc/hosts file and tell the system what computer name your Windows machine has. In Windows 2000 you will find this system name under Programs -> Accessories -> System Tools -> System Information or you can run msinfo32.exe. Replace "hostName" with the actual system name of your Windows machine and add this line:

  192.168.1.2   hostName

3) Install these two packages with Synaptic:

  samba
  smbfs

During installation of smbfs you have to expand Details and answer a question for your workgroup with:

  WORKGROUP

Probably it is best to enter the actual domain/workgroup of the host system here. The function of mounting a share from the host seems to be unaffected, but the entry would matter for the access of a share from the guest.

Then you will be prompted to Modify smb.conf to use WINS settings from DHCP. Just go ahead with the default choice.

From here on you will have to do everything as root. The convenient way is to log out of the Linux system and to log in again as root. However, security fanatics don't like doing this. They would start a root terminal etc.

4) Open a terminal and create a directory where the share shall appear on your Linux filesystem

  mkdir /mnt/folderName

5) Edit /etc/fstab and add a single line for the mount. Here "hostName" is the name of the Windows machine, "shareName" is the name of its shared folder and "folderName" is the folder where the contents of the shared Windows folder appears. Of course you could have chosen to make "folderName" the same as "shareName".

//hostName/shareName  /mnt/folderName  cifs exec,credentials=/etc/cifspw 0 0

6) Create a password file /etc/cifspw with the login credentials for your Windows account

username=winUsername
password=winPassword

7) Secure the file:

  chmod 600 /etc/cifspw

8) Mount all mounts mentioned in fstab

  mount -a

If this command hangs, i.e. you don't see the prompt on the next line appearing again within a few seconds, something went wrong. You should close the terminal window and remove the added line in /etc/fstab because at boot mount -a gets called in the /etc/rc.d/rc.local of the Debian VMware Appliance. See 0) for what could be a possible reason.

If the mount command runs correctly and you can see your shares in the file browser afterwards, then the shares should be mounted automatically at the next boot.

If the mount command quits with an error message you should first check if the shares show up in the file browser nonetheless. Otherwise try SMBFS or, if that fails too, you would have to use the Workstation with its Shared Folder feature from VMware.

Note: If you are trying to set up CIFS or SMBFS with another Linux installation than the Debian VMware Appliance you may need the same workaround I did with creating a local boot command file which calls the mount -a command at the end of the boot sequence after the initial mounting of the remote file system failed.





Visoracle

Home ии System ии Machine
 Index