Refer to pages 37-42 of the
User Manual (it's in
/opt/VirtualBox/UserManual.pdf).
You install
VirtualBox as root, you install one or more virtual machines as "you." The installer checks for the group
vboxusers and, if it does not exist, the installer creates it but you must add your username to the group manually (you only do this once, installing an updated version of
VirtualBox will not overwrite the group entry).
You install virtual machines as "you," not as root. By default, virtual machines are added in your home directory tree. You can create a partition on your hard drive or on a separate disk drive and install your virtual machines there.
For example, I have a partition
/var/lib/virtual where virtual machines live. I only have one install at this time and it's Win7. The tree looks like this:
Code:
tree /var/lib/virtual
/var/lib/virtual
HardDisks
Machines
Win7
Logs
VBox.log
VBox.log.1
VBox.log.2
VBox.log.3
Win7.vbox
Win7.vbox-prev
Win7.vdi
lost+found
The mount point,
virtual, has this permission mask
Code:
drwxrwxr-x 5 root vboxusers 4096 Mar 14 2011 virtual/
That is,
Code:
chmod 775 /var/lib/virtual
so I can read and write to it.
The content of
/var/lib/virtual looks like
Code:
ls -al /var/lib/virtual
total 32
drwxrwxr-x 5 root vboxusers 4096 Mar 14 2011 ./
drwxr-xr-x 36 root root 4096 May 1 04:40 ../
drwxr-xr-x 2 trona users 4096 Mar 8 2014 HardDisks/
drwxr-xr-x 3 trona users 4096 Mar 8 2014 Machines/
drwx------ 2 root vboxusers 16384 Mar 13 2011 lost+found/
Note that the directory
HardDisks is no longer used by VirtualBox and, because it's a partition, there is a
lost+found directory (you won't have
lost+found in your home directory). I just leave the directory there, there's nothing in it
Now, I own all the directories and files in the
Machines directory and the group is
users. That's normal. What gives me permission to write is the parent directory,
/var/lib/virtual which is owned by
root, group
vboxusers and the mode
775. That's automatically done by
VirtualBox when, as you, you create a virtual machine. Keep in mind that this tree is on a separate partition, not in my home directory. Look at the tree that was created in your home directory and see what it looks like, particularly what the root directory of the virtual machine looks like (it'll be in your home and its group should be
vboxusers). That's not your home directory, it's the directory
VirtualBox created when you added a virtual machine in your home directory (and I don't remember what it's named, you'll need to look, it might be a dot-directory). I haven't ever created a virtual machine in my home directory, so I'm at a loss here about the tree structure when you do that.
Be sure to take a little time and scan through the User Manual.
Hope this helps some.