Possible to relocate .mem file?

Discussion in 'Installation and Configuration' started by Smudge2, Apr 24, 2011.

  1. Smudge2


    Is it possible to configure Parallels to save the .mem file used for the Memory file in an alternate location? It currently saves it within the VM package/folder but I would like to have the saved onto a different hard drive.

    It isn't an option within the preferences and I've already looked thru the plist config file. Since the .mem filename is dynamically named at every launch of the VM, I can't redirect it via a link.

  2. JuliaU


    Hi Smudge2,

    Yeah, actually it is possible. You need to locate your virtual machine in Finder -> right-click on .pvm -> Show package contents. There is config.pvs here. Right-click on it -> Open with -> TextEdit. Find the following parameter <SwapDir></SwapDir> and change it to the folder you would like .mem file to be stored -> Save changes and it will be stored in another location.

    Just as an example, after you changed the parameter it should look like this:
  3. Smudge2


    Thank you so much! I knew there had to be a config file I was overlooking.

    However I did have one issue that took me a while to fix. After editing the file, when I tried to launch the VM, I would an error dialog of "Access denied. You do not have enough rights to use this virtual machine."

    I thought it had to do with the location of the Swap file I set so I messed around with some other locations to no avail. I finally compared the new config file with the original (you did make a backup, right?) and saw the user access permissions were different. My text editor set the group and everybody permissions to readable on the new version whereas the original had only myself with full rights and everyone else had no access. Since the VM I use was created for my own use and not others (originally saved in my Documents/Parallels/ dir instead of in the /Users/Shared/ dir), the ownership of the VM itself is only for me. Perhaps because of this, the config file must also only be owned by me. Allowing group/everybody read access must be considered a security risk and Parallels won't allow it to run.

    So if you get the same error after making this change, simply Get Info on the file and disable access for everyone else. Username (Me) set to Read & Write privilege; Everyone set to No Access.

    For the terminal savvy, simply use chmod 700 config.pvs to set the perms properly.

    Edited file perms (wrong)
    -rwxr--r--@  1 smudge  staff    17K Apr 25 11:57 config.pvs*
    corrected perms after chmod command
    -rwx------@  1 smudge  staff    17K Apr 25 11:57 config.pvs*
    Hope this helps.

    Again, JuliaU thanks for this pointer.
    Last edited: Apr 25, 2011
  4. YuliaU


    Hi Smudge2,

    Glad that it was helpful and great to hear that the thing with permissions got fixed as well. I did test this before posting and had no errors or complications, that is why I did not take it into considiration. I guess that's just a different configuration. Well, anyway, thanks for the tip from your side as well, I am sure someone will find it useful :)
  5. Smudge2


    Just a word of caution when making this modification that the SwapDir entry should be unique to each VM.

    In a new linux VM, I set the SwapDir value to the same as my Win7 VM. The Win7 VM was already running and I saw the .mem swap file. I started up the new linux VM and I saw the Win7 .mem file disappear from the directory and the new linux .mem file appear. Although they had different names, it seems that the Parallels VM manager checks the dir for existing .mem files, probably in case of a crash and it didn't get cleaned up, and removes it. Since the .mem file is normally in the VM's container, this shouldn't be an issue.

    I'm sure if the Win7 VM tried to access the .mem file that was now gone, it probably would have crashed the VM so I immediately shut it down.

    I set the SwapDir value in each of the VMs to a unique subdirectory of the original location and everything it working properly.

Share This Page