Category Archives: Software

mount.vboxsf mounting failed with protocol error

I manage several virtual machines via VirtualBox, and one of the first things I do is share a folder between host and guest OS, but when I ran the command this time, I got an error:

/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 ;).

Cisco AnyConnect Secure Mobility: vpn.pkg is damaged and can’t be opened

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:

"" is damaged and can't be opened. You should eject the disk image.

Image 1

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:

Allow apps downloaded from: Anywhere

Image 2

After the installation, be sure to change the setting back.

System running out of memory: create a swap file

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)

Continue reading

Prevent SSH connection from timing out in Terminal

If you’re constantly connected to multiple servers via SSH and perform work on them throughout the day, dealing with timeouts can be cumbersome. Here’s how you can keep the connection alive.

Create a config file in your home’s .ssh directory:

$ vi ~/.ssh/config

Add the following by pressing the letter i, typing in the text below, and pressing ESC followed by :wq:

ServerAliveInterval 60

Every 60 seconds a packet will be sent to keep the connection alive.

Lastly, modify the config file so that it’s read-only to you:

$ chmod 600 ~/.ssh/config

From here on out, no more timeouts.

Managing file and folder permissions when deploying with Git


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-- 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:

  1. Set permissions of files to 666 and folders to 777
  2. 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.

Continue reading