Methods of payment Abuse

Why does Linux share a VmWare folder?

27.01.2022, 22:51

A shared folder for the virtual machine and the host system is required to share files between the host and guest operating systems. VMware is a very popular virtual machine. In this article, let's see how to make a VMware Player shared folder on the system. It is understood that both operating systems, host and guest are some Linux distribution, specifically Ubuntu.

Configuring the shared folder

The configuration should start with setting the right parameters for the computing machine. To do this, open VMware and the context menu for the desired machine. Next, select Virtual Machine Settings:

In the new window, click the Options tab:

Next, open Shared Folders and set the Folder Sharing switch to Always enabled:

After that, you should add a shared folder. To do this, click the Add... button, enter the name of the shared folder in the window that opens, and then enter or select the path to the desired folder on the main system. Then click OK and Save at the bottom of the window to save everything.

You can then start the virtual machine. The shared folder should be mounted in /mnt/hgfs. If there is no such folder, check if the packages open-vm-tools and open-vm-tools-desktop are installed:

$ sudo apt install open-vm-tools open-vm-tools-desktop

Next, using the command you can check if your shared folder is visible in the guest system:

$ vmware-hgfsclient

After that you have the option to mount all public folders in /mnt. To do this, first create the /mnt/hgfs folder if it does not exist:

$ sudo mkdir /mnt/hgfs

It remains to perform the mount using the vmhgfs-fuse utility:

$ sudo vmhgfs-fuse .host: /mnt/hgfs -o allow_other -o uid=1000

In addition to the mount point path, change the allow_other option so that all users can access the folder, and make the owner of the folder a user with ID 1000, usually the ID of the first logged in user, if you have a different ID replace it with your own. This will allow that user to write files to the folder.

Now you can view its contents:

$ sudo vmhgfs-fuse .host: /mnt/hgfs -o allow_other -o uid=1000
$ ls /mnt/hgfs/Data

Or in the manager:

Finally, you need to add this line to /etc/fstab:

$sudo vi /etc/fstab

$

.host: /mnt/hgfs fuse.vmhgfs-fuse defaults,allow_other,uid=1000,nonempty 0 0

If you want to mount only a specific shared folder, for example Data, you need to specify its name after the .host address:

.host:/Data /mnt/hgfs fuse.vmhgfs-fuse defaults,allow_other,uid=1000,nonempty 0 0

As you can see, setting up a VMware shared folder in Linux is no problem, and it's easy to mount it if the automatic mounting doesn't work.