Windows 7 in VirtualBox: Shared Folders workaround

I’ve written about enabling Guest Additions on Windows 7 Beta 1 in VirtualBox. While most items work, such as mouse integration and Auto-resize Guest Display, one of the items that still doesn’t correctly function is Shared Folders. Fret not, because there is a simple workaround that can provide basic functionality. Also note, that this method works for any Windows guest, and could be adapted for a variety of other guests.

First, a quick word about the host OS: It must be running some implementation of Microsoft Windows network file system (SMB/CIFS) networking to work. If the host OS is Windows, you’re all set. If you’re on a Mac or Linux host environment, you’ll need to use Samba. Fortunately, Samba is nicely integrated with modern Mac and Linux releases. As for the guest OS, you’ll need to have some sort of networking enabled. With the revamped host networking in 2.1, I highly recommend you use that if at all possible.

As long as the above requirement is met, you may share the folder you want to access. I say “may” only because if your host OS is Windows, you can access the hidden drive shares directly. If this is the case, skip the next section and head right for the next paragraph. If you’re new to sharing a folder, here are the steps to accomplish it.

Windows

  1. Right-click the folder name and choose, “Share…”

    Vista Share Menu

    Vista Share Menu

  2. Verify the user with access is correct. It should be your current account and have Owner privileges
  3. Click Share

    Vista File Sharing

    Vista File Sharing

Ubuntu

  1. Browse to a folder using Nautilus (your default file manager when using Gnome)
  2. Right-click and choose “Sharing Options”

    Ubuntu Sharing Options Menu

    Ubuntu Sharing Options Menu

  3. If this is your first time enabling sharing, you will be prompted to install the service. Authenticate and let the package manager download and configure Samba. I was prompted to reboot my computer, however, I did not reboot and was still able to continue configuring the shared folder
    Install Samba service

    Install Samba service

    Ubuntu Nautilus Permissions

    Ubuntu Nautilus Permissions

Mac

  1. Sorry, I don’t have a Mac. If anyone wants to buy me one, or just generate some revenue through ad clicks, I would appreciate it!

You should then be able to access the share by browsing “\localhostsharename”. If you opted to skip creating a share, and want to use the built-in hidden shares, specify “C$” as the share name. Authenticate if necessary and you should be browsing your shared folder locally.

  1. Once that is complete, switch over to your VM installation (Windows 7 or otherwise)
  2. Bring up Computer (Start Orb→Computer)
  3. Click the “map network drive” button

    Windows 7 Map Network Drive

    Windows 7 Map Network Drive

  4. The “Map Network Drive” dialog box will open and you should configure several items:
    1. Drive: Specify your preferred drive letter. I chose “S:”, but any available letter will work fine.
    2. Folder: This should be defined as “\HostComputerShareName”. Alternatively, you can specify the IP address instead of hostname. Because you are now on the guest OS, this should not be “localhost” as above.
    3. Connect using different credentials: I like to check this, just to ensure I can specify the correct login and password instead of using my current user.
    4. Press the Finish button

      Windows 7 Map Drive Options

      Windows 7 Map Drive Options

A new window should open with your new share. You can also minimize this window – exposing the underlying Computer window. A new drive letter under Network Location should be available.

That’s it, you’re done. Windows shares don’t always behave as easily as they should, so if you encounter an error, don’t give up. Keep trying and post the error in the comments.

20 comments on “Windows 7 in VirtualBox: Shared Folders workaround

  1. Pingback: Linux Noob, wanting to learn! - Page 4 - Overclock.net - Overclocking.net

  2. Pingback: links for 2010-09-10 | Jeff's (Mastermesh's) Delicious Links

  3. Here is an extensive how to on sharing folders with Windows 7.
    http://www.ilertech.com/2010/09/sharing-files-and-folders-in-windows-7/

  4. linuxfueled on said:

    WINDOWS 7 users read…..

    If your main OS is Windows 7 (the host machine) and you just cannot get this shares to work. Setup your host directory with the map drive path and what not as listed above.

    When you goto access the shared folder from inside the VM client (in my case ubuntu), just use the internal network address. make sure you have samba i.e. smb installed in ubuntu or its equivalent in your client OS.

    So in ubuntu to reach my Windows 7 machine with a shared folder it looks like this in the file browser window. smb://192.168.1.101/Users/Public/Documents

  5. Speaker on said:

    Wasn’t able to understand how to access the shared folder in the quest OS from this tutorial.
    Hmmm, I’ll scratch my head and keep reading until it sinks in I think.
    Thanks for posting this!

  6. malibusurfer on said:

    One minor note: \vboxsrvTemp to link/share a folder called Temp in Ubuntu to Windows 7 in VirtualBox. Would not work if I tried to Map drive in Win 7 as \vboxsrvmynameTemp or \vboxsrvhomemynameTemp (myname is my home’s folder).

    I am using Ubuntu 9.04, VirtualBox 3.1.0, and Windows 7 Pro.

  7. \vboxsvrName work awsome, must set it up to share in virtualbox first then map it in the host OS

  8. SeaGrizzly on said:

    Seems that you have to do the full path as well, not just \vboxsvr

  9. Marcio Henrique on said:

    OK, tks guys!!

    The “\vboxsvrshared_folder” really did the trick!!! After spent 2 hours, that was my redemption!
    Tks again!

  10. luis vaca on said:

    If you map a general linux location such as “\vboxsrvmedia” you should have access to USB, CD-DVD, all linux media….IT REALLY WORKS

  11. heather is right, it’s vboxsvr, but apparently mine wasn’t scanning the shared folders for the machine, so \vboxsvrsharename worked while \vboxsvr didn’t.

  12. uh, vboxsrv or vboxsvr? both give me “network error: windows cannot access \___”.

  13. alan on said:

    that \vboxsrv really works, how silly!!

    make a share folder in vbox
    save something from win 7 in it

    rifht click network – map net drive

    use the point name above hehe, and u see your file ;9

  14. Windows 7 RC Guest on Mac OSX 10.5.6 Host.

    Shared Desktop (/Users/username/Desktop).

    In Windows 7, Map Network Drive Z: to \vboxsrvDesktop

    voila, no additions, easy

  15. heather on said:

    @francis – try putting \vboxsvr when you map the network drive. it worked fine for me :)

  16. Darran on said:

    I made a web account with 110mb.com and im using ftp to transfer my files, its free and simple, i use filezilla to transfer my files.
    Its very simple try it if you want

  17. @Francis – works perfectly for an XP guest. It’s just Windows 7 being, uh, beta.

  18. Pingback: VirtualBox 2.1.2 released | Idea Excursion

  19. francis on said:

    I’ve tried my best but i cannot possibly figure out what it is i am doing wrong… Shared folders + vBOx = never a good combo

  20. Pingback: Installing Windows 7 Beta 1 in VirtualBox 2.1.0 | Idea Excursion

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy This Password *

* Type Or Paste Password Here *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>