Skip to content

Install Cloud Based Drives

We are about to install cloud based drives on a Ubuntu 64bit server in a container which as no graphics.

LXC Cloud Container

Create Container

Install a new container using lxc-create named cloud.

lxc-create -n cloud -t download
The -t download option allows choosing the latest images for the container. Here I've chosen the latest Ubuntu LTS version.

Once created make it auto start by adding the following to configuration file /var/lib/lxc/cloud/.

# Added to make this container auto start after 20 seconds.
lxc.start.auto = 1
lxc.start.delay = 20
Next command wil start the container.
lxc-start -n cloud
Go into the container console as root.
lxc-attach -n cloud

Container Preparation

For installing the cloud drive software some tools are needed since the container is empty by default.

apt install joe mc less man

Install the locale for your country which could be needed.

locale-gen nl_NL.UTF-8

Set the correct global timezone. Find a timezone using command timedatectl list-timezones.

timedatectl set-timezone 'Europe/Amsterdam'

Delete default ubuntu user.

userdel -r ubuntu

Add user with a name of your own choosing using adduser which is the interactive way of creating a user using a skeleton.

adduser yourname

Add the new user to the sudo group.

usermod -G sudo yourname

Using su to act as the newly create user.

su - yourname
Now follow the section you want.

DropBox

Installation

Next will download and install the 64bit application in directory .dropbox-dist in the home directory.

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
Run the daemon and follow the link to connect this DropBox instance to your account.

~/.dropbox-dist/dropboxd

The given link must be copied in a browser where the DropBox site will deal with it.
A regular account only allows 3 devices to be connected so maybe you need to disconnect one to make room for this one.

When connected the daemon start syncing the file in the cloud to this device in directory ~/DropBox.

Background Running

To run the daemon at startup is done using the next command which opens a file to the crontab entries.

crontab -e 

Enter the following line in the editor which has opened at the bottom.

# Start DropBox monitoring in the background.
@reboot ~/.dropbox-dist/dropboxd

Now at boot the daemon is started but when it crashes it is not restarted at only a service or runit service will auto start it.

OneDrive (Microsoft)

This one is easy because there is e

Installation

Install package onedrive from the standard Ubuntu repository.

sudo apt install onedrive curl 

Curl is needed because that the time of writing the package seems to miss a dependency.

Run the onedrive command and follow copy the link/URL in a browser.

Background Running

To run the daemon at startup is done using the next command which opens a file to the crontab entries.

crontab -e 
Enter the following line in the editor which has opened at the bottom.

# Start OneDrive monitoring in the background.
@reboot onedrive --monitor --monitor-interval 5

GoogleDrive

For this I use Grive2 which source is located on GitHub.
To not have to compile this our self a PPA ppa:nilarimogard/webupd8 in installed with a precompiled package is available.
For this we need application add-apt-repository to add PPA's located in the package software-properties-common.

Installation

Install package containing command add-apt-repository.

apt install software-properties-common

Install grive using apt.

apt install grive

Create directory.

mkdir ~/GoogleDrive 

Run grive in the created directory to get authentication token.

cd ~/GoogleDrive && grive -a

Does not seem to work any more since Google is not allowing this app. Notification "Sign in with Google temporarily disabled for this app"
"This app has not been verified yet by Google in order to use Google Sign In."

Background Running

Under development...