Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

How to Share folders with your Ubuntu Virtual Machine (guest)

VMware Workstation provides a great ability to create shared folders so that your virtual machine can easily access data on your host pc. This saves a lot of time, especially when you are installing software that would otherwise take a long time to download.

For this to work, you will need to make sure that you have the vmware tools installed and running.

You can check to see if the vmware shared folders module is running by running this command:

lsmod | grep vmhgfs

If you get nothing then the mdoule is not loaded. You will need to load it with this command:

modprobe vmhgfs

If that gives you another error, then you don't have the vmware tools installed, and you will want to make sure to install them before proceeding.

In VMware Workstation, go to the VM \ Settings window and then click on the Options tab. From here you can modify the shared folders.

Click the Add button, and you will be presented with a wizard. Click next, and you should see this screen:

The name field will become part of the mounted path in Ubuntu, so name it something short and to the point. For instance, this shared folder will be mounted on /mnt/hgfs/mydrive/

Select the host folder that you want to share and then click the Next button

If you are worried about the guest operating system messing with your files, you can select the read-only checkbox. I personally did so simply because I was worried about accessing in-use files.

You shouldn't even have to restart your virtual machine. The folders should immediately show up under /mnt/hgfs

That's all there is to it. Remember, if you have problems it's probably because your vmware tools are not installed.

Tested on: Ubuntu Dapper, Ubuntu Edgy Eft

Update: If you have problems you might also want to check your firewall settings, which could be disabling communications between the virtual machine and your host computer. Thanks to burkhard in the comments for noticing this.

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 10/26/06 and tagged with: Ubuntu, Ubuntu Tips & Tweaks, VMware

Comments (7)

  1. Burkhard

    Hi,
    I installed VMserver running on Kubuntu Edgy Eft and had the problem that vmserver didn't activate the shared folders (I couldn't even activate a share).
    So I set up Samba and share a folder on an FAT32-partition.
    I couldn't connect from WinXP to that share, neither configuration worked.

    Reason: I use ZoneAlarm under XP and forgot to set a secure zone for all IPs of the local network.
    This took me some hours to find out.

    Just a hint, if anybody else runs into that issue

    greetings from Germany

    Burkhard

  2. The Geek

    Burkhard,

    Thanks for the note, I've added a line to the article as well.

  3. jpl

    I'm running Kubuntu Edgy Eft on VM Workstation 5.5.3 .
    I installed the VM Tools for 5.5.3.
    I was able to configure and use a shared folder but now it does not work anymore. I tried several things: restarting the VM, disabling/reenabling the shared folder, …
    One thing is that I apparently do not have the "vmhgfs" kernel module. Is it required with 5.5.3 ? How did it work on the first place then ?
    Do you have any hint to solve this ?

  4. Chuck Gregory

    I have a 64-bit version of Feisty running in a VMware virtual machine under Vista Home Premium 32-bit. It seems to be working very well and it runs much faster than the 32-bit version of Feisty that I have set up as a shared boot (i.e., one that runs standalone rather than under Vista).

    The thing is…

    VMware tells me that my installation doesn't support VMware tools. I've managed to do some sharing anyway, but it's a real pain to set it up. Do you know if there's a way around this, perhaps some sort of install directly on on the virtual Ubuntu system?

    Chuck

  5. Planet Malaysia

    This is cool! I was looking for this! Anyway, you still can use samba, FTP, and etc.

  6. Ying

    To jpl:

    I might an answer for you. Check out this webpage: http://ubuntuforums.org/showthread.php?p=4091869

  7. Ying

    For the line "-vi compat_slab.h", I used "-gedit compat_slab.h" instead because gedit works better in my Ubuntu 7.0.10.

    Good luck!


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.