[HowTo] Integrate Box.com to Linux

The other day pavloco showed us how better integrate Dropbox into Xfce, and although I am not someone fanatic of the "clouds"(especially for my internet connection ...), I remembered that I had earned some nice 50GB en Box.com for using a Android-LG 🙂 I started to investigate a little how better integrate Box on Linux, and now I come to teach those who are interested.

I must clarify first, that we will not be able to compete side by side with the powerful integration having Dropbox on Linux, since in the case of dropbox is a native client (or a daemon, I'm not sure), but for Box we will use some tricks that will allow us to use basic functionsas upload / download and review files personal use only.

Ok, let's begin. The first thing we need, in install davfs2 package in our distribution, since it is the part fundamental of everything.

En Debian we would run thisas root of course):

apt-get install davfs2

For Arch would:

pacman -S davfs2

En Fedora...

yum install davfs2

Among others ... The next thing to do, will be create folder where we will ride our account, to access it. For example, I created one in my home, called «Box" (without quotation marks). Now we must edit the / etc / fstab file, adding the following line:

https://www.box.com/dav /home/usuario/Box davfs rw,user,noauto 0 0

Changing "user" by your username: the entire route if they created the folder elsewhere. This line only tells the system that mount system DAV de Box.com in the folder we want, and give it permission to any user of open it, and Read and write files therein.

However, it will not be able to mount it if we do not give it our Box username and password 😛 So in our Home we will create a binder call .davfs2 (he "." is to be hidden), which will contain the settings. Then you have to to copy the files "davfs2.conf" Y "secrets" which are in / etc / davfs2 /, and put them in the folder that we just created.

We can do this quickly with these commands:

mkdir ~/.davfs2/

sudo cp /etc/davfs2/davfs2.conf /home/usuario/.davfs2/

sudo cp /etc/davfs2/secrets /home/usuario/.davfs2/

sudo chown -R usuario /home/usuario/.davfs2/           ## Cambien "usuario" por su nombre de usuario

We proceed to open both files with our favorite text editor. In "davfs2.conf»We look for the line«#use_locks 1»And we uncomment it (we withdraw the #), and we make sure the number next to it is «0«. That is, it would look like this:

use_locks 0

Now we will edit the file "secrets«, And we will add the following line at the end:

https://dav.box.com/dav user@email.com password

Sure, put your email and password 😛 It would only remain to test if it is mounted, so we will open a terminal and write in it:

mount /ruta/a/la/carpeta/

If it does not give any problem, then we will be ready 🙂 To test it you could copy a lightweight file (1MB or less?) to the folder where they mounted Box.

In case they show up errors, we will solve them in their respective way:

  1. /sbin/mount.davfs: Program is NOT setuid root. This is solved with the command: sudo chmod u+s /sbin/mount.davfs
  2. /sbin/mount.davfs: user must be member of group davfs2. It is fixed by adding our user to the davfs2 group, we execute: sudo gpasswd -a usuario davfs2, where "user" is your username.
  3. /sbin/mount.davfs: / is the home directory of user kernoops. It is arranged like this: sudo echo "ignore_home kernoops" >> /etc/davfs2/davfs2.conf

Those are the possible mistakes. If it gives you any other error, do not forget to put it in the comments 🙂

Custom action for Thunar

Taking advantage that I was in Xfce, it occurred to me to test if with custom commands could upload any folder to Box from Thunar. And yes what it works. Although don't show A progress bar to know how much is missing, if it generates notifications to notify that you have already uploaded the selected files.

Upload to Box

Box notification

To use it, we will open Thunar, and we will go to Edit> Configure custom actions. We click on Add (the + symbol) and fill the spaces in this way:

Eyelash "Basic«:

Name: Upload file (s) to Box
Description: Upload selected files to Box.com
Command: notify-send "Uploading to Box" "Uploading% F to your Box account ..." && cp -r% F ~ / Box / && notify-send "Done" "The files have already been uploaded to your account by Box "

Basic

Eyelash "Appearance conditions«: Check all the boxes.

Appearance conditions

We save and that's it, we can quickly upload files to Box 🙂

Synchronize folders manually

This is something we can do with the command Rsync, however some of us prefer to do this from a comfortable interface, so we will install Unison, frontend for rsync.

It will be a matter of to install the packages unison y unison-gtk. In Debian it would be like this:

apt-get install unison unison-gtk

Then, we proceed to look for it in the menu (Category Accessories) and open it. A window will pop up to configure a «profile«. Unison uses profiles for each binder what you want synchronize.

So, we will create one. In "profile name" Y "Description»We can place whatever we want. In type of synchronization, we will leave it in «Location«. Then it's our turn choose two folders, the one in Box and the one that we are going to synchronize.

Unison

Once you are ready, simply we open the profile y Unison will compare the two folders. Then we just have to click on «Go»And will start synchronize.

Note: Yes we erase something in a folder, by default Unison you'll want to delete it on the other. To change it we just do click on the file and then we press «right to left»Or«left to right»Depending on where the original file is.

While it is possible to perform automatic synchronization with Unison o RSync, it is somewhat difficult to achieve a result optimum for everyone.

Well that's it. They are somewhat limited options, but if we want something better we would have to directly use the Box API, since there is no native client for Linux (and if there were, it would be paid, like the one for Mac and Windows).

What do you think? Do you use any other cloud like Dropbox, Wuala, SpiderOak, etc.? They don't like much the clouds? Opinion 🙂


41 comments, leave yours

Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Tavo said

    All your contributions are always excellent. Thank you very much for sharing and I join the criticism on your desk, it looks very good

    1.    auroszx said

      Thanks to you too for reading 😉 I have an article or two planned, I will try to post them soon.

  2.   Leper_Ivan said

    This really is an input .. I just did the "basic" part and the file sharing is great .. Thanks so much for sharing!

    1.    auroszx said

      You're welcome 🙂 Believe me that if I knew how to use the API I would try to do something better ...

  3.   rots87 said

    excellent now to start using it ... I just hope the Dolphin customization in KDE comes out (I don't know if it will be necessary ... when I leave work I try it uu

  4.   jamin samuel said

    Your desk is very nice 😉

    1.    auroszx said

      Thanks

  5.   pavloco said

    Hey, the Dropbox article was made by me 🙁 hahaha
    Good post I wonder if I can install it despite having Dropbox installed.

    1.    auroszx said

      Oops! My apologies ... is that as elav usually / used to be so attached to Xfce I got confused. I will change it shortly.

      1.    pavloco said

        Hahaha no problem, don't worry. Excellent your post.

        1.    auroszx said

          Ready, and yes, you can have Dropbox and Box at the same time 😉

  6.   befa said

    excellent contribution for those of us who love xfce !!!!

  7.   someone said

    Hello, great tutorial.
    I don't know if you can help me, everything works perfectly except that it does not mount automatically, but I have to do it manually.
    It seems that it does not read the username and password and because when I mount it "by hand" it asks for them and it is assembled perfectly.
    Thank you very much and greetings.

    1.    Ariel said

      Hello, the same thing happens to me.
      Could you fix it?
      Thank you.

  8.   matiasd said

    Great contribution I was looking for a way to be able to do this type of integration, but I got the following error /sbin/mount.davfs:/home/matias/.davfs2/davfs2.conf:24: system option in user configuration file, which it does not allow me to mount the folder

    regards

  9.   Germaine said

    I did everything as is but using:
    mount / home / my-user / Box /
    It gives me the following:
    /sbin/mount.davfs: Mounting failed.
    302 Found

    How is it corrected?

  10.   double said

    it gives me the same error
    /sbin/mount.davfs: Mounting failed.
    302 Found

  11.   double said

    the same thing for me

    /sbin/mount.davfs: Mounting failed.
    302 Found

  12.   Mauricio said

    It throws me the same error:

    /sbin/mount.davfs: Mounting failed.
    302 Found

    1.    saymel said

      Replace "www.box.com/dav" with "dav.box.com/dav" and you're done!

      1.    jsbsan said

        @Saymel:
        Thank you very much !!!
        regards

  13.   George said

    When trying to mount the Box folder I get an error /sbin/mount.davfs: Mounting failed.
    302 Found

  14.   luigi said

    I think it is necessary to review and update this POST, I hope to get an answer .. now that I have my 50gb from box.com, and that, in addition, we will run out of ubuntu one, I need to link my box with my ubuntu14.04LTS I have tried the procedure twice and it hasn't worked for me, I've even gotten into other problems like losing my root password (and having to reinstall) and its privileges.
    Please update this post because maybe two years later there are already more graphic resources for INTEGRATION OF box.com TO Ubuntu 14.04

  15.   AI said

    It gives me this error, could you help me *
    root @ kali: ~ # mount / root / Desktop / Box
    Please enter the username to authenticate with server
    https://dav.box.com/dav or hit enter for none.
    Username: xxxx-
    Please enter the password to authenticate user xxxx with server
    https://dav.box.com/dav or hit enter for none.
    Password: xxxxxxx
    /sbin/mount.davfs: user davfs2 does not exist

    1.    Javier said

      I strongly recommend that you do not "login" as root to do everything, use sudo or derivatives according to distribution.

      Regarding the error, it tells you that "root" does not belong to the davfs2 group.

      A greeting.

      1.    John Paul Melnik said

        The same thing happens to me. I have not found a solution yet.

  16.   Javier said

    In the / etc / fstab file
    you have to put the address: https://dav.box.com/dav
    since it requires secure connection, otherwise everything is fine. And to add my user to the davfs2 group I used the following:
    sudo usermod -a -G davfs2 YOUR_USER
    The "-a -G" options add YOUR_USER to the davfs2 group list

    Tested on Ubuntu 14.04

    1.    victorx66 said

      Yes, that's how it works thanks!

      1.    victorx66 said

        Pulled at first just a little modification in the / etc / fstab to put this https://dav.box.com/dav .

        Thanks to the author of this website for this extraordinary post
        note: I am using debian wheezy

  17.   Ricky said

    Hello, my problem is this

    "Unable to authenticate to server: Basic challenge rejected"

    And I get a text message to insert a verification code, only there is nowhere to insert that code, you have any idea how to solve that from now on thanks.

    Ricky.

  18.   Jano said

    Hi, thanks for sharing.

    It gives me the following error:
    /sbin/mount.davfs: user must be a member of group davfs2.
    I run the solution you gave, but nevertheless, I still cannot mount it

  19.   Santiago said

    I get the following error when giving the command to mount the Box folder (mount / home / santiago / Box):

    p11-kit: invalid config filename, will be ignored in the future: / etc / pkcs11 / modules / gnome-keyring-module

    The funny thing is that when I run the command, it recognizes the Box folder as a removable disk! which leads me to think that every time I want to use box on my linux, I will have to run that command? or is there a way not to have to do this?

    Thanks for the tutorial, a wonder 😉

    1.    Santiago said

      PS: Also, it won't let me copy any file in the Box folder, with the following error message, already in the Linux interface:

      Error opening file '/home/santiago/Box/_MG_4552.jpg': Permission denied

  20.   adel said

    excellent tutorial, it served me fantastically in Ubuntu 15.10

  21.   Ismael said

    Thank you very much, all correct in Debian 8.

  22.   Salvador said

    Excellent! Thanks a lot.

  23.   Javier said

    cannot find / in / etc / fstab
    how can i correct this please
    I use LMDE Mate
    I can't find the solution
    thanks in advance

  24.   Javier said

    it gives me this error
    cannot find / in / etc / fstab or / etc / mtab
    it can be fixed ?
    use LMDE Mate

  25.   adrian said

    I get this message: Using external SSO login.
    /sbin/mount.davfs: the server certificate does not match the server name
    issuer: GeoTrust Inc., US
    subject: Box, Inc., Los Altos, California, US
    identity: * .box.com

    You should only accept this certificate, if you can
    verify the fingerprint! The server might be faked
    or there might be a man-in-the-middle-attack.
    Accept certificate for this session? [y, N]

  26.   adrian said

    Accept certificate for this session? [y, N] y
    /sbin/mount.davfs: Mounting failed.
    302 Found

    accept or cancel skips the same failure.

  27.   jordany said

    according to Box releases, it is possible that the implementation of https://dav.box.com/dav

    At this date, December 31, I could no longer connect the synchronization and it presented me with the following error

    /sbin/mount.davfs: Mounting failed.
    405 Method Not Allowed