Ticket #11976 (new defect)

Opened 7 years ago

Last modified 2 years ago

long paths (>260chars) cannot be created using a host:win + guest:linux setup

Reported by: Urrich Owned by:
Component: other Version: VirtualBox 4.2.16
Keywords: Cc:
Guest type: Linux Host type: Windows


From and, VirtualBox on windows cannot generate paths longer than ~260 characters on windows, despite windows supposing UNC paths to allow for ~32k character paths. This means that using things like Vagrant, with a project that uses node/npm, is blocked by VirtualBox because node module dependencies (but also just any deeply nested software project being tested in a virtualbox VM) end up having paths that are longer than the standard 260 character limit.

Somewhere, VirtualBox is not communicating the correct error from host to guest OS; it would be extremely useful if this was solved somehow (allowing UNC paths by default? perhaps something else altogether)

Change History

comment:1 Changed 6 years ago by TrickyNicky

I found this tickets after searching for a solution to the exact same problem.

Host: Windows 7 64bit, Guest: Linux Debian; shared folder inside VM is /vagrant/ and under Windows it's C:\Users\<myuser>\src\<project>\ .

When I try to install a certain npm package with a lot of dependencies, the paths start to exceed the limit I still have due the shared folder being where it is.

Here I found what Microsoft says on the limit: .

Basically, the software (VirtualBox in that case) would have to use special paths starting with "
?\" to trigger the Windows APIs allowing longer paths. One of the caveats described in that page is that relative paths are not supported.

Given that information it seems to there's currently no real solution besides moving the software using such long paths off inside the VM or figure out how to shorten the paths on the host system.

comment:2 Changed 6 years ago by sirlatrom

A workaround is to remove the original share and then use VBoxManage to add it back while prepending \\?\ to the host path, e.g.

VBoxManage.exe sharedfolder add "C:\Users\<username>\VirtualBox VMs\<vm-name>\<vm-name>.vbox" --name "MyStuff" --hostpath "\\?\C:\MyStuff"

comment:3 Changed 2 years ago by GabeLager

For those encountering this problem when using Vagrant, you can use NFS instead of VirtualBox's native "Shared Folder" kernel driver; NFS does not have this 260-character path-length limitation. See:

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use