Opened 18 years ago
Last modified 13 years ago
#302 new defect
wrong path for settings under mac os x
Reported by: | wolfie | Owned by: | |
---|---|---|---|
Component: | GUI | Version: | |
Keywords: | macbeta settings location place | Cc: | |
Guest type: | other | Host type: | Mac OS X |
Description
First of all thank you for porting it to mac os x! It really rocks with WXP and Ubuntu!
But I've noticed that the wrong path has been taken for the settings. It currently uses ~/Library/VirtualBox. This is neither the right place from Apples point of view. Nor would users look in there for their data.
VirtualBox should use instead ~/Library/Application Support/VirtualBox.
:-)
Change History (20)
comment:1 by , 18 years ago
follow-up: 3 comment:2 by , 18 years ago
Actually, you are not right.
http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/index.html
states about ~/Library/Application Support:
"Contains application-specific data and support files such as third-party plug-ins, helper applications, templates, and extra resources that are used by the application but not required for it to operate. This directory should never contain any kind of user data. By convention, all of these items should be put in a subdirectory named after the application. For example, third-party resources for the application MyApp would go in Application Support/MyApp/. Note that required resources should go inside the application bundle itself."
As we only have settings in ~/Library/VirtualBox, the application support directory clearly isn't the right place.
What we should really do is put our global per-user preferences to ~/Library/Preferences/VirtualBox.xml and then have the individual VM settings reside in ~/Documents/Virtual Machines/<vmname> as bundles (the "Virtual Machines" part is inspired by VMware Fusion). However, this will require some enhancements to the VirtualBox core which we are currently working on (portable VMs, import/export).
follow-up: 8 comment:3 by , 18 years ago
There is a official statement from Apple under http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/Articles/LibraryDirectory.html#//apple_ref/doc/uid/20002282-BAJHCHJI
It states that the directory "Application Support" withing the user's library is the appropriate place for "third party" data and support files. The statement seems to be a little confusing.
"Application Support contains application-specific data and support files such as third-party plug-ins, helper applications, templates, and extra resources that are used by the application but not required for it to operate. This directory should never contain any kind of user data." That means the data should not go into this directory *directly*. "By convention, all of these items should be put in a subdirectory named after the application. For example, third-party resources for the application MyApp would go in Application Support/MyApp/." That is what they all do (except Parallels), have a look at the appended files for that.
"Note that required resources should go inside the application bundle itself." That means put data in here, but no program files. Program files go to /Applications/My.app/Contents/.....
Please don't look at the parallels guys! They messed it up.
My Library Folder:
Application Support
Assistants
Audio
Autosave Information
Caches
ColorPickers
Contextual Menu Items
Cookies
Documentation
Favorites
FontCollections
Fonts
Icons
InputManagers
Internet Plug-Ins
Keyboard Layouts
Keychains
Logs
PreferencePanes
Preferences
Printers
Recent Servers
Safari
Saved Searches
Screen Savers
Scripts
Sounds
Syndication
Widgets
Workflows
iMovie
iTunes
My Library/Application Support Folder:
AddressBook
BitRocket
Books
Changes Meter
Chess
DVD Player
Deskspace
Download Wizard
ElectricSheep
Firefox
Growl
Little Snitch
Opera
Path Finder
Poisoned
Punakea
Roxio
Smultron
SyncServices
Terminal
Transmission
Vienna
aMule
iCal
iDVD
iTerm
comment:4 by , 18 years ago
Your posting just confirms what I just mentioned.
~/Library/Application Support is *not* for settings/preferences/user data. It is definitely not the right directory.
Given that currently, the VirtualBox configuration and the individual VM settings belong together, ~/Library/VirtualBox is the best place.
In the future, there will be ~/Library/Preferences/VirtualBox.xml and each VM will be represented by ~/Documents/<vmname>. It will take some time though as it requires some more fundamental changes in VirtualBox.
comment:5 by , 18 years ago
Stop. Lean back. Stay calm. You stated that you do not have much experience with Macs. Thats why I take the time now to explain Apples statements to you, because I am a actual Mac user.
The answer to our problem is easier than you might think. No rewrite of anything. No mess up with the user space. You can leave everything in *one* directory. Simply move the VirtualBox folder to ~/Library/Application Support/VirtualBox. Trust me :-)
If you don't want to trust, but want to know, read ahead.
Have you seen my directories? (I appended them to my last post.) Do you think any directory of any other long time Mac user would look differently? Don't orientate at multi platform programs like VMware. Their programmers didn't know the Mac as well. Look at real Mac programs instead. They store their binaries and libraries in their Application Bundles (within /Applications) and their data into Application Support/MyApp. :-)
comment:6 by , 18 years ago
Reading the Apple documentation clearly shows that Application Support is not the right directory. So we are not going to put configuration data there. Just read the documentation, you will see that you are not right.
Initially, we just checked what other apps do but for every possible mistake, there is at least one popular app that serves as a bad example. So we looked it up in the documentation and it's quite clear there.
comment:7 by , 18 years ago
I didn't want to point out errors our faults. I wanted to help you to make the best VM on earth :-) It was just a hint from me.
Obviously the docs are not as clear as they could. The passage you quoted from the docs is easy to missunderstand. I tried to explain it to you above.
Please read that again.
If you feel anger about the thread, please state yourself Conflict of Interest and hand over the thread to one of your colleages.
comment:8 by , 18 years ago
I wanted to point you to the article "Where to Put Application Files" as well: http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html#//apple_ref/doc/uid/TP40001411-111946
comment:9 by , 18 years ago
OK, I did some research.
Apple indeed is a bit confusing in their documentation.
But this is a annoying topic since people are usally often frustrated about a folder mess on their systems. Have a look on this to get an impression: http://blogs.msdn.com/oldnewthing/archive/2006/12/28/1374334.aspx
A good point to ask about the folders is the very polite and helpful Apple Forum "Software Development 101" for new-to-Mac-Developers: http://discussions.apple.com/forum.jspa?forumID=728
What I did is ask our question there. Read on yourself http://discussions.apple.com/thread.jspa?threadID=937562
Convinced? Leave everything as it is, but put the folder into /Application Support :-)
comment:10 by , 18 years ago
If this is the case, you should ask Apple to correct their documentation. As of now, the official documentation clearly states that configuration settings should not go to "Application Support", only things like plugins and optional modules should go there. A lot of applications (from Apple and third parties) do it that way.
We cannot change the location and then have other people complain that it's wrong citing the Apple documentation. So the current location is the best place until we implement a new split configuration model. This is the opinion of everyone here that is involved in this project.
PS: Note that we are pretty much the only application putting our kernel extension to /Library/Extensions instead of /System/Library/Extensions as recommended by Apple. So we try to be good citizens and respect the system standards.
comment:11 by , 18 years ago
wolfie: sorry, but if I understood your exchange with Apple (or whoever it was) correctly, they are saying that the configuration data should go into ~/Library/Preferences. I assume that extends to configuration data in XML.
comment:12 by , 18 years ago
Michael,
that is both reality and conform to the guidelines. I checked my Preferences Folder, it consists mostly of XML files with the extension ".plist". All programs store their preferences here into one plist file for every application. Not only Firefox, Opera, amule, bitrocket, but even Parallels have a .plist here. One might say this is a (much easier to maintain) counterpart of the "Registry".
I guess that Apple's XCode provides easy means to maintain such a ".plist." But, to be honest, no user would really care about an application having *no* .plist file in here. Instead people are over and over again upset about applications storing files where they don't belong.
comment:13 by , 18 years ago
Our interpretation is that ~/Library/Preferences is intended for .plist files which are managed by the corresponding Carbon API. Our preferences/settings are not in .plist format due to our cross platform nature. Therefore we decided to not make use of the Preferences directory.
comment:14 by , 18 years ago
That is no bad decision. Personally, I would find it too complicated to maintain an extra plist for Mac OS X.
comment:15 by , 17 years ago
Maybe this warrants a separate ticket, but currently user data is also stored in ~/Library/VirtualBox. In particular, the new virtual disk wizard defaults to this directory, and snapshots are also stored in this directory. According to Apple: Important: You should not store user data files in the Library directory or any of its subdirectories. If your application stores the user’s data automatically—that is, without prompting the user for a location—you should choose a more appropriate location (usually the Documents directory) inside the user’s home directory. For the list of user directories, see “The User Domain.” (From here.)
I think the snapshots should, by default, be stored together with the virtual disks in ~/Documents/VirtualBox.
comment:16 by , 17 years ago
Host type: | other → Mac OS X |
---|
comment:17 by , 17 years ago
Component: | other → GUI |
---|
comment:18 by , 16 years ago
being a longtime apple developer i'd like to point out the following:
General Configuration:
~/Library/Preferences/com.sun.virtualbox.plist
Virtual Machines and virtual machine specific config:
~/Library/Application Support/VirtualBox/
other resources (which only change, when you release a new version of virtualbox):
Virtualbox.app/Resources/ (inside the app bundle)
comment:19 by , 15 years ago
I was just wondering if there has been any movement on this issue. I think that it would be a huge improvement to move the VirtualBox directory into ~/Library/Application Support. My understanding of the file structure, as derived from Apple's Developer Guidelines and years of using the platform, is that only Apple should be creating directories in ~/Library/, with all application-specific files residing in Application Support/ and Preferences/.
As circumstantial evidence, the only applications that I currently have installed that put themselves directly in Library/ are those that were ported from Unix--all native OS X applications that I have on my system use Application Support/ and Preferences/.
comment:20 by , 13 years ago
I would like to add that the default directory for new installs is now ~/VirtualBox which then includes all the virtual machines. I noted this in #9814, but it was closed as a duplicate.
I would like to add to this discussion that it's really annoying if applications hijack my user managed folder hierarchy (be it ~ or ~/Documents) to put stuff in their that I'm not supposed to touch.
If I'm not supposed to touch it, put it in ~/Library, to spare me the annoyance of having to look at it all day and being remembered that 'yes I shouldn't touch it', but I still have to scroll over it and navigate to it by accident and remember that I have to exclude it from my backups etc...)
You're probably right (remember, we're new to the Mac). However, I noticed that a lot of other applications put their user-specific settings just below ~/Library/ like we do (and that includes Parallels Desktop).
Is there some clear statement from Apple that this is not the right place? If so, we will change it.