VMware Communities
jimwtfs
Contributor
Contributor

Shared files appear as drive and folder on Ubuntu guest's Desktop

I am running Win XP SP3 as the host with VMware Workstation 6.5.1 and an Ubuntu 8.04.1 guest. I installed VMware Tools. I have a shared folder in windows creatingvely named "Shared". I configured the VM settings to Shared Folders = Enabled and I have the Shared folder in the Folders list and Folder Sharing is Always enabled. I can navigate to /mnt/hgfs/Shared and can share files just fine.

I would like to mount the Shared folder on the Ubuntu guest's Desktop Shared folder. If I issue this command:

mount --bind /mnt/hgfs/Shared ~/Desktop/Shared

I wind up with a Shared "drive" and a Shared "folder" on the Desktop, and both contain the file contents of the Shared folder.

I've also tried commands like:

mount -t vmhgfs .host:/Shared ~/Desktop/Shared

with the same results.

Is this just a fluke because I'm mounting to the Desktop? Does anyone know of a workaround?

Reply
0 Kudos
7 Replies
ODeckard
Enthusiast
Enthusiast

A workaround ?

A workaround suggests that there is a problem. You just said you got your share working, and right where you placed it. What is the problem you wish to work around? And what is it you wish to achieve that you have not?

Reply
0 Kudos
ODeckard
Enthusiast
Enthusiast

OK, re-reading it I believe your Ubuntu has an officially "Shared" folder on its desktop, and you wish to have your Host Only shared folder shared with everyone on the LAN like your desktop Shared folder is.

Also in re-reading it I get the impression that you may not have realized that the shared folder in /mnt/hgfs is meant to be a private share between your host and guest, so that you can exchange files between them without exposing them to to the rest of the LAN.

If you wish to share it with the LAN, then you can turn off your host only adaptor and share it directly from your host. You can also link to it with the guest and mount it as shared there, echoing the hosts share, but having it picked up from the guest.

If your intention is to use it as a private communication between the host and guest you should not mount it as the desktop shared folder.

Reply
0 Kudos
jimwtfs
Contributor
Contributor

Thank you for replying. Let me try again at explaining the situation.

I installed VMware 6.5.1 on my Windows XP SP3 host. Then I installed Ubuntu 8.04.1 as a guest. Then I installed VMware Tools in the guest. Then I decided to share a folder between the host and guest. On my Windows desktop I created a folder named "Shared". Then in the Ubuntu guest I did the following: VM -> Settings -> Options -> Shared Folders, and I set Folder Sharing to "Always enabled", and under Folders I Added a folder named "Shared" that points to the "Shared" folder on my Windows desktop. So far so good. I now have the following on the Ubuntu guest /mnt/hgfs/Shared and I can share files in that folder with the Windows host as expected.

Now I would like to use the Folder Mounting feature as documented in the VMware Workstation User's Manual:

Folder Mounting

This mechanism allows you to mount one or more directories or subdirectories in a

shared folder to any location in your file system in addition to the default location of

/mnt/hgfs. You can use the mount program to mount all shares, one share, or a

subdirectory within a share to any location in your file system.

So I execute the following commands on the Ubuntu Guest:

cd ~/Desktop

mkdir Shared

mount --bind /mnt/hgfs/Shared ~/Desktop/Shared

and the result is that "a drive" appears on my Ubuntu Desktop named "Shared" along with the already existing folder named "Shared". Both of them contain the files that I would like to share with the Windows host.

My desire is to have the files appear in the folder named "Shared" on the Ubuntu Desktop and to NOT have the "drive" also appear on the Desktop.

How can I accomplish my objective?

Reply
0 Kudos
ODeckard
Enthusiast
Enthusiast

Try right clicking on your desktop, selecting New URL, and browsing to /mnt/hgfs/Shared.

Reply
0 Kudos
ODeckard
Enthusiast
Enthusiast

And there is another way to do it that I was hesetant to suggest. Mount points are traditionally placed in /mnt because that is a place outside anyone's personal home folder, so that everyone can access them.

But if you prefer to have it accessible only to one user, you can go into your /etc/fstab file and change the mounting line. Where it says /mnt/hgfs/Shared, you can change it to point to your desktop instead.

In fact, you can enter an almost duplicate line, and have it mounted to the shared folder on your desktop ALSO. That would make it conveniently located for you, and still available to other users.

But if you want it private, you need to change it, because /mnt/hgfs/Shared is available to all users.

Reply
0 Kudos
jimwtfs
Contributor
Contributor

Thanks again for responding. I'm guessing that we are not both running Ubuntu 8.04. I'm going to use your suggestion of right clicking on the Desktop as a workaround, although slightly different than you describe. Here's what I did:

Right-click on Desktop
Select Create Launcher...
Specify Type as Application, Name as "Shared", and Comand as "Nautilus /mnt/hgfs/Shared"

This resulted in the desired effect. It would still be nice if someone could explain why the "mount" results in a "drive" unexpectedly appearing on the Desktop.

Reply
0 Kudos
ODeckard
Enthusiast
Enthusiast

You are correct. I am using, and testing my suggestions, in Fedora 8. But KDE works about the same on any distribution.

So I logged on it Gnome to see what would happen. And it offered to create a launcher.

The difference is that I would down TYPE and selected location instead of putting anything in the "command" window. That would make it the same thing.

Don't disregard the line in /etc/fstab. If you want all users of the VM to have access to the shared folder on the host, then the current settup is fine. But if you want it to be private, then mounting the share insede your home foler, like on your desktop, would be better.

I don't know why your mount command failed. But if it worked, would't you have to repeat it every time you logged on, or put it into an init script ? I think this is a lot better.

Reply
0 Kudos