/sbin/mount.vboxsf: mounting failed with the error: Protocol error
Turns out, I forgot to share a folder via the VirtualBox UI, but that possibility didn’t even occur to me until much later. So, as short as this blog post is, I’m sure someone else using VirtualBox will run into this, and before you dive into all kinds of solutions, double check that first ;).
I recently had to download and install the Cisco AnyConnect Secure Mobility client to connect to a VPN, however I was getting an error that seemed to indicate that the download was corrupted:
After a bit of trial an error, it turns out that the installation was being blocked by my OS X. What you need to do is temporarily change the “Allow apps downloaded from” option to “Anywhere.” You can do this under System Preferences > Security & Privacy:
After the installation, be sure to change the setting back.
If you have a virtual private server (VPS) and are getting errors like “system running out of memory,” you may want to double check whether you’re using a swap volume or file.
Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. (source)
I use Git as a version control and deployment system. When a website gets pushed to a server, all files get pulled into the web root (i.e. htdocs) by a user named git executing git pull in the post-receive hook.
By default, all files and folders git creates have 664 and 775 permissions, respectively, and are owned by that user. 664 translates to the user and group being able to read and write, and everyone else only being able to read, and 775 translates to the user and group being able to read, write and execute, and everyone else only being able to read and execute. (That’s a mouthful!)
-rw-rw-r--1gitgit30 Aug 1523:04 test-file.txt
drwxrwxr-x 1gitgit102 Aug 1523:04 test-directory
-rw-rw-r-- 1 git git 30 Aug 15 23:04 test-file.txt
drwxrwxr-x 1 git git 102 Aug 15 23:04 test-directory
Now, in an instance where you need a folder in htdocs writable by another user, like apache, for let’s say a caching system, you need to be able to set those particular permissions accordingly.
To accomplish this, you really only have two options:
Set permissions of files to 666 and folders to 777
Set the owner or group to apache (or a group that apache is a member of)
Personally, I favor restrictive permissions over convenience, so option #1 is out, which means we’re going to take a look at how to implement option #2.