Shared Folders slow the first time opened then OK

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
andre-CA
Posts: 36
Joined: 27. Feb 2010, 10:14
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP Pro SP 3

Shared Folders slow the first time opened then OK

Post by andre-CA »

Mac OS X 10.6.4 Host VB all releases (3.1 and 3.2 series). Windows XP Pro SP3 guest and Windows 7 guest. When I open my shared folder the first time after I start a VM it takes about a minute to open the folder. If I close and reopen it opens right away. The same time lag happens on the first read or write of a file if the shared folder is not opened first. Why is this, and is there a way to fix it?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Shared Folders slow the first time opened then OK

Post by Perryg »

Windows is reading all of the file information. The more you have in the shared folder the longer it will take when you start. Test it yourself by sharing a folder that only has a small amount of data. It should load fairly fast.
andre-CA
Posts: 36
Joined: 27. Feb 2010, 10:14
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP Pro SP 3

Re: Shared Folders slow the first time opened then OK

Post by andre-CA »

The shared folder has only a few small files in them. A couple of word small text files. Interestingly it only happens on the first open after VM start. Subsequent opens are fine.
andre-CA
Posts: 36
Joined: 27. Feb 2010, 10:14
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP Pro SP 3

Re: Shared Folders slow the first time opened then OK

Post by andre-CA »

I still have this problem in VB 3.2.6.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Shared Folders slow the first time opened then OK

Post by Sasquatch »

Add the following to your hosts file (windows\system32\drivers\etc) and it should go faster:

Code: Select all

127.0.0.1        vboxsrv
Windows is trying to look up the name 'vboxsrv' and will only continue when it found it. Since the name isn't found in the hosts file, nor through DNS requests, it takes a while before the GA kick in with the location. Pointing the name to localhost will speed this up.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
andre-CA
Posts: 36
Joined: 27. Feb 2010, 10:14
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP Pro SP 3

Re: Shared Folders slow the first time opened then OK

Post by andre-CA »

There was already a line in the hosts file as follows:
127.0.0.1 localhost
so I added the line you suggested. Then I restarted and it still is much slower the first time the share is opened. It may be slightly faster than without the the line you suggested. I added it after the the localhost line and I left that in so the file now has 2 lines below the comments:

127.0.0.1 localhost
127.0.0.1 voboxsvr

Any other thoughts on this? Thanks.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Shared Folders slow the first time opened then OK

Post by Sasquatch »

I hope you used 'vboxsrv' instead of what you just wrote. Another entry with 'vboxsvr' may also be added, in case you use that name too (note the location of the v and r, they switched).

If you think it gives too much problems than it solves, you can of course remove the additions to your hosts file.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Shared Folders slow the first time opened then OK

Post by fixedwheel »

Sasquatch wrote:Add the following to your hosts file (windows\system32\drivers\etc) and it should go faster:
according to the manual its the lmhosts file to be modified ... => http://www.virtualbox.org/manual/ch12.html#id2655966
andre-CA
Posts: 36
Joined: 27. Feb 2010, 10:14
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP Pro SP 3

Re: Shared Folders slow the first time opened then OK

Post by andre-CA »

Here are the exact lines (i copied and pasted) from the hosts file:
127.0.0.1 localhost
127.0.0.1 vboxsrv

I also tried the suggestion for the lmhosts file and neither seems to change the approx. 20 second delay only the first time I open the shared folder. The next time it only takes about a second.

Any other thoughts?

Thanks.
Post Reply