How can I mount my SWITCHdrive folder in a virtual machine?
You can access your data in SWITCHdrive from a virtual machine that you create on the the SWITCHengines infrastructure. The following how-to describes the steps:
Mounting from command line
- Install the WebDAV support using the davfs package. On Debian/Ubuntu, you can use:
sudo apt-get install davfs2
- Reconfigure davfs2 to allow access to normal users (select Yes when prompted):
sudo dpkg-reconfigure davfs2
- Add the users you want to be able to mount the share to the davfs2 group (where <username> of course is the user on your VM (for example ubuntu):
sudo usermod -aG davfs2 <username>
- Edit /etc/fstab and add the following line for each user who wants to mount the folder (with your details where appropriate):
https://drive.switch.ch/remote.php/webdav/ /home/<username>/switchdrive davfs user,rw,noauto 0 0
Then, as each user who wants to mount the folder:
- Create the folders switchdrive/ and .davfs2/ in your home directory
- Create the file secrets inside .davfs2/, fill it with the following (with your credentials where appropriate):
https://drive.switch.ch/remote.php/webdav <username> <password>
- Ensure the file is only writable by you either through the file manager, or via:
chmod 600 ~/.davfs2/secrets
- Run the command:
mount ~/switchdrive
- To automatically mount the folder on login, add the command you used in step 4 to ./.bashrc
Known Issues
Problem: Resource temporarily unavailable
Solution: If you experience trouble when you create a file in the directory, edit /etc/davfs2/davfs2.conf and add:
use_locks 0
Text is taken from the OwnCloud documentation