I've got several partitions on my HDD, one of which I intend to use as a shared home partition between a native Linux installation (yet to come) and a one in a VirtualBox which I recently installed. I managed to tell VirtualBox to present that partition as a virtual disk1. Luckily, Linux has no trouble creating a file system on an unpartitioned block device.
I want to be able to run VirtualBox as a normal user. Since that partition will essentially contain the whole directory of a single user, it is all right to grant that single user on OS X write permissions on that partition. I did so using
sudo chown username /dev/disk0s4.
But now comes the problem: this change of ownership is not persistent. After rebooting my system, I can no longer run the virtual machine. So I need some way to make that change permanent, e.g. by executing the above
chown automatically every time the system starts. How do I do that? And is there a better solution? I know that on recent Linux distributions the clean solution would be writing an udev rule to set ownership for that device node. Is there some similar mechanism on OS X?
VBoxManage internalcommands createrawvmdk -filename LinuxHome.vmdk -rawdisk /dev/disk0s4 in case you are interested in that aspect.