Can't add NFS shares


I am running NC 13 on Ubuntu LTS 18.04 as a VM on Hyper-V. I have a drive on the physical box running windows 2016 that has the files I want to make available to the users I give access to NC.

I know there are many posts and articles but I have information overload and cannot get the drive to be seen by NC or seem to get it to set-up in Ubuntu.

I can easily share the folders to other clients on my network but struggling with Ubuntu.

Did you try and ask the hyper-v community how to link a folder from Win 2016 in a Linux machine? Once you managed to do that, you have to set the permissions that the webserver user (in Ubuntu: www-data) can read or read and write this folder.

As tflidd stated, you need to mount the share into your VM first. After that, you need to set the ownership to the www-data user. If I recall correctly you can simply attach the physical disk to your Hyper-V VM. Or you could create a Virtual Disk on that external drive and link it to the VM. It’s your choice.

If you wondered how to set the ownership to www-data, it’s the following command:

sudo chown www-data:www-data -R /path/to/datafolder

This will recursively set the ownership of /path/to/datafolder.

Why not just share the drive from windows and mount it as external storage in Nextcloud?

Simply attached the physical disk to the Hyper-V and now the VM will not start. “An error occurred wile attmepting to start the selected virtualmachine(s).” Server failed to change state


“Why not just share the drive from windows and mount it as external storage in Nextcloud?” That is what I wan t to do but it appears it is not that simple.

OK the VM is back up an running. I have a NFS share but still cannot add the folders to Nextcloud

You can change the default Nextcloud data path in the <path-to-nc>/config/config.php

'datadirectory' => '/mnt/your-nfs-share',

I’m a little confused here by all the answers, maybe I’m missing something? You have a shared folder on a windows file server, and you want that shared folder to show up inside of nextcloud? Do I have that correct?

Yes I have a folder on my Server that currently contains photos. I would like to make this folder available to nextcloud. I was running Tonido but that became unreliable as well as seafile. in the previous mentioned applications I created an account for the friends we travel with to upload and share our photos from or group vacations.

So I have the drives mounted as NFS shares and written test files to the folders from inside Ubuntu. Now I am attempting to add them to NExtcloud as External Local storage but I can’t get them to show up.

There is an error: _“smbclient” is not installed. Mounting of “SMB / CIFS”, “SMB / CIFS using OC login” is not possible. Please ask your system administrator to install it."

Any help. I have asked Uncle Google to no avail.

@claymca Regarding the error:

sudo apt update
sudo apt install smbclient

To install the smbclient. I hope you’ll get further to your goal with that.

So I have made the Drive available to the VM which makes the drive inaccessible to my Windows machines. In the chown command what datafolder am I pointing to?

I have the smbclient installed but the error remains in NextCloud.

That’s weird. I just fixed the error on my side by installing smbclient. Are you running nextcloud in some sort of container? (LXD, Docker, maybe?) Then you would need to install it inside the container, not outside.

But anyway, I think the smbclient is not needed. Try to add a local storage (since you mounted the share already into your filesystem) and use that.

Go to the External Storage admin configuration and add a local path. provide the mountpoint of your share there, for example /mnt/your-share. See if that works. You should at least get read-only access to the files with that method. Maybe you even got the permissions right and you have write access as well.

I meant the data folder, where your images are stored. It’s basically your external drive.

I just realized you just attached the drive to your VM. Great, now you need to mount it either with a sudo mount command or via adding a line to your /etc/fstab file inside your VM.

You have to find out which device is your hard disk. It’s probably the one with the highest letter in /dev, but to be sure, execute sudo lsblk and df -Th to get a view on your attached devices. You should be able to mount your drive with something like sudo mount /dev/sdb1 /mnt/my-share. If it complains that mnt/my-share doesn’t exist, create the folder with mkdir /mnt/my-share.

If that worked, you can add an entry to your /etc/fstab. You’ll find plenty of information about this one on the internet. Just be sure to provide the correct filesystem, which is probably NTFS.

AFTER all that, you can execute the “sudo chown…” from above on the now mounted data in /mnt/your-share to give nextclod access to the drive.

And even AFTER that, you can add the local path to your Nextcloud as my post above suggests.

Thanks for the replies. I moved on as it was a snap version and that appears to not work with SMB. I have moved on o installing attempting to use other tutorials. I will start another thread.

Thanks for the help