VirtualBox

Ticket #1870 (reopened defect)

Opened 4 months ago

Last modified 3 weeks ago

Cannot use `mkdir a\b` in shared folder => Fixed in 1.6.6

Reported by: parren Assigned to:
Priority: major Component: shared folders
Version: VirtualBox 2.0.4 Keywords:
Cc: Guest type: Windows
Host type: Linux

Description

Mount a shared folder. Then try mkdir a\b. Fails with "The system cannot find the file specified.". Doing the sequence mkdir a and then mkdir a\b works. This bug is breaking my Ant builds because javac cannot create its output folders.

Change History

(follow-up: ↓ 2 ) 08/05/08 14:14:49 changed by bikehead

Same here. I'm using Windows XPpro with ant and my builds all fail because any creation of a directory or file where the creation of a parent is implied fails.

I can successfully do the build when the directory is mounted via samba or if I copy the directory to the guest OS disk. It only happens with a shared folder.

I run fedora core 9, x86_64.

(in reply to: ↑ 1 ) 08/05/08 20:19:03 changed by bikehead

Replying to bikehead:

Same here. I'm using Windows XPpro with ant and my builds all fail because any creation of a directory or file where the creation of a parent is implied fails. I can successfully do the build when the directory is mounted via samba or if I copy the directory to the guest OS disk. It only happens with a shared folder. I run fedora core 9, x86_64.

I tried working around this using samba on the host computer and mapping the drive in Windows. This works in that the mkdir-s work properly, but it is over *three* times slower than using the shared folders. For me this is a pretty big hit since my 1 hour system (yes the system is quite large) build goes to over 3.5 hours.

It would be great if we could get some status on if and when this might get addressed.

08/06/08 13:39:53 changed by frank

Problem confirmed. We are currently not sure which part is misbehaving, either our guest additions or the host shared folders service.

08/11/08 22:28:18 changed by frank

  • summary changed from Cannot use `mkdir a\b` in shared folder (Windows XP guest, Ubuntu host) to Cannot use `mkdir a\b` in shared folder => Fixed in 1.6.6.

Bug fixed in 1.6.6 (not yet released), you need to update the guest additions.

09/02/08 14:46:41 changed by frank

  • status changed from new to closed.
  • resolution set to fixed.

09/02/08 16:20:28 changed by electricsam

  • status changed from closed to reopened.
  • resolution deleted.

It doesn't appear as if this fix made it in 1.6.6, or it was not complete. I am running a Fedora 9 (AMD64) host with a Windows XP guest. I just updated VirtualBox and installed the 1.6.6 additions. I am still getting the same error when using ant to do a build. The build works fine when using a samba share.

"BUILD FAILED T:\workspace\hre_29\build.xml:301: Failed to copy T:\workspace\hre_29\rulesconfig\drools\CallCenter?\CallCenter?.drl to T:\workspace\hre_29\target\classes\drools\CallCenter?\CallCenter?.drl due to java.io.FileNotFoundException? T:\workspace\hre_29\target\classes\drools\CallCenter?\CallCenter?.drl (The system cannot find the file specified)"

(follow-up: ↓ 8 ) 09/10/08 12:52:48 changed by frank

Please could you check if

mkdir foo\bar\buzz

works if foo and/or bar is not present? Use the command line. Because that works fine here and I wonder what is different with your environment.

(in reply to: ↑ 7 ) 09/11/08 16:09:28 changed by electricsam

mkdir foo\bar\buzz does appear to work on my system as well. I also tried xcopy, which works. It looks like it might be an Ant/Shared Folders problem when Ant does a copy. As I mentioned earlier, the Ant build script I am using works fine (just very slow) using samba to connect to the same shared folder. Also FYI, I upgraded to VB 2.0.0.

09/11/08 16:20:51 changed by frank

Without a simple test case this problem is difficult to fix.

09/11/08 16:23:01 changed by electricsam

When I get some free time, I will see if I can create one.

(follow-up: ↓ 12 ) 09/11/08 17:02:01 changed by parren

Paste the following into a file build.xml on a shared folder:

<?xml version="1.0" encoding="UTF-8"?>
<project name="vboxbug1870" default="test" basedir=".">
	<description>Exposes VirtualBox bug #1870.</description>
	<target name="test">
		<delete dir="a" />
		<mkdir dir="a/b/c" />
	</target>
</project>

Install Java and Ant. Then open a command prompt in the folder containing build.xml. Run the command ant.

My output for VirtualBox 1.6.6 is:

F:\vbox-bug>ant
Buildfile: build.xml

test:

BUILD FAILED
F:\vbox-bug\build.xml:6: Directory F:\vbox-bug\a\b\c creation was not successful for an unknown reason

Total time: 0 seconds

(in reply to: ↑ 11 ; follow-up: ↓ 13 ) 09/11/08 17:54:26 changed by electricsam

It looks like the underlying problem is with java file io. Here is a test program that removes an existing test directory structure if it exists, then creates it again with a single File.mkdir instruction. To run, copy the text below to a file called FileIOTest.java, compile the code with javac, then run "java java FileIOTest" inside of a shared folder.

import java.io.File;


public class FileIOTest 
{
	
	static public boolean deleteDirectory(File path) 
	{
		if( path.exists() ) 
		{
			File[] files = path.listFiles();
		    for(int i=0; i<files.length; i++) 
		    {
		    	if(files[i].isDirectory()) 
		    		deleteDirectory(files[i]);
		        else 
		           files[i].delete();
		    }
		}
		return(path.delete());  
	}

	
	public static void main(String args[])
	{
		String mkdirPath = "vbtrac1870"+File.separator+"foo"+File.separator+"bar";
		File dir = new File(mkdirPath);
		String topDirName = "vbtrac1870";
		File topDir = new File(topDirName);
		
		if(topDir.exists())
		{
			System.out.println("Removing old test directory structure: "+topDirName);
			try
			{
				if (deleteDirectory(topDir))
					System.out.println("-- SUCCESS");
				else
					System.out.println("-- FAILURE - structure not removed, no exceptions thrown");
			}
			catch(Exception e)
			{
				System.out.println("-- ERROR");
				e.printStackTrace();
			}
		}
		
		System.out.println("Creating directory structure: "+mkdirPath);
		try
		{
			if (dir.mkdirs())
				System.out.println("-- SUCCESS");
			else
				System.out.println("-- FAILURE - structure not created, no exceptions thrown");
		}
		catch(Exception e)
		{
			System.out.println("-- ERROR");
			e.printStackTrace();
		}
	}
	

}

Here are my results:

Using samba:

Z:\>java FileIOTest
Creating directory structure: vbtrac1870\foo\bar
-- SUCCESS

Using a shared folder:

T:\>java FileIOTest
Removing old test directory structure: vbtrac1870
-- SUCCESS
Creating directory structure: vbtrac1870\foo\bar
-- FAILURE - structure not created, no exceptions thrown

(in reply to: ↑ 12 ) 09/11/08 17:56:00 changed by electricsam

Oops, the command to run should be "java FileIOTest" not "java java FileIOTest"

09/11/08 18:34:22 changed by bikehead

Just echoing a "me too" about the problem still happening for me in VirtualBox 2.0 which I'm assuming encompasses "1.6.6". I also use ant so I'll be interested in the results of electricsam's test case.

(I mainly added this comment because there doesn't seem to be a way to add myself to the cc list and I am very much interested in the status of this bug. I use Vbox for compiling Java code under windows and the speed difference between Samba and shared folders is very important to me.)

(follow-up: ↓ 16 ) 09/16/08 10:19:47 changed by sandervl73

Please update to 2.0.2 and install the 2.0.2 additions there. The additions installer had some issues before that prevented it from updating some files.

(in reply to: ↑ 15 ) 09/16/08 15:48:42 changed by electricsam

Unfortunately upgrading to 2.0.2 and installing the 2.0.2 additions does not fix the problem. I'm getting the same result from the java test.

T:\>java FileIOTest
Creating directory structure: vbtrac1870\foo\bar
-- FAILURE - structure not created, no exceptions thrown

10/30/08 17:43:46 changed by bikehead

Is there any new status on this bug? I've upgraded to 2.0.4 and reinstalled the shared folder extensions. I'm developing java applications under a windows guest and I'd love to have this bug fixed: shared folders seem to be about 3-5x faster than a samba mount.

10/30/08 17:45:09 changed by electricsam

I just tried with 2.0.4. It is still not fixed.

10/30/08 18:18:38 changed by frank

  • version changed from VirtualBox 1.6.2 to VirtualBox 2.0.4.

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy