This guide assumes that:
- you already have an instance set up on GCP that you want to mount locally
- the GCP CLI (
gcloud
) is installed on your local machine - you have authenticated locally to your google account
gcloud auth login
- make sure your gcloud config is correct for the instance you're trying to access:
gcloud config configurations list
- make a directory at the location you want to mount the file system, for example:
mkdir mnt/
mkdir mnt/<boxname>
- populate your ~/.ssh/config file with aliases for the instances in your project using
gcloud compute config-ssh
- Download and install sshfs and FuseOSX: https://github.com/osxfuse/osxfuse/wiki/SSHFS#installation
- mount away!
sshfs -o IdentityFile=~/.ssh/google_compute_engine \
<username>@<insance-name>.<region>.<project>:/path/to/location \
<path/to/local/mount/folder>
umount <path/to/local/mount/folder>
Thanks!