Sharing files between your host computer and a Linux virtual machine (VM) in VMware is very useful when you want to transfer scripts, documents, or installation packages without relying on external USB drives or network transfers. This guide will show you how to set up VMware Shared Folders so your host and guest can exchange files seamlessly.
Prerequisites
-
VMware Workstation or VMware Player installed on your host machine.
-
A Linux-based virtual machine (e.g., Ubuntu, Debian, CentOS).
-
VMware Tools installed on the Linux VM (important for shared folders to work).
Step 1: Install VMware Tools (if not already installed)
-
Start your Linux VM.
-
From the VMware top menu, click:
VM → Install VMware Tools.
3. Inside the Linux VM, mount the VMware Tools CD:
sudo mount /dev/cdrom /mnt
4. Extract and install the VMware Tools package:
cd /tmp
tar -zxvf /mnt/VMwareTools-*.tar.gz
cd vmware-tools-distrib
sudo ./vmware-install.pl
5. Reboot the VM after installation:
sudo reboot
Step 2: Enable Shared Folders in VMware
-
Power off your Linux VM.
-
In VMware Workstation, select your VM → Settings.
-
Go to the Options tab → select Shared Folders.
-
Choose Always enabled (recommended).
-
Click Add… to add a shared folder:
-
Browse and select a folder from your host.
-
Give it a name (e.g.,
shared_folder
). -
Check Enable this share.
-
Step 3: Access the Shared Folder in Linux
After restarting the VM, the shared folder will be available in /mnt/hgfs/
.
-
Open a terminal in your Linux VM.
-
Check if the mount point exists:
ls /mnt/hgfs
You should see the folder you created (e.g.,
shared_folder
).
3. Access it:
cd /mnt/hgfs/shared_folder
ls
Any files placed in the host’s shared folder will appear here.
Comments
Leave a Comment
No comments yet. Be the first to comment!