VirtualBox

Ticket #1870 (closed defect: duplicate)

Opened 6 years ago

Last modified 3 years ago

Cannot use `mkdir a\b` in shared folder

Reported by: parren Owned by:
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

comment:1 follow-up: ↓ 2 Changed 6 years ago 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.

comment:2 in reply to: ↑ 1 Changed 6 years ago 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.

comment:3 Changed 6 years ago by frank

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

comment:4 Changed 6 years ago 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.

comment:5 Changed 6 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

comment:6 Changed 6 years ago by electricsam

  • Status changed from closed to reopened
  • Resolution fixed 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)"

comment:7 follow-up: ↓ 8 Changed 6 years ago 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.

comment:8 in reply to: ↑ 7 Changed 6 years ago 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.

comment:9 Changed 6 years ago by frank

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

comment:10 Changed 6 years ago by electricsam

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

comment:11 follow-up: ↓ 12 Changed 6 years ago 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\c creation was not successful for an unknown reason

Total time: 0 seconds

comment:12 in reply to: ↑ 11 ; follow-up: ↓ 13 Changed 6 years ago 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

comment:13 in reply to: ↑ 12 Changed 6 years ago by electricsam

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

comment:14 Changed 6 years ago 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.)

comment:15 follow-up: ↓ 16 Changed 6 years ago 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.

comment:16 in reply to: ↑ 15 Changed 6 years ago 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

comment:17 Changed 5 years ago 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.

comment:18 Changed 5 years ago by electricsam

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

comment:19 Changed 5 years ago by frank

  • Version changed from VirtualBox 1.6.2 to VirtualBox 2.0.4

comment:20 Changed 5 years ago by electricsam

Just a heads up for anyone else with this problem, I tried with version 2.0.6. It still does not work.

comment:21 Changed 5 years ago by bikehead

Still doesn't work in 2.1.4. Is there any status on when/if this will be fixed?

comment:22 Changed 5 years ago by vnguyen

Thanks for reporting this issue. Does anyone have a workaround?

comment:23 Changed 5 years ago by MrX1980

Please try it with v3.0.0

comment:24 Changed 5 years ago by igorgatis

This is still an issue as of v3.0.2 r49928

comment:25 Changed 5 years ago by igorgatis

This is really bad: it is preventing me from building with ant as well. Where can I vote for this bug?

comment:26 Changed 5 years ago by bikehead

My current status with this bug is that the test program mentioned above does work under 3.0.2. However my ant build still fail.

I isolated the failure and I opened a new bug for this as  http://www.virtualbox.org/ticket/4299 since the mkdir doesn't really fail any more, but it was immediately marked as a duplicate of this one; sigh. However, that ticket has some files for an ant build that does fail under 3.0.2.

My hope is that the VBox testers will use that test case to verify that this bug is fixed: it was reported one year ago!

comment:27 Changed 5 years ago by cemerick

Still doesn't work in v3.0.4...getting this error in ant builds in shared folders:

Directory G:\osint\build\cluster creation was not successful for an unknown reason

comment:28 Changed 5 years ago by cemerick

Maybe someone with appropriate privs can drop the "=> Fixed in 1.6.6" from the title of this issue (just in case that's throwing off the prioritization of the problem)? There's a lot of Java apps out there that will fail in highly unexpected ways because of this.

comment:29 Changed 5 years ago by akpraha

Ditto. Confirmed to still not work in 3.0.6, Ubuntu 9.0.4 (32-bit i686) host, Windows XP guest, Guest Additions 3.0.6 installed.

Any chance on getting this issue actually fixed?

comment:30 Changed 5 years ago by frank

  • Status changed from reopened to closed
  • Resolution set to duplicate
  • Summary changed from Cannot use `mkdir a\b` in shared folder => Fixed in 1.6.6 to Cannot use `mkdir a\b` in shared folder

Closing this as duplicate of #4299 because there are more recent comments. Bug is under work.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use