Access SAME dropbox folder on MacOS and Windows in BOTH Parallels AND BootCamp?

Discussion in 'Windows Virtual Machine' started by mdrejhon3, Apr 21, 2011.

  1. mdrejhon3

    mdrejhon3 Member

    Messages:
    24
    Hello,

    One of my Dropbox clients is on a MacBook. I currently have my Dropbox set up on my Mac, and have successfully accessed the Mac Dropbox folder in Windows XP via Parallels Shared Folder.
    However, now I need to access the same Windows XP installation via Boot Camp.
    (NOTE: It's possible to boot the same copy of Windows in either Parallels and Boot Camp, when following instructions for a dual-hardware-profile installation, found in Parallels forums)
    Sometimes I have to go to native Boot Camp for a few reasons (example: DirectX 10/11 videogames, max Windows development performance, etc.)

    I need to be able to:
    (1) Access same dropbox folder from MacOS
    (2) Access same dropbox folder from Windows XP/7 in Parallels (virtual bootup)
    (3) Access same dropbox folder from Windows XP/7 in Boot Camp (native bootup)

    I've successfully accomplished (1) AND (2).
    However, I need to add (3) to the mix.
    The question is...HOW?
    There are two options I can see:

    (A) Keep my dropbox folder on the Mac volume (HFS filesysstem)
    Install a Windows HFS+ driver in the Boot Camp profile
    http://www.paragon-software.com/home/hfs-windows/
    (Or install MacDrive -- another HFS+ driver)
    * When booted to Windows via Boot Camp profile
    ...Run Windows copy of Dropbox, pointing to the Dropbox folder on HFS volume
    * When booted to Windows via Parallels profile
    ...Run Mac version of Dropbox, and use Parallels Shared Folder, pointing to the Dropbox folder via Parallels Shared Folder.
    * When using MacOS
    ...Safe to run Mac version of Dropbox regardless of whether or not I am running Parallels.

    --or--

    (B) Move my Dropbox to a Windows NFTS volume.
    * When booted to Windows via Boot Camp profile
    ...Run Windows copy of Dropbox pointing to Dropbox folder
    * When booted to Windows via Parallels profile
    ...Run Windows copy of Dropbox pointing to Dropbox folder
    * When using MacOS only
    ...Run Mac version of Dropbox, mount via NTFS-3G and access Dropbox folder
    ...CAVEAT: Cannot simultaneously mount NTFS-3G readwrite AND use Parallels at the same time.

    ---

    I am leaning towards approach (A), but any caveats? Opinions?
     
    Last edited: Apr 26, 2011
  2. gkratkin

    gkratkin Member

    Messages:
    21
    Why try to share the same physical folder? I'd just install Dropbox separately on the Mac and the VM's and let it do its job. The price is disk space and some latency issues, but Dropbox LAN sync (https://www.dropbox.com/help/137) should optimize the latter. The hassle factor will be much lower, and you won't run the risk of having two copies of Dropbox acting against the same folder.
     
  3. mdrejhon3

    mdrejhon3 Member

    Messages:
    24
    Sure. That works.
    My other computers are doing LAN sync, and it works great.

    ....But....

    I've got a paid 50GB dropbox account (BIG ACCOUNT) on SSD space (EXPENSIVE DISK).

    And I have only 41GB left on my SSD.
    Don't ask me to replace the SSD -- I like my 9 second MacOS X bootup & I like ability to load a 1GB document file in only 5-10 seconds (depending on app) and Parallels booting up XP in only 6-7 seconds (sometimes as little as 4-5sec, from Suspend). You get addicted to 270MB/sec sequential read throughput, very quickly. (And it really shows in fast Sleep/Wake in Parallels too.) Yes, an SSD upgrade will be done sometime later this year, but I already solved (1) and (2), I just need to solve (3). I've heard of people using the NTFS3G driver for accessing a Dropbox folder on a Boot Camp partition, while running in MacOS, so it's at least indirectly confirmed it works. But I think approach (A) sounds better, which I've never heard of anybody trying.
     
    Last edited: Apr 22, 2011
  4. mdrejhon3

    mdrejhon3 Member

    Messages:
    24
    Good news!
    It can be done!
    Instructions for successfully completing step #3 are here:
    http://scorpiotek.com/blog/?p=766

    The MacDrive HFS+ driver works great for sharing the same 50GB Dropbox folder under all possible installations. However, instead of a symbolic link, I'm using SUBST under BootCamp to put my HFS+ user folder into its own drive letter, allowing Dropbox to access E:\DropBox. Under Parallels, I just use a Parallels Shared Folder to share the same Mac user folder into the same disk drive letter. Data is still located in the came place as E:\DropBox. Problem solved using SUBST instead of a symbolic link!

    Note: You can use Dropbox preferences to transfer the Dropbox folder to a different location, and then let it merge & resync. Nothing gets changed.

    The convenience factor outweighs the setup hassle. I also put all my photos, my projects, and documents in Dropbox, so that my entire digital lifetime is automatically synced to all my computers. My Mac's Documents folder is magically synced with my Windows "My Documents" folder. Same for the Photo folder equivalent. Very convenient. No more manually keeping the document and photo folders in sync, Dropbox does it automatically for me. Running Windows Picasa looks exactly the same as running Mac Picasa, for example. OpenOffice points to the same folder. Visual Studio and XCode points to the same source code. Without needing to copy files back and fourth because Dropbox does the automatic sync within seconds of saving the file; and the file's now already backed up "in the cloud" in case I lose my computer in a fire. And if I accidentally modify or delete a useful source code file without backing it up first, I can undelete an older copy via Dropbox' website. (basic source code revision control, whenever working solo). Anyway, bottom line -- convenience factor of Dropbox and sharing the same disk space, outweighs the setup hassle, since I save a lot of manual copying and backing up time. I hear SugarSync is similiarly good, although Dropbox currently had the slight edge.

    1. MacOS -- Running Mac Dropbox.
    2. Windows in Parallels VM -- Running Mac Dropbox, access files via Parallels Shared Folder
    3. Windows in BootCamp -- Running Windows Dropbox, access files via 'MacDrive' HFS+ driver and SUBST trick.

    This is very useful for SSD users with big Dropbox accounts.
     
    Last edited: Apr 26, 2011
  5. JongbokY

    JongbokY Bit poster

    Messages:
    1
    Dropbox under Download

    The easiest way to share a folder between Mac and Windows 7 on Mac through Parallels is to set Dropbox under Download folder which is shared by both. It can be applied to any folder you want to share with between two.
     
  6. AleAve

    AleAve Bit poster

    Messages:
    5
    JongbokY, I tried your advice but it just doesn't work. I installed Dropbox in Mac OS into the "Downloads" folder like you suggested. However, when I then also tried to install Dropbox in my virtual Windows 7 machine, pointing it to the Dropbox in that shared "Downloads" folder, the Windows Dropbox wouldn't accept that. It would detect that the "Downloads" folder was "a network folder in a remote location" (or some such), and it would not accept such a "remote" Dropbox location. The current path to the Mac OS Dropbox from inside Windows is:

    \\psf\Host\Users\myself\Downloads\Dropbox\

    The Windows Dropbox refuses to accept such a path. It expects something "truly local" like:

    c:\Users\myself\Documents\Dropbox

    Does anyone have an idea on how to get around this obstacle?
     
  7. thepeoplescoder

    thepeoplescoder Bit poster

    Messages:
    4
    So I believe I have solved this problem. When booted into Windows via Parallels, it creates a key in the registry called HKEY_LOCAL_MACHINE\HARDWARE\ACPI\DSDT\PRLS__. So, all you have to do, is on startup, see if such a key exists, and if it does, then you are in Parallels, otherwise, you can safely (with some restrictions) assume that you are booted into Windows directly.

    *** Solution begins here ***

    The great thing about this solution is that you don't have to come out of pocket to buy anything extra, as long as your version of Mac OS X supports exFAT partitions. I know in Lion and Mountain Lion, there is built-in support for exFAT, but I'm not so sure about Snow Leopard and versions prior (as I have only been a Mac user since April).

    I should say that I am using a Late 2011 MacBook Pro, with a 2.4 GHz Intel Core i5 processor, and 16GB of RAM. I am running Mac OS X 10.8.2, Windows 7, and Parallels Desktop 8.

    The key to this method is to have a common exFAT partition, that both Mac OS and Windows can access natively. On my machine, I have three partitions (filesystems used are in parentheses): one for Mountain Lion (HFS+, journaled), one for Windows (NTFS), and a common partition (exFAT).

    Of course, to have a setup like this, I didn't use the BootCamp utility to set up my partition for Windows; I went straight into Disk Utility and created those partitions manually. In the interest of getting straight to the point, I will skip how to set that up, as there should be resources online that can explain how to do that; maybe after finals are over, I can post instructions on how to do that myself.

    At this point, I will assume that your partitions are set up like mine, with Windows installed on its own partition, with Parallels set up to run Windows from that partition.

    As far as sharing options for my virtual machine, I have:
    Share Folders: All disks
    Map Mac Volumes to Windows is checked
    Access Windows folders from Mac is checked
    Mount virtual disks to Mac desktop is checked

    For custom folders, I added my common partition to that list.

    Now, since that's out of the way, go ahead and grab a pen and a piece of paper. You're going to want to boot into Windows directly, and make note of the drive letters of your common partition, and your OSX partition. After you do that, you will have to boot into Windows via Parallels and do the same. When I did this, my drive letters were as follows:

    Booted into Windows directly
    OSX partition -> E:
    Common partition -> F:

    Booted into Windows via Parallels
    OSX partition -> Z:
    Common partition -> X:

    NOTE: Your drive letters may vary. Be sure to make the appropriate substitutions from this point on, including in the code for the batch file that I will provide.

    The stuff in red that follows will be the code to the batch file that we will need to solve this problem. Basically what the following batch file will do, is it will allow you to refer to your OSX partition by drive J: and your common partition by drive K:, whether or not you are booted into Windows directly, or via Parallels. If you happen to be using drive letters J: and K: for something else, it will be your responsibility to make the appropriate substitutions for J: and K: in the following code.

    Copy and paste the following code and save it to a file called SelectDrive.bat. (Important: Be sure that the file has the .bat extension, otherwise this won't work.)

    @echo off
    REM ** This batch file selects J: and K: based on whether or not we are in Parallels.
    REM ** J: refers to the Mac partition
    REM ** K: refers to the Common partition.

    Rem ** Delete references to J: and K: and reset ERRORLEVEL to 0
    subst /d j:
    subst /d k:
    verify > nul

    Rem ** This command is required to get the specific key into a variable so I can check it.
    Rem ** I'm checking for existence of a virtual machine that way, and if it exists, then go there.
    for /f %%c in ('reg query HKEY_LOCAL_MACHINE\HARDWARE\ACPI\DSDT') do if %%c==HKEY_LOCAL_MACHINE\HARDWARE\ACPI\DSDT\PRLS__ goto inParallels

    Rem ** This is if we are booted into Windows directly.
    subst j: e:\ > nul
    subst k: f:\ > nul
    goto EOF

    Rem ** Do this if we are in Parallels.
    :inParallels

    :setJDrive
    subst j: z:\ > nul
    if errorlevel 1 (goto setJDrive)
    :setKDrive
    subst k: x:\ > nul
    if errorlevel 1 (goto setKDrive)
    :EOF


    Now that we have this batch file, we have to make sure that it runs for all users as soon as Windows boots up, which means that we can't save it into anything pertaining to our user folder (such as Documents, Desktop, Downloads, etc.). Instead, we have to go to My Computer to copy this file to a location where everyone can access it. Simply copy (that's copy, NOT move, there are reasons for this) it to the root of your C: drive. I won't go into detail on how to do this, because to even want to have a common place for your Dropbox folder to exist, I would assume that you are a power user who knows a few things about the OSes that you are working in.

    At this point, SelectDrive.bat should be copied to the root of your C: drive. To finish this off, we need to make a small change to the registry. If you are paranoid, feel free to back up your current registry settings, so you can revert back to them if you mess something up. If you've never played around with the registry before, then relax, it's not as scary as one thinks it is.

    To start the registry editor, use the Run shortcut key which is Command-R (equivalent to Windows-R on a Windows keyboard), and type in regedit. You'll then be prompted with a UAC dialog box; just click yes.

    Next, you're going to expand the folder (or more correctly, the hive) labeled HKEY_LOCAL_MACHINE.
    Expand the subkey SOFTWARE.
    Scroll to the subkey Microsoft and expand it.
    Scroll down to the Windows subkey and expand it.
    Expand the subkey labeled CurrentVersion
    Scroll down to the subkey labeled Run and click it.

    In the right pane, you should see a "table" with three columns labeled Name, Type, and Data.
    Right/Secondary click into the right pane, and select New -> String Value from the context menu that shows up.

    At this point, a text box with some blue text will be highlighted; this is how it asks you for the name of the registry value. In there, type __SelectDrive and press Enter. The name __SelectDrive is completely arbitrary; I could have called it ILikeBigButtsAndICannotLie and it would not have made a difference. What ACTUALLY matters, however, is the data for this key.

    To modify the data, go ahead and double click the name of the registry value you just created. In the text box labeled Value data, in there, you will type in C:\SelectDrive.bat.

    Exit the registry editor, and restart Windows. Enjoy!
     
  8. DarioParigi

    DarioParigi Bit poster

    Messages:
    5
    Hi, I find this solution using dos SUBST command from the command prompt very fine, and I managed to implement it and solve the issue.
    However it is necessary to run the command at sytem start up.
    I imagine that there is a way to run the command automatically at start up, however I cannot find the solution online.
    Can somebody help me to have a dos command line run at each startup?
    thank you, d
     
  9. DanielPH

    DanielPH Bit poster

    Messages:
    1
    Hi mdrejhon3,

    I am attempting the exact same setup on my new MBP, I am just wondering how did you prevent dropbox starting when running win7 (from bootcamp partition) as a virtual machine (in order to allow the mac version of dropbox to do the syncing).

    Did you need to manage this manually?

    Cheers,

    Dan
     
  10. AngieS

    AngieS Bit poster

    Messages:
    1
    Dropbox is one of the best online backup storage service. Information shared by you about it is genuinely helpful for every individual.
     

Share This Page