Thursday, September 1, 2011

Recursively Fixing File Permissions

Ahhh, the joys of restoring/moving files from a FAT32 external hard disk to a *nix system. Everything is 777, grrrrr. The all-knowing Google kindly directed me to try the following:
$ find . -type f -print0 | xargs -0 chmod 644
to chmod all files to 644, and
$ find . -type d -print0 | xargs -0 chmod 755
to chmod all directories to 755. Ahhh, the joys of bash commands.

Mounting USB Devices in VirtualBox

Mounting USB devices on guest systems in VirtualBox seems to be a big headache for many people (yours truly included). But I think I’d finally figured it out.

It boils down to these two most crucial points for me:
  1. Use the same usernames on your host and guest systems.
  2. Create an empty USB filter for your guest system. This will automatically mount any devices to the guest system as soon as they are attached physically.

Use the same usernames on your host and guest systems.

  • When installing your guest systems, create users with the same login name you’re already using on your host system.
  • To make things easier, choose a username without space characters.

Create an empty USB filter for your guest system.

  • With the guest system off, open the Settings of your guest system.
  • Open the Ports → USB pane.
  • Make sure you have enabled USB 2.0 (EHCI) controller.
  • Click the icon with a blue circle on the right. This will add an empty device filter that matches anything.


Now try starting your guest system, log in with the same user name as the one currently active on your host system, and attach a USB device. Hopefully things will… work!