BackgroundAfter a recent HDD crash I did a clean install of Linux Mint 15 on a new disk. Seeing the potential problems with having backups of my documents and eclipse workspace, I realized that a smarter backup solution would be to take the entire home folder. Thus I partitioned my new HDD with /, /home, and /opt as separate partitions. My intention with this scheme was to use / for the system, /home for documents etc that will be backed up, and /opt for stuff that are sort of self-contained and do not require a backup, such as Virtual Windows installations that sometimes need. Questions:I noticed today when I was setting up the VM that it uses a folder in /home to store the vdi files, by default. When I changed the location of that folder to /opt I came to realize and remember that /opt has 755 permissions. Does it make sense to put a folder e.g. /opt/vm and try to put the vdi files there? I assume that Virtualbox will run with my normal user permissions and thus won't be able to write there anyways. Does giving such a folder 777 permissions solve the problem? My feeling is that the writing bit would be OK, but I am worried that this might cause more trouble later on. If the above scheme is really error-prone, what options do I have? It would be a pity to leave /opt as is (120 GB) only to create another partition. I could,in theory, resize /opt/ and create another partition /vm, right?
Having Virtualbox disk images on /opt
filesystems;permissions;virtualbox
I will try to answer you question one by one:Does it make sense to put a folder e.g. /opt/vm and try to put the vdi  files there? I assume that Virtualbox will run with my normal user  permissions and thus won't be able to write there anyways.I would say it makes more sense to put the virtual machines in your home folder, since the virtual machine is data that is associated with your user, and configure your backup program to exclude that directory. But there is no problem in setting up some other directory, such as /opt/vm and set your user as the owner of that directory. Only thing I can think of if SELinux or something like that would try to interfere, but that seems really unlikely.Does giving such a folder 777 permissions solve the problem? My  feeling is that the writing bit would be OK, but I am worried that  this might cause more trouble later on.A better solution would be to change the owner of that directory:posdef@linux$ sudo mkdir -p /opt/vmposdef@linux$ sudo chown -R posdef:posdef /opt/vmBut /opt is more meant for applications and so on, so I think it would make more sense to create a folder such as /data/vm/ and use that instead. But this is entirely aesthetics.If the above scheme is really error-prone, what options do I have? It  would be a pity to leave /opt as is (120 GB) only to create another  partition. I could,in theory, resize /opt/ and create another  partition /vm, right?There is not any real problem with your setup, more than it might be a bit unusual. I think that a better solution would be to configure your backup program to exclude some folders that you know contain a lot of data. So this seems a bit like a complicated solution to a not that complicated problem. And there is no need to create new partitions, you can just change the mount point of your partition from /opt/vm to something else. /opt is not the partition, it is only the mount point. You can configure this in either /etc/fstab or perhaps in some GUI application (I haven't used mint myself).