Bug with Cygwin and Parallels Shared Folder

Discussion in 'Parallels Desktop for Mac' started by Mike DeSimone, Aug 24, 2006.

  1. Mike DeSimone

    Mike DeSimone Bit poster

    Messages:
    5
    I've run headlong into a weird bug. I have a MacBook Pro running Mac OS X. I'm running Parallels on it with Windows XP as the guest OS. I have my OSX home directory mounted in XP as a shared drive (Z:). Pretty typical.

    I have Cygwin installed on XP. If I run the following commands in Cygwin:
    echo foo >> /cygdrive/z/test
    echo bar >> cygdrive/z/test
    cat /cygdrive/z/test
    I get:
    ^@^@^@^@bar​
    Basically, running the second command (which opened the Z:\test file in append mode) replaced the file's contents with an equal number of NUL (ASCII 0) characters before appending the new data.

    If I run this test on the Windows XP drive, there's no problem:
    echo foo >> /cygdrive/c/test
    echo bar >> /cygdrive/c/test
    cat /cygdrive/c/test

    foo
    bar​

    And, the thing that floors me is that if I try this from DOS, it works:
    echo foo >> Z:\test2
    echo bar >> Z:\test2
    type Z:\test2

    foo
    bar​

    Can anyone reproduce this, and has anyone seen this before? I'm not sure what's going on, since at least two factors (Cygwin Bash shell and Parallels shared folders) must be present for the problem to occur. Right now, I can't figure out which factor is the real cause, and I don't know enough Windows internals to go deep-diving into the OS layers. I have tried both Bash versions that Cygwin offers (3.0.x and 3.1.x) and both show the same problem, so it might be cygwin1.dll and not bash.

    The reason I ran into this is that I was trying to cross-compile some code in my OSX home directory under Windows, and the program that generates my makefiles (which uses bash and perl to do its work) gave me a NUL-filled makefile. The workaround is to copy my files to the Windows XP volume, but that's kludgy and the XP volume doesn't have a huge amount of free space.
     
  2. persike

    persike Member

    Messages:
    35
    Hi Mike,

    I'd rather claim Shared Folders responsible for the errors you get, not Cygwin. For me, Shared Folders did not work properly from day one. You'll find several threads that discuss these issues:

    http://forum.parallels.com/showthread.php?t=2483&highlight=shared+folders

    http://forum.parallels.com/showthread.php?t=2152&highlight=shared+folders

    http://forum.parallels.com/showthread.php?t=2624&highlight=shared+folders

    http://forum.parallels.com/showthread.php?t=2297&highlight=shared+folders


    The list of reported bugs may not be complete but it includes

    1. File corruption on saving without an error message (i. e. files with random contents or nulls)

    2. Case sensitivity of Shared Folder contents

    3. Connection drop on suspend/hibernate

    4. Wrong file dates on saving


    There already were comments by members of the Parallels team on these problems and some of the errors were announced to be fixed. However, user reports keep appearing on the forums which complain about Shared Folders not working properly.

    If you don't need a direct Internet connection from your Guest OS, you should switch to Host-Only networking in Parallels and share folders with the Samba solution. The latter has been described in multiple threads here.

    Best wishes, Shaun
     
    Last edited: Aug 25, 2006
  3. Mike DeSimone

    Mike DeSimone Bit poster

    Messages:
    5
    Unfortunately, the guest OS needs the network connection to talk to the license server. Grr.

    When my Windows/Linux box gets back from the shop today, I'm going to try the same thing on VMWare (Linux host, Windows guest) and see what happens.
     
  4. xbrianskix

    xbrianskix Member

    Messages:
    20
    persike: Really? I haven't had any problems (other than speed) with shared folders.

    Mike: The problem here is that you are running over the network. There is some special magic you have to do to configure samba (the linux file sharing daemon compatible with windows) to work properly with cygwin. As the number of people running cygwin in windows on a mac via parallels has got to be quite low, I'm afraid you'll have a hard time getting apple or parallels to look at this issue... If I may be so bold, might I ask why you want to use cygwin when you have a perfectly good POSIX os on the bare metal?
     
  5. Mike DeSimone

    Mike DeSimone Bit poster

    Messages:
    5
    1) The only thing going over the network, to my knowledge, is the Windows app when it talks to the license server. My home directory is in Mac OS X land, on the local hard drive, and Parallels is being run locally.

    2) I have no idea where you think Samba comes into it, unless Parallels is running some kind of Samba under the hood. My setup doesn't involve Personal File Sharing, the OSX instance of Samba. I am only using one Parallels Shared Folder which maps to /Users/username on the host OS and Z: on the guest OS.

    3) I am well aware of what kind of minority I am in, but I haven't succeeded in convincing this bug to go away on those merits. I figure I'd have better luck if I can figure out why it is doing this, and see if anyone else has these problems.

    4) I am trying to build code on Windows using compilers that are readily available on Windows, specifically for the Altera Nios 2 architecture. Also, the eCos port for Nios 2 is only available on Windows. I lack the time and expertise to port these products to Mac OS X.

    I hope this clears things up a bit.
     
  6. xbrianskix

    xbrianskix Member

    Messages:
    20
    Mike: Shared folders are implemented as network shares.
     
  7. persike

    persike Member

    Messages:
    35
    Yes, really. That's why I posted the above links to threads which discuss all of the four mentioned bugs.

    Bye, Shaun
     
  8. Mike DeSimone

    Mike DeSimone Bit poster

    Messages:
    5
    Okay... the Windows guest OS sees network shares, I got that much. So you're saying that Parallels has a Samba or Samba-like server within itself, and I need to find that and reconfigure it so Cygwin likes it. Cool... where is it?
     

Share This Page