Install Dropbox In An Almost Text-Based Linux Environment

Note, there exists an experimental process to follow if you need a completely text-based install, follow it here: TipsAndTricks/TextBasedLinuxInstall.

This will be a guide to install Dropbox on a headless or remote terminal, presumably only accessible through SSH. A short GUI is needed to be run through to perform this process, as you probably would have seen installing it in a normal environment.

General Requirements

  • A Ubuntu/Debian or Fedora/Red Hat based operating system
  • Python version at least 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
  • SSH or direct access to terminal
  • Open ports for VNC to access the GUI when needed
  • Access to the internet
  • General knowledge of how to use a text-based linux operating system

Ubuntu

In a text-based environment the plugin for Nautilus will not work, simply due to Nautilus not running (Unless you're doing something funky, in which case you probably don't need this guide). This leaves all the legwork to the Dropbox daemon, the proprietary and non-open source component of Dropbox. Fortunately for us, Filip L. has created a brilliant Python script to download, install and control the daemon, available from this forum post. Included in this guide is instructions to get a super-light X.org installation running to run through the linking process. This can be removed later.

Head to the following forum post and download the Python script. I downloaded this to my home folder, I suggest you do the same.

Alternatively, here is the link straight to Filip L.'s script on his Dropbox:

For obvious reasons, Python will need to be installed. The installation of Python is outside the scope of this guide, there are plenty of instructions and tutorials around the net.

If its not already, mark the file as executable

sudo chmod 755 dbcli.py

Run the script to ensure everything is all OK

./dbcli.py

It should output something similar to the following:

Usage: ./dbcli.py <command> [options] ... <command> [options]
Available commands:
   status - Get overall status for the daemon.
   copypublic <file> - Copies the url to the clipboard (? I guess)
   install <x86/x86_64> - Tries to download the daemon and install it in your home directory.
   browse <folder> - Browse the specified folder in your browser.
   copygallery - Copies the gallery url to the clipboard.
   share <file> - Open the browser and shows share-information.
   file <file> - Get information about a file/folder.
   folder <folder> - Get information about a file/folder.
   help - Gives this.
   revisions <file> - Opens the revisions page in your browser for the specified file.

If you encounter any problems, or the output is nothing like above, you have an issue which needs to be sorted out on an individual basis. Do a search on the forums for your error, otherwise start a new thread.

From here, we need to run the 'install' feature of Filip L.'s script depending on your architecture. If you're not sure what architecture you're running, you should be safe with the standard x86 build.

./dbcli.py install x86

If you do want the 64 bit build, change the 'x86' to 'x86_64', which is explained in the standard help output of the script.

This will now download and attempt to install the Dropbox daemon.

Finally, it gets to the point where it attempts to start the daemon. In my case, it came up with a GTK library error, however it may be different in your case (See the Issues section below for more information). Either way, we'll need to use a GUI to get any further, so for the meantime, forget about the errors and go ahead and do the following.

Install X.org

You don't need anything fancy like Gnome or KDE to get past the GUI section, you simply need an interface. The following command installs the base X.org system, with dependancies. I don't have much experience with the individual packages, and there are a lot here. So if any are not needed (hell maybe all of them) feel free to amend this command.

sudo apt-get install appres beforelight bitmap editres fstobdf iceauth ico libdmx1 libfontenc1 libfs6 libxaw7 libxdamage1 libxfont1 libxkbfile1 libxmuu1 libxss1 libxtrap6 libxtst6 libxv1 libxxf86dga1 libxxf86misc1 listres mcpp menu mesa-utils oclock sessreg smproxy twm viewres x11perf xauth xbase-clients xbiff xbitmaps xcalc xclipboard xclock xconsole xcursorgen xditview xdpyinfo xdriinfo xev xeyes xf86dga xfd xfonts-100dpi xfonts-75dpi xfonts-base xfonts-encodings xfonts-scalable xfonts-utils xfontsel xgamma xgc xhost xinit xkbutils xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xman xmessage xmodmap xmore xorg xpmutils xprop xrandr xrdb xrefresh xrgb xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-input-elographics xserver-xorg-input-evdev xserver-xorg-input-kbd xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-apm xserver-xorg-video-ark xserver-xorg-video-ati xserver-xorg-video-chips xserver-xorg-video-cirrus xserver-xorg-video-cyrix xserver-xorg-video-dummy xserver-xorg-video-fbdev xserver-xorg-video-glint xserver-xorg-video-i128 xserver-xorg-video-i740 xserver-xorg-video-i810 xserver-xorg-video-imstt xserver-xorg-video-mga xserver-xorg-video-neomagic xserver-xorg-video-newport xserver-xorg-video-nsc xserver-xorg-video-nv xserver-xorg-video-rendition xserver-xorg-video-s3 xserver-xorg-video-s3virge xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sis xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-tga xserver-xorg-video-trident xserver-xorg-video-tseng xserver-xorg-video-v4l xserver-xorg-video-vesa xserver-xorg-video-vga xserver-xorg-video-via xserver-xorg-video-vmware xserver-xorg-video-voodoo xset xsetmode xsetpointer xsetroot xsm xstdcmap xterm xtrap xutils xutils-dev xvidtune xvinfo xwd xwininfo xwud

That will go ahead and download and install the packages, it may seem like a lot of packages, but in my case it only took about 15 minutes. Press enter to accept the default resolutions when the X.org configuration starts.

Then use Apt to install x11vnc

sudo apt-get install x11vnc

You should now be able to start a X server instance by running the command

startx &

The ampersand after the command is to allow you to use the terminal after X has completed loading. All going to plan, that should start running with no issues. If you have any problems, see the Issues section at the bottom of this document.

Now run x11vnc

x11vnc -display :0

This will warn you that it is running without a password or authentication when you run it, disregard this. You will presumably only have the x11vnc server running for the short time the installer is running, then it will be removed.

If the x11vnc server launches correctly, it will finish outputting text and the last line will contain the port number needed to connect to. Go ahead and connect to this, be through tunneled SSH or through an open port with a VNC Viewer of choice. Personally I prefer the solution from RealVNC, available from their website http://realvnc.com, however there are open source alternatives such as TightVNC http://www.tightvnc.com/.

This should now show you a blank desktop, with a terminal (xterm). Ubuntu users will recognise this environment if they have used the 'Failsafe' boot option.

In the terminal, run this command:

./dbcli.py status

If everything is working, this will bring up the Dropbox installation GUI. If you have any problems with windows not being visible, install the Tabbed Window Manager, sudo apt-get install twm & twm.

Run through the familiar login and linking process.

When done, finish the installation whichever way you like, viewing the tutorial or not.

Finally, check the status of the Dropbox daemon again, to ensure it is syncing;

./dbcli.py status

Again, any problems, search the forums and post if nothing you find helps.

I found in my case, I had to have a fresh SSH login before the daemon would stick running, otherwise it would quit when the SSH session ended.

Congratulations, Dropbox should be running.

Check on your Account on the website to ensure it has been linked correctly.

Now we can go ahead and remove the X.org installation and x11vnc

Simply run:

sudo apt-get remove appres beforelight bitmap editres fstobdf iceauth ico libdmx1 libfontenc1 libfs6 libxaw7 libxdamage1 libxfont1 libxkbfile1 libxmuu1 libxss1 libxtrap6 libxtst6 libxv1 libxxf86dga1 libxxf86misc1 listres mcpp menu mesa-utils oclock sessreg smproxy twm viewres x11perf xauth xbase-clients xbiff xbitmaps xcalc xclipboard xclock xconsole xcursorgen xditview xdpyinfo xdriinfo xev xeyes xf86dga xfd xfonts-100dpi xfonts-75dpi xfonts-base xfonts-encodings xfonts-scalable xfonts-utils xfontsel xgamma xgc xhost xinit xkbutils xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xman xmessage xmodmap xmore xorg xpmutils xprop xrandr xrdb xrefresh xrgb xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-input-elographics xserver-xorg-input-evdev xserver-xorg-input-kbd xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-apm xserver-xorg-video-ark xserver-xorg-video-ati xserver-xorg-video-chips xserver-xorg-video-cirrus xserver-xorg-video-cyrix xserver-xorg-video-dummy xserver-xorg-video-fbdev xserver-xorg-video-glint xserver-xorg-video-i128 xserver-xorg-video-i740 xserver-xorg-video-i810 xserver-xorg-video-imstt xserver-xorg-video-mga xserver-xorg-video-neomagic xserver-xorg-video-newport xserver-xorg-video-nsc xserver-xorg-video-nv xserver-xorg-video-rendition xserver-xorg-video-s3 xserver-xorg-video-s3virge xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sis xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-tga xserver-xorg-video-trident xserver-xorg-video-tseng xserver-xorg-video-v4l xserver-xorg-video-vesa xserver-xorg-video-vga xserver-xorg-video-via xserver-xorg-video-vmware xserver-xorg-video-voodoo xset xsetmode xsetpointer xsetroot xsm xstdcmap xterm xtrap xutils xutils-dev xvidtune xvinfo xwd xwininfo xwud x11vnc
sudo apt-get autoclean

Create or copy a file to test the new Dropbox

You should be good to go!

From there there are limitless uses for the new use for your box.

Fedora Core 9

A Fedora user will need to fill out this section.

Debian

It is most likely that this will rarely differ from the Ubuntu process.

Issues

X.org

If you experience any problems loading X.org, you may want to redirect the output to a file, which you can then copy and paste to a new post on the forums, to do this run:

startx > xorg.log

That will store the output in xorg.log in the current directory

GTK Libraries

Dropbox only looks for the GTK library stubs, and thus these can be generated with a DropboxAddons/PythonScriptToMakeStubGUILibrariesForLinuxDropbox.

Otherwise, you can always install them properly.

Run:

sudo apt-get install libatk1.0-0 libatk1.0-dev libcairo2 libcairo2-dev libdatrie0 libglib2.0-dev libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgtk2.0-dev libpango1.0-0 libpango1.0-common libpango1.0-dev libthai-data libthai0

These can be removed later;

sudo apt-get remove libatk1.0-0 libatk1.0-dev libcairo2 libcairo2-dev libdatrie0 libglib2.0-dev libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libgtk2.0-dev libpango1.0-0 libpango1.0-common libpango1.0-dev libthai-data libthai0

If you continue to have GTK errors when starting the Dropbox daemon, leave the packages installed.

VNC

If the x11vnc server fails to start, it may mean its having problems connecting to the X.org display. I found the solution to be deleting the .Xauthority file in your user directory. This file is hidden due to the period in front of its name, so may not normally be visible. Restarting X will regenerate this file, to do so, run this:

sudo pkill xorg
startx &

TipsAndTricks/AlmostText-BasedLinuxInstall (last edited 2009-03-23 07:04:54 by TrevorB)