How to Auto-Mount Box.net to Linux Desktop

If you are one of the lucky few, you might have already received the 50GB storage upgrade to your Box (previously known as Box.net) account by installing its Android app. The next question is, what should you do with the extra storage space? The most logical solution is to install its sync software on your computer so you can sync files from your desktop and on every computer/OS you use, much like the Dropbox way. The only problem is, such sync software doesn’t exist.

Unlike Dropbox, Box doesn’t come with any sync software for the personal account. If you upgrade your account to the Business and Enterprise editions, you can download the sync software for Mac and Windows. So if you are using Linux, you are almost out of luck.

Luckily, Box does support WebDav. This means that you still can connect to it from your Linux desktop, though the solution is not as elegant as the Dropbox sync.

Here is how you can connect to Box from Linux.

Note: This tutorial is based on Ubuntu, Gnome Shell and Nautilus.

1. Open Nautilus. Go to “File -> Connect to Server”.

2. Under the Type dropdown, select the option “Secure WebDav (HTTPS)”. Next, enter the URL “www.box.com/dav” in the server field (do not put https:// in front of the URL).

3. Enter your Box username and password.

box-connect-to-server-from-nautilus

4. Press “Connect”. You should be connected to your Box account now.

When you use the above method, you will find that the connection does not persist. You will have to connect to the Box server every time you login. Here is one method where you can auto-mount your Box account. We will be using davfs. Here is what you need to do:

1. Open a terminal and install davfs:

2. Add your Linux user account to the davfs2 group. Replace “your-username” with your Linux login username

3. Create a folder in your Home directory to mount your Box account. In addition, also create the .davfs folder to hold your configuration files.

4. Next, copy the davfs configuration file over and add the “user_lock” command to it:

5. Open a text editor and paste the following, replacing “Box_username” and “Box_password with your Box account login username and password (make sure the quotes around the Box_password remain).

Save the file as “secrets” (without the quotes and without any extension) in the .davfs2 folder.

Back to the terminal, change the permission of the secrets file so it can only be read/write by you.

6. Next, open the davfs2.conf file (in the .davfs2 folder) with a text editor. Scroll down the list until you find the entry (at around line 24):

Insert a “#” so it becomes:

Next, scroll down further until you find the entry (at around line 35):

Remove the “#” so it becomes:

Save and close the file.

7. Now, we are going to add a new entry to your /etc/fstab file:

Add the following line to the end of the file (paste using the shortcut key “Ctrl + Shift + v”). Replace “your-username” with your Linux login username.

Save (using “Ctrl + o”) and exit (using “Ctrl + x”). Open Nautilus. You should see a Box entry at the filesystem column (the entry appears, but it is unmounted at the moment, so you won’t be able to access it)

box-entry-showup-in-nautilus

8. To test if the mounting works, type in the terminal:

If everything goes fine, your Box account should be mounted and show up in your Nautilus. If not, check your Box username and password in the “secrets” file.

Update: Some of you might see the user permission error when mounting it. If so, change the davfs2 user permission:

Thanks to StoyanDeckoff for the tips.

9. Lastly, open up your Startup Applications and add a new item with the command:

box-mount-on-startup

That’s it. Your Box account should be mounted whenever you login to your desktop.

34 comments

  1.  Thanks for pointing out the mistake. I have corrected it.

    I am running Nautilus 3.2.1 and I have no problem with the password field. What is the distro that you are running?

    • Crud! I’m running 11.04

      Maybe (maybe), I’ll stick with 12.04, but Mark and I don’t see eye to eye with the direction ‘buntu is headed. Might be the right time to strap on my pack, and try out new scenery.

      Linux is the heart, everything else is a fork.

      P.S. Fix the title.

  2. Shouldn’t the line: 

    echo “use_locks    0” > ~/.davfs2/davfs2.conf

    be:

    echo “use_locks 0” >> ~/.davfs2/davfs2.conf

    • This one should be fixed, too.
      ~/.davfs2/davfs2.conf line24 should be commented out I had to run
      sudo chmod u+s /sbin/mount.davfs
      cos I got some complaints bout permissions when mounting as user.Would be fine to edit with corrections, for some less advanced usersThank you for my new 50GB external(carries itself) hard-drive:)

  3. Got this from another source and it worked for me –
    Issue I encountered: I got this error when I tried to mount. “/sbin/mount.davfs:
    program is not setuid root”

    Solution: Just before Step-8 above,
    Run “dpkg-reconfigure davfs2” (with out the enclosing double-quotes) according to
    /usr/share/doc/davfs2/README.Debian.

    Appreciate the author for putting all these steps.

    Thanks

    VC Sekhar Parepalli

  4. This tutorial is perfect. It’s working fine in my Ubuntu 12.04. Thank you very much!

  5. Guys, I tried with the configuration but I receivd this error message:

    Error Http Error Not foun

    I am using RH 6.3

    • Did you make sure that your server detail and login credential are entered correctly? It seems that the HTTP error is because the system can’t find the server.

  6. Thank you for this tutorial! dav access is quite sufficient for my needs! And once mouted with davfs it will look, and act, like Dropbox does.

  7. Thanks for putting all of this together!

    I’m getting this error message when trying to do mount ~/Box:

    /sbin/mount.davfs: user [my-linux-username] must be member of group davfs2

    What did I do wrong?

  8. likely a noob question, but should the startup applications command be “mount ~box” or “mount/home/chad/box”

    • The “~” is an alias for your home folder. In most case, it will work.
      However, I have seen in some situation where the alias is not set. In this
      case, you will have to use the full path “/home/chad/box”. Hope this helps.

  9. This isn’t working for me – Mint 13

    mount ~/Box gives me authentication request (I’m assuming here for some reason its not using ‘secrets’)

    I’ve tried various variants of stuff (an hours worth basically!) I can mount it if I enter the credentials :/

    Thoughts?

  10. Ahhh ignore me….. somehow I’d put box.net in secrets…. Thanks to the man page for mount.davfs I spotted my error duh!

  11. Thanks for taking the time to make this tutorial. Unfortunately, WebDAV is nothing like the Box sync app, which is now available for the free personal accounts (they’re in the process of rolling it out, so some users may not have it available just yet, but will soon).

    • WebDav is just the temporary solution while the Box sync app is not
      available. I will be keen to see how well it will work in Linux.

  12. Permission denied while copying a file into mounted Box. What could be the problem? Which permissions should I change?

    By the way, thanks a lot for the post.

  13. It works on xubuntu 12.04.2; but, I get the following warning.

    mount ~/Box
    WARNING: gnome-keyring:: couldn’t connect to: /tmp/keyring-own0au/pkcs11: No such file or directory

  14. Found the solution to the xubuntu 12.04 problem

    mount ~/Box

    WARNING: gnome-keyring:: couldn’t connect
    to: /tmp/keyring-own0au/pkcs11: No such file or directory

    Edit /etc/xdg/autostart/gnome-keyring-pkcs11.desktop
    Change:
    OnlyShowIn=GNOME;Unity;
    To:
    OnlyShowIn=GNOME;Unity;XFCE;

    Then reboot

Comments are closed.

Sponsored Stories