Use one Virtual PC 6 disk image on a multi-user machine

May 07, '03 10:46:00AM

Contributed by: ssevenup

The following constitutes about two days research and testing... In case anyone didn't know, Virtual PC (VPC) has never supported multi-user operation under OS X. What this means is that every user needs their own "virtual machine" disk image. These can be on the order of 2gb - 3gb minimum for a Win2k system. This is the advice direct from Connectix tech support. This was totally unacceptable for our needs, so I set about finding a solution. The following is not for the faint hearted Admin who lives in the GUI. Roll up your sleeves and let's dig in...

After searching the Connectix support forums I found several folks who suggested the beginnings of an answer, but Connectix has remained carefully silent on the matter despite multiple pleas for some confirmation.

The crux of the matter is the "save state" function that allows one to freeze the virtual machine in a given state and avoid needing to reboot every time VPC is launched. This "state" file is saved in a central location, so when the next user logs in, he does not own that file. This, in combination with the preferences that get saved in the user's home directory, totally confuse VPC from user to user. There was also a problem with having to re-register VPC for every user account (essentially re-install it for every user).

We use VPC strictly to run Project 2000, and there is no need or desire to save the state of Windoze from user to user. There are settings in VPC that turn off the saved state function and this can be protected by a password. You can also password protect the virtual machine settings. The catch is that this is not a globally stored preference file. I had to set up a dummy user account, register VPC, change the settings as discussed, and password protect them. Then the preference files were copied to /System -> Library -> User Template -> English.lproj -> Library -> Preferences". In addition, two directories are created when VPC is installed. Virtual PC List and Virtual PC Scripts are both directories created in ~/Library -> Documents. These must also be copied into /System -> Library -> User Template -> English.lproj -> Documents. Having made it this far, there is one last gotcha. The files in Virtual PC List have resource forks associated with them. Apple's GUI tool (Preferences Panel) for adding accounts does not preserve resource forks when it populates the new user's home directory skeleton from /System -> Library -> User Template -> English.lproj. Fortunately, my adduser shell script uses a resource fork preserving command line tool for the copy process.

The end result of this research is that every user account that gets added to our shared use Mac now has access to VPC (Project 2000) with no additional setup on my part. Any files they leave on the PC disk are lost when they log out or shut down VPC, and every user gets a clean uncorrupted Win2k session to run Project in. And there is no need for a separate 3 GB disk image for each account. One caveat is that if you change the Volume names it will likely break the preference files and symlinks. This means that this arrangement is not that useful in a universal build, the likes of which many large groups are prone to use. Also, I have not tested to see what changes I can make within the Windows environment (by temporarily turning off the setting that wipes everything at shutdown). Anything that modifies the Connectix files at the user level will obviously be a pain to migrate to every user on the Mac.

This is essentially a poor man's Citrix environment, and I predict that VPC will eventually morph into just that. They are developing this server technology to address these, and many other issues associated with a multi-user environments. I imagine you eventually will install and run PC apps as though they actually run natively under OS X. The "server" service will simply support this in a way similar to how X11 apps can run next to Aqua apps now. The distinction between them as far as the end user is concerned will evaporate.

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030507072932229