2

I have a Debian Squeeze guest system running on a Windows 7 Professional host, a notebook computer. As a web developer, I need to mount my Windows project root folder into the Debian system.

VirtualBox offers a shared folders function, however it does not recognize windows-style symlinks ("junctions"). So I decided to run a Samba client in my Debian system and mount the project folders from the virtual network (NAT). I do that by using this command in /etc/rc.local:

mount -t cifs //192.168.178.62/Projekte/workspace /media/smb_workspace -o "user=Bill,password=XXXXXXX,domain=LOCALDOMAINNAME",uid=33,gid=33,ex$

This works fine, but as the name of the host machine couldn't be resolved, I had to use it's IP address. When I'm in a different WIFI, the IP address changes and I have to change the mounting command. Obviously I'd prefer to enter the name of my Windows machine, like that:

mount -t cifs //NOTEBOOKNAME/Projekte/workspace /media/smb_workspace -o "user=Bill,password=XXXXXXX,domain=LOCALDOMAINNAME",uid=33,gid=33,ex$

I tried switching off my Windows firewall and the antivirus software, to no avail.

The samba packages I installed on Debian are those, and apart from entering the workgroup information I left the configuration unchanged:

  • libwbclient0 Samba winbind client library
  • samba SMB/CIFS file, print, and login server for Unix
  • samba-common common files used by both the Samba server and client
  • samba-common-bin common files used by both the Samba server and client

So how can I get this to work? Any suggestions?

2

The name of a Windows system is typically what's called a netbios name. A Samba server can help facilitate these through one of it's 2 daemons, nmbd. The other daemon, smbd is the one that does the file sharing.

When you're accessing these systems from Linux you often times can't use these netbios names, you have to use the DNS name of this system.

So if you want to give the allusion that all the names are synchronized, you'll need your DNS server names and netbios names to all be in sync. If you're using DHCP to hand out IP addresses, the DHCP server can also participate in facilitating the synchronization of at least the DNS & IP addresses.

  • Thanks, simply installing nmbd was enough. After a reboot, my rc.local worked fine. – Mateng Jul 16 '13 at 14:15
  • @Mateng - awesome. Great that solved the issue. – slm Jul 16 '13 at 14:16
  • Funny enough, it stopped working again. When executing /etc/rc.local, I get: "mount error: could not resolve address for NOTEBOOKNAME: Name or service not known" ... as if the demon is not running. – Mateng Sep 18 '13 at 9:05
  • @Mateng - what do you mean you executed /etc/rc.local? That's not really a script, it's a configuration file used by the system during boot. If the service has stopped working, try restarting it. service restart samba or service restart smbd or service restart nmbd. – slm Sep 18 '13 at 11:41
  • Thanks, I thought it's possible to execute rc.local and mount devices at runtime. However, rebooting doesn't mount the folder either. So I'm back at the IP address solution. I might look into this in detail at another time. – Mateng Sep 19 '13 at 9:51

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.