# Share CD-ROM drive with windows machines



## DLichti (Dec 29, 2010)

Hi all,

I would like to share a CD drive on a FreeBSD machine. Everything has to be preconfigured on the server machine so that people can simply insert their CD into the drive and access it from their windows machine, prefferably without having to install additional software on the windows machines.

I tried an approach with Samba using preexec and postexec settings in smb.conf:


```
[...]
[cdrom]
path = cdrom
read only = yes
root preexec = /sbin/mount /cdrom
root postexec = /sbin/umount /cdrom
```

This is somehow working for mounting the contents of the cd, but it is not unmounting it and thus not releasing the CD.
When I manually unmount it, I have to restart samba before it remounts it automaitcally.

Another approach was using the auto mounter daemon amd. This is propperly working for mounting and unmounting. But it still seems to screw up my samba because, when I try to acces the share with windows explorer after amd unmounted the cd, I just get an empty folder and amd is not remounting. (amd is still working when I go to the path where it mounts the cd)

I know that there is a NFS approach to this problem, but as far as I know, Windows does not handle NFS.

Would be great if could help.

David


----------

