When running cygwin, it has it's internal virtual filesystem mappings which are visible to linux programs (well, ports) running inside cygwin. Accessing the host windows filesystem from within cygwin is easy, but what about the other way around? If I needed to somehow mount the virtual cygwin filesystem as a windows drive or ntfs folder or similar? Are there ready solutions?
Windows – Access cygwin filesystem from host windows
cygwin;filesystemswindows
Related Solutions
I'm not 100% sure but you could use VMware Workstation 5.5 Disk Mount Utility to mount the file and http://www.fs-driver.org/ to access the ext3 filesystem.
Turns out I was simply looking in the wrong place - I had forgotten that the account on the Windows host needed to have correct access permissions set on the shared folder; it only had Read & execute
, Write
and List folder contents
. Doh! Adding Modify
fixed the problem. So nothing but a silly mistake - but I also learned a bit more about the cifs syntax and fstab
and figured out how to mount as a humble user, allowing the mount points to be in my /home/user
folder. The final mount string in my fstab looks like this (my values replaced with [tokens]):
//[server]/[share] /home/[user]/[folder] cifs credentials=/home/[user]/.config/samba/.[server],uid=[user],gid=[group] 0 0
So you only need to set uid
and gid
to the user and group that you want to own the files on the share after mounting - no need for anything else. I also put the Windows user credentials needed in a separate file under my .config dir and did chmod 400
to stop others from reading it.
It took a surprisingly long time to figure all this out as there are a million arguments to use with cifs, and many seem to have misunderstood them - so many people recommend using file_mode
/dir_mode
777 (which sounds like a really bad idea to me), and pepper with unnecessary arguments like nounix
, noperm
, rw
, iocharset
and noacl
- none of which are needed to make this work. So while my problem was caused by a simple mistake I'll leave the question (and this answer) here; hopefully someone will find it helpful!
Edit: Due to a bug in Samba's cifs implementation it is necessary to add the nobrl
option as well if you intend to run SQLite databases on the share. Basically, the current Samba cifs Linux client cannot handle the way SQLite locks the database file. Not a great solution, and almost certainly a bad idea in a multi user environment but since in my case it's a single user share, and hosted on the same machine as the client (which should all but eliminate network latency), I'm gonna roll with it.
nobrl
Do not send byte range lock requests to the server. This is necessary for certain applications that break with cifs style mandatory byte range locks (and most cifs servers do not yet support requesting advisory byte range locks).
The fstab entry now looks like this:
//[server]/[share] /home/[user]/[folder] cifs nobrl,credentials=/home/[user]/.config/samba/.[server],uid=[user],gid=[group] 0 0
Best Answer
Use
cygpath -w cygwin-pathname
to convert from a Cygwin path to a regular Windows path. For example,cygpath -w /cygdrive/c/Users
will printC:\Users
.