I realise this is an old thread but I have just managed to get this working after none of the other tutorials seemed to work so thought I would share it - this works in Ubuntu 19.04 (just released last month) and can even mount Box if you have Two Factor Authentication turned on (which is advisable):
If davfs2 is not installed then install it (if already installed then this command will do nothing):
sudo apt-get install davfs2
The next command is optional but stops connections to Box freezing whilst davfs2 attempts to place locks on files being opened:
sudo nano /etc/davfs2/davfs2.conf
Find Use_locks
and set it to 0
Next to enable non-root users to connect to the Box share run sudo dpkg-reconfigure davfs2
and select Yes
when prompted to enable this.
Now make a folder where your Box files will appear:
sudo mkdir /box
Next add an entry into fstab to tell the system how to mount the Box network drive (e.g. as read/write):
sudo nano /etc/fstab
Add this to the bottom:
https://dav.box.com/dav /box davfs rw,user,noauto 0 0
Now you can mount it using mount /box
You will be prompted for your username and password after which cd /box
should display the contents of your Box account.
If you set up 2 factor authentication then the login will fail but you will receive a text with a 16 character password to enter so run mount /box
again and this time enter the 16 character password ignoring any spaces.
Lastly if you want the drive to auto-map when you reboot you need to store the long password in the secrets file.
First make the folder in case it doesn't exist and then go to the folder and create/edit a secrets file:
sudo mkdir ~/.davfs2/
cd ~/.davfs2/
sudo nano secrets
The contents of this file should be (replacing the email and password with your email and password, (or the 16 character password from the text if using two factor authentication):
https://dav.box.com/dav [email protected] PASSWORD
Now ensure the secrets file remains secure so others cannot open it:
sudo chmod 600 secrets
Typing df
should show all drives including the Box account.
You can now use your Box storage like any other folder. It may be a lot cheaper (or free) compared with purchasing block storage from a cloud provider and can be an excellent way to store server backup files remotely.
If you only want to mount the drive as a one-off you can skip everything from the fstab part (but after creating the /box folder) and instead just run mount.davfs https://dav.box.com/dav /box