Link to home
Start Free TrialLog in
Avatar of Illyankesh
IllyankeshFlag for United States of America

asked on

Ubuntu cannot write to windows shared folder

The last couple of questions have been dealing with ubuntu being a client hosted on a windows server 2012 hyperVisor, and having a shared folder that both can access.  Hypervisor does not have this utility standard so shenanigans must ensue.  I have successfully created a shared folder on the windows server, and a user to match.  That users credentials are then used in a /etc/fstab to automount the share at bootup. Both operations work.  I can create files that the other device, can see and vice versa.  The windows user the one whose very credentials are being used to login to the share have Read&Write priviledges.

Here is the rub, I have an application that runs in the ubuntu, that needs to be able to write to the mounted share.  I get nothing but problems.  If the share is mounted then I cannot chown, when the share is unmounted I can change ownership of the directory,but as soon as I mount the share I cannot write to the share from linux side.  And the ubuntu side is the one that needs to be able to read/write to the shared folder that sits on the windows server.  

In short, I have an application that needs Read/Write access/privledges to the windows share.
How do I make this happen?
SOLUTION
Avatar of DrDamnit
DrDamnit
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
... And which Linux app needs to wrote to this share? What user does the Linux app run as?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Illyankesh

ASKER

sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh stop 15 0 6 .
sudo nano /etc/fstab

//10.1.10.29/locationofmount /var/data/resin/content cifs credentials=/home/cloud/.smbcredentials,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=ntlm 0 0

The above is what ended up having to happen in order to auto mount the share.  There are some additional steps.
A user has to be created in the windows host, that has at the very least ownership of the folder to be shared.  I ended up creating an admin user, creating a password, then making a shared folder on the C: drive that is then owned by the newly created user.  Read/Write etc.

The only thing that i less than awesome is that you have to edit fstab which as we know if we screw up can make the image not bootable, and then we have to revert to previous snapshot.

The above line is what I ended up using in order to get the share to automount on boot.  The additional commands are needed to change the order of boot/shutdown so that your share unmounts, and does not cause the rest of the system to hang.