Tuesday, May 01, 2007

 

linux / windows communication

to make windows and linux communicate, we use samba.
More precisely, the following steps need to be taken:
1. share a folder on the network (in this example: 'partage')
2. check windows ip address (in this example: 192.168.1.2)

On the linux side, to avoid communication problems due to special characters used in file/folder names, we will use the cifs protocol.
Make sure this module has been compiled, checking the kernel configuration ('make menuconfig' => in Network Filesystems) and if need be, run 'sudo modprobe -i cifs'
To do this, we need to install smbfs package
1. 'sudo apt-get install smbfs'
we will mount the remote (windows) folder to /mnt/windows => we need to create this folder
2. 'sudo mkdir /mnt/windows'
finally we mount the remote folder doing:
3. 'sudo mount -t cifs //192.168.1.2/partage /mnt/windows -o iocharset=UTF8'
(iocharset option is crucial since this option will solve the naming issue with file/folder names. Make its value match the charset used by your linux computer (you can find it with 'dpkg-reconfigure locales')
To permanently mount this shared folder, write it in /etc/fstab

you can now use /mnt/windows as if it were a local folder => 'cp', 'mv'...

-- another way to communicate is to use smbclient, once smbfs and smbclient have been installed --

more details:
man mount.cifs
http://ubuntuforums.org/showthread.php?p=1752485
http://www.die.net/doc/linux/man/man8/mount.cifs.8.html
http://www.debianhelp.org/node/4829

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?