How to Create a VMware Shared Folder
Introduction
When using VMware to run virtual machines (VMs), one of the common tasks is sharing files between the host operating system (OS) and the guest OS running inside the virtual machine. VMware allows you to create a shared folder that acts as a bridge between the host and the guest, making it easier to transfer files. This guide will walk you through the steps for setting up a shared folder between your host machine and a VMware guest, covering both Windows and Linux guest operating systems.
Prerequisites
Before setting up a shared folder, ensure the following:
- VMware Workstation, VMware Player, or VMware Fusion is installed on your host system.
- A virtual machine is set up and running.
- VMware Tools is installed on the guest OS. VMware Tools is necessary for the shared folder feature to work properly.
Step 1: Install VMware Tools
If VMware Tools is not yet installed on your guest operating system, you need to install it first. VMware Tools provides enhanced graphics performance, clipboard sharing, and the ability to use shared folders.
- Start your Virtual Machine and log in to the guest OS.
- From the VM menu, select Install VMware Tools. If you see an option to Reinstall VMware Tools, select it.
- VMware will mount a virtual CD containing the VMware Tools installer.
- For Windows Guests: Open the mounted drive in File Explorer and run thefile. Follow the prompts to install.
setup.exe
- For Linux Guests: Open the terminal and extract the contents of the mounted VMware Tools CD, then run thescript.
vmware-install.pl
- For Windows Guests: Open the mounted drive in File Explorer and run the
- Reboot the guest operating system after the installation is complete.
Step 2: Enable the Shared Folder
Once VMware Tools is installed, you can enable and configure a shared folder between the host and the guest.
- Power off the Virtual Machine if it is currently running.
- Open VMware Workstation or VMware Player and select your virtual machine from the list.
- Click onor Settings.
Edit virtual machine settings
- In the Settings window, go to the Options tab.
- Select Shared Folders from the list on the left.
- On the right side, choose Always enabled or Enabled until next power off or suspend based on your preference.
- Click Add to create a new shared folder.
Step 3: Configure the Shared Folder
After clicking Add, you will be guided through a wizard to create the shared folder:
- Shared Folder Wizard will open. Click Next.
- Select the host folder that you want to share with the guest OS:
- Click Browse to choose an existing folder on your host system.
- Alternatively, you can create a new folder on the host machine and select it here.
- Name the shared folder: This is the name that the folder will appear as within the guest OS.
- Enable the shared folder by checking Enable this share.
- If you want the shared folder to be read-only, select Read-only. This means the guest OS can view but not modify the contents of the folder.
- Click Finish to complete the setup, and then OK to close the virtual machine settings window.
Step 4: Access the Shared Folder in the Guest OS
The process for accessing the shared folder varies depending on the guest operating system (Windows or Linux).
For Windows Guests
- Start the Virtual Machine and log in.
- Open File Explorer.
- Go to Network or This PC in File Explorer, and you should see a folder named vmware-host.
- Open vmware-host and navigate to Shared Folders. Here, you will find the shared folder you created earlier.
- You can now copy, paste, and access files between the host and guest operating systems using this shared folder.
For Linux Guests
- Start the Virtual Machine and log in.
- Open a terminal window.
- By default, shared folders are usually mounted under thedirectory. To access the shared folder, use:
/mnt/hgfs/
cd /mnt/hgfs/
ls
This should list the shared folder that you configured in the previous steps.
- You can now navigate to the shared folder and access its contents:
cd /mnt/hgfs/shared_folder_name
Replace
with the name you assigned to the shared folder.shared_folder_name
- If you cannot see the shared folder, you might need to manually mount it:
sudo mount -t vmhgfs .host:/shared_folder_name /mnt/hgfs/shared_folder_name
Step 5: Troubleshooting Common Issues
If you encounter issues with the shared folder, consider the following troubleshooting steps:
- Ensure VMware Tools is Installed: Shared folders rely on VMware Tools, so double-check that it’s installed correctly.
- Check Folder Permissions: Verify that the shared folder has the proper read/write permissions on the host system.
- Restart the Virtual Machine: Sometimes, a restart of the guest OS is necessary for changes to take effect.
- Manually Mount Shared Folders: On Linux guests, if the shared folder does not appear under /mnt/hgfs/, try manually mounting it as shown above.
- Check VMware Settings: Make sure that shared folders are enabled in the VMware settings (Edit virtual machine settings > Options > Shared Folders).
Step 6: Managing Shared Folders
You can manage or remove shared folders at any time:
- Power off the Virtual Machine.
- Go to Edit virtual machine settings > Options > Shared Folders.
- Select the shared folder and click Remove if you no longer want to share it, or Edit to change its properties (e.g., read-only mode).
Conclusion
Setting up a shared folder in VMware allows seamless file transfer between your host and guest operating systems, improving productivity and workflow. By following the steps in this guide, you can easily configure, access, and manage shared folders, whether you’re running Windows or Linux on your virtual machines. Remember to keep VMware Tools up to date to ensure compatibility and performance of shared folders.