2

I'm trying to mount google drive to paperspace notebook using google-drive-ocamlfuse with the following code

sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt update && sudo apt install google-drive-ocamlfuse

but when launching with

google-drive-ocamlfuse

there's an error:

/bin/sh: 1: firefox: not found
/bin/sh: 1: google-chrome: not found
/bin/sh: 1: chromium-browser: not found
/bin/sh: 1: open: not found
Cannot retrieve auth tokens.
Failure("Error opening URL:https://accounts.google.com/o/oauth2/auth?client_id=..........

ocamlfuse's github page has instructions on "Headless Usage & Authorization" but it's for local machine not for something like paperspace. is there any way i can use google-drive-ocamlfuse to mount the drive?

is there any other better/simpler method to mount google drive on paperspace gradient?

ethan
  • 31
  • 3

1 Answers1

0

Short answer:
There is no way to mount Google Drive as filesystem on paperspace gradient.

Long answer:
Your error message says cannot open browser. You are correct, should use headless mode [https://github.com/astrada/google-drive-ocamlfuse/wiki/Headless-Usage-&-Authorization]. Basically create an OAuth App, note down the client-id and client-secret, then authenticate using google-drive-ocamlfuse -headless -id client-id -secret client-secret.

But even if the authentication step success, you will still encounter error like fuse: device not found, try 'modprobe fuse' first. It is because Paperspace gradient notebook is running as container. A container cannot perform fuse operation unless it has SYS_ADMIN capability. (See FUSE inside Docker). In this case, we have no control on how paperspace running their container. So we are unable to mount filesystem on paperspace gradient.

However, you can use something like https://github.com/iterative/PyDrive2 to access Google Drive file.