Linux: Mount Box.net Account Locally

Cloud storage nowadays has create a trend on storing and accessing data from any where around the world. 2 most popular cloud storage providers are Dropbox and Box.net. In this post, I am going to show you on how to mount Box.net account inside the Linux box. You are required to have a Box.net account, which is free if you register for personal plan and it comes with 5 GB online storage space.

We will use davfs2 to mount Box.net account via WebDAV. Dropbox do not offer this feature at the moment. Variable that I used as follows:

OS: CentOS 6.2 64bit
Box.net username: [email protected]
Box.net password: MyGu1234
Mount point: /mnt/box/

1. To use the simplest way on installation, we will use RPMforge repository:

$ cd /usr/local/src
$ rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
$ wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
$ rpm -K rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

2. Once done, lets install davfs2 via yum:

$ yum install -y davfs2

3. Create the mount point:

$ mkdir /mnt/box

4. Add following line to /etc/fstab:

https://www.box.com/dav    /mnt/box    davfs    rw,user,noauto 0 0

5. Add Box.net account information into /etc/davfs2/secrets using text editor:

https://www.box.com/dav  [email protected]  MyGu1234

Notes: If you use special characters in your password use a forward slash in front of the special character (thanks to Keith for this highlight)

6. Change the lock mechanism of mounted filesystem. Open /etc/davfs2/davfs2.conf and find following value:

#use_locks    1

And change to:

use_locks     0

7. Mount the partition:

$ mount /mnt/box

Done! Now you can start to sync your files to your cloud storage by copying the files into /mnt/box directory. Login into Box.net account and verify that the files should be existed. Depending on the file size, you might need to wait for a while after copying process complete before it appears in the Box.net account.

Following screenshot is the Box.net account. I just sync my public_html backup files to the cloud storage.

Happy ‘clouding’. Cheers!

21 thoughts on “Linux: Mount Box.net Account Locally

  1. Hi,

    Thanks for this guide. Have you checked disk space usage with “df” utility, for some reason it shows incorrect value on my machine. I have free account with Box so it supposed to be 5GB:

    # df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda1 5.7G 2.2G 3.5G 39% /
    none 836M 0 836M 0% /dev/shm
    https://www.box.com/dav 26G 13G 13G 50% /box

    Regards

    Reply

    1. FYI, I am also facing the same result. Here is df -h from my server:

      Filesystem Size Used Avail Use% Mounted on
      tmpfs 1004M 0 1004M 0% /dev/shm
      /dev/sda1 485M 43M 417M 10% /boot
      https://www.box.com/dav 26G 13G 13G 50% /box

      It seems like Box.net has allocated some space for davfs to be shared among webdav users. And we are actually mounting the same shared space, but using different identity. In cloud storage, the file location is not really matters compare to permission and ownership.

      Reply

        1. You are able to mount it right? I dont think there is a fix for that yet

          Reply

          1. Yes, it works like a charm. Except that I can only upload 13G…I have the 50G Box.net Account and need the Space to save my Pictures :/

            Any ideas if it could work with sshfs or other methods?

          2. I never experienced mounting 50GB account into the server. It might have some limitation on Personal plan, which we cant use other method to directly map the Box account into server. If Business or Enterprise plan, it provides FTP alternative and this can be done via ftpfs. Never try this method though.

  2. On the mount, I get “Could not authenticate to server: rejected Basic challenge”.

    Any suggestions? Thanks

    Reply

    1. Try to mount without the last trailing slash. Example: instead of /mnt/box/, try use /mnt/box

      Reply

      1. I’m sorry, I get this error too. Did you resolve this? I tried with and without the trailing /

        I get the following error:
        /sbin/mount.davfs:/home/abc/.davfs2/davfs2.conf:24: system option in user configuration file
        /sbin/mount.davfs: Mounting failed.
        Could not authenticate to server: rejected Basic challenge

        Reply

  3. OK. I solved this (for me). My workplace uses single sign on (SSO) to log into box. I had to enable the external password option (in Box) for this to work.

    Thanks for the post!

    Reply

  4. People having:
    “Could not authenticate to server: rejected Basic challenge”.
    The username (email address) is case sensitive !!
    Login to box.net and check the case.
    Took me a couple of hours to figure this out.
    A good way to test is to open https://www.box.net/dav and see if your username/pwd is accepted.

    Reply

  5. /sbin/mount.davfs: Mounting failed.
    Could not authenticate to server: rejected Basic challenge

    If you use special characters in your password use a forward slash in front of the special character

    Reply

    1. Placing a password in quotes will also solve this problem.

      Reply

  6. I’ve had issues with it auto-mounting after a reboot. CentOS 6.3. Works just fine when I call the mount /mnt/box from shell, but after a reboot I have to manually login to do that again 🙁

    Any ideas?

    Using my Box.net as a off-site backup for my server and loving it!

    Reply

  7. Doesn’t work.

    I’m getting a slew of errors.

    /sbin/mount.davfs: can’t open fuse device
    /sbin/mount.davfs: trying coda kernel file system
    /sbin/mount.davfs: no free coda device to mount

    Reply

    1. It seems like you need to install Fuse kernel module. Try installing them by using following command:

      $ yum install fuse fuse-ntfs-3g dkms dkms-fuse

      Reply

      1. Did that already, doesn’t work. Those errors are persistent.

        Reply

  8. Does not work for me either (trying to make this work on CentOS7):

    /sbin/mount.davfs: can’t open fuse device
    /sbin/mount.davfs: trying coda kernel file system
    /sbin/mount.davfs: no free coda device to mount

    If anyone else has seen this error, and made it work in the end, please post a followup message…

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *