mount google drive inside Linux LXC container with samba shares

The requirement we had was to have a google drive accessible inside a samba share on our SME Server (from koozali.org). The google drive client for linux does not work properly in Centos 7 so here we mount it on the Rocky Linux 8 host to then give access to the LXC SME server container.

get the grive linux client

wget -O drive https://drive.google.com/uc?id=0B3X9GlR6EmbnMHBMVWtKaEZXdDg
mv drive /usr/local/sbin
chmod +X /usr/local/sbin/drive

make a mount point on the host and also bind mount it to the guest container

In our case below the ibay is called "data" and we made a subfolder inside there called gdrive so that all users of this share can also see the google drive and read/write to it.

mkdir ~/gdrivefs
drive (will give you a URL for an auth code)
gdfstool auth -a /var/cache/gdfs/credcache "YOURAUTHCODE"
gdfs -o allow_other /var/cache/gdfs/credcache ~/gdrivefs
mount --bind /root/gdrivefs /var/lib/libvirt/lxc/sme/rootfs/home/e-smith/files/ibays/data/files/gdrive

It's necessary to restart the guest LXC container since bind mounts are applied on boot. If your container is already running restart it after the bind mount on the host.

automate auth code on boot

will later add instructions to automount this on boot (including auth)

IT Support Contracts

Support contracts to cover all your IT and Telecoms with UK wide free call-out. Our friendly support staff provide on-site, telephone, email and remote support for workstations, servers and phone systems. We offer full Linux support as well as Apple and Microsoft.

 

Linux Business Servers

Linux servers to suit every requirement from drop-in Microsoft replacements to advanced firewalls, high availability, thin client servers and virtualisation. Our SME Business Server product provides your business with an IT solution taking care of networking, security, storage, email, backup, remote access and much more.

 

Distro Support Includes

  • Elastix / Issabel / FreePBX
  • RedHat / CentOS / Scientific
  • Koozali / smeserver / SUSE
  • Solaris / Unux / BSD
  • Debian / Ubuntu / Linux Mint
  • Arch / Archbang / Gentoo
  • Fedora / Kubuntu / Xubuntu
  • Raspbian¬†/ Embedded Systems

Ubuntu Server & Desktop

Pre-configured Ubuntu server, desktop and thin client systems to suit your requirements. We offer drop-in Microsoft Server replacements and even migrate your existing Microsoft server or desktops and keep the applications you need.