Qt Creator 2.7 (Qt 5.1) + Win XP in VM on a Mac via shared folder = bad idea?
-
Hi all, I've started dealing with the Windows specifics in my application. Doing so, I thought it would be a great idea to run Windows XP in a VM (VirtualBox), having the project directory in the host OS (Mac OS) shared in the VM. However, Creator hangs constantly when trying to open the files via the "Issues" output pane. I don't seem to have a problem accessing the files directly from the Windows Explorer. I have full access rights to the project directory according to the VM (and files are being written ok). A restart of Creator usually allows me to continue where I left.
Any ideas about what might be the cause? Is XP just too old to do what I'm doing? Is it a sharing issue?
-
Sounds like an issue with combining shared folders with Qt Creator. What happens if you transfer the files into a "local" folder in your VM, and open them from there?
-
Which Creator hangs, the Guest one or the Host one?
Did you make sure the shared folder is set for read/write permission in VirtualBox? And also, did you set the shared folder on your Mac to be free-for-all (rwx permissions to all users) ?
The failing of any of these might cause the Guest OS to be unable to access the shared folder contents.
Another thing I'm experiencing with VMs is that when I use the shared folder on the Guest OS I am unable to use it from the Host OS because VB would put an access lock on it (although I am on Windows Host with Linux guest).A bad idea? maybe.. maybe not... since Qt is a cross-platform toolkit changes in your code might require minimal intervention. But you might also need to modify entire parts of the project in order to make it perfectly Windows compliant (you might even need to use Windows specific features). This could lead you to modify the project in a way it works fine on Windows but breaks on OS X. Make sure you know what you're doing and in case of huge changes make a windows only source code file separated from the original one. When you're sure the project works fine you might merge the code from the files. I know it's a bit of an anti-cross-platform approach, but you may prefer working safely rather than working twice because of a little "puff" mistake.
-
It's the guest Creator that hangs.
Yes, all permissions are good as far as I can see. I have theory that it might also be related to the pro.user file.
Having my project checked out from SVN on the guest Windows, everything runs much smoother, so it's definitely a sharing issue somehow. I'll just keep it like that for now.
It would sort of be nice if one could try out changes on one platform and see if it breaks on the other(s) within seconds, ie. without committing/updating your code from VC (as would be the case with file sharing). On the other hand compilation is probably faster on the file system native to whatever Qt Creator you are using.
I'll see how it goes with this setup; other inputs are of course welcome.
-
In a few days I'll be installing a Linux distro on a Virtual Machine where I'll setup a Qt environment with QtCreator and a shared folder with my host OS. I'll let you know if I will be successfully sharing a project between host and guest QtCreator and any issues I may encounter, and hopefully, you might get a better understanding on how to make this setup.
-
bq. I have theory that it might also be related to the pro.user file.
99% that is the problem.
Close QtCreator, rename pro.user to pro.user_mac_os .
Open QtCreator from XP (from "open project" menu, not "recent projects"), it will generate another pro.user. After you finish work in XP, close creator and rename the file to pro.user_xp.
When you want to work from MAC OS, rename pro.user_mac_os to pro.user and so on. -
I think Marian is right, I was thinking about this possible issue too since QtCreator will store full paths in the .pro.user files. If it was storing relative paths it could have been (probably) easier to reuse that path in both OSs.
The solution though might be simple: maintain two project (.pro) files, one for OS X and one for Windows, both in the same project directory. If you name them MyProject_OS_X.pro and MyProject_WIN.pro, QtCreator will create two different .user files MyProject_OS_X.pro.user and MyProject_WIN.pro.user. This will end your renaming hassle suggested by Marian above since you would only need to update your .pro files from time to time in case you changed something.If you try it, let me know if it works as I am interested in this cross-platform approach too :)
-
[quote author="MarianMMX" date="1384202958"]Close QtCreator, rename pro.user to pro.user_mac_os .
Open QtCreator from XP (from "open project" menu, not "recent projects"), it will generate another pro.user. After you finish work in XP, close creator and rename the file to pro.user_xp.
When you want to work from MAC OS, rename pro.user_mac_os to pro.user and so on.[/quote]Good catch; I had forgotten about the .pro.user file!See Tobias Hunger's post at http://qt-project.org/forums/viewthread/31873 (it's the last post) -- I haven't done it myself, but apparently the QTC_EXTENSION environment variable can be used to change the default config filename, so you can have different .pro.user files on different machines. No need to rename them each time you switch.
Of course, make sure you're not accessing the files from both your host and guest machine simultaneously.
-
As promised, I tested a VM shared environment.
On my Guest OS (Ubuntu 13.10) the project opened normally, it asked for a build path, and that's all. Anything worked just fine.
I could even work with my host (Windows 7) QtCreator at the same time with the guest QtCreator - when I opened my Win7 QtCreator it found the original .user file was not created by that instance of QtCtreator, and asked me if I still wanted to use the settings in that .user file; I pressed NO, it created another .user file called project.pro.user.c916002.2.7pre1 and from that moment I could build the guest and host projects without any issues with both QtCreators running fine (and, at the same time!). There were no hangs of QtCreator and no errors.. nothing wrong.At this point I guess that the OS X version of QtCreator might not be optimized for such changes so you should really try the .user.shared solution above which might solve your issues.
-
Thanks for sharing your findings, T3STY