Sharing Files Between VMware Host and Linux Guest VM

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)

  1. Start your Linux VM.

  2. 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

  1. Power off your Linux VM.

  2. In VMware Workstation, select your VM → Settings.

  3. Go to the Options tab → select Shared Folders.

  4. Choose Always enabled (recommended).

  5. 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/.

  1. Open a terminal in your Linux VM.

  2. 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.

Step 4: Create a Permanent Mount Point (Optional)

If you want to make access easier, you can create a shortcut:


 
 
mkdir -p ~/vmshare
sudo mount -t fuse.vmhgfs-fuse .host:/shared_folder ~/vmshare -o allow_other

Now you can access the folder from ~/vmshare.

To make this persistent after reboot, add the following line to /etc/fstab:

.host:/shared_folder   /home/username/vmshare   fuse.vmhgfs-fuse   defaults,allow_other   0   0

(Replace username with your Linux user name.)

Conclusion

By enabling VMware Shared Folders, you can quickly exchange files between your host system and Linux guest VM without using external devices or network configurations. This makes development, testing, and file transfer much more efficient.

 

Related Articles

Step-by-Step Guide to Installing WordPress with Bitnami

Read Article
Tips for Exploiting Local File Inclusion (LFI) Vulnerabilities

Read Article
Steps for Web Information Gathering

Read Article

Comments

Leave a Comment

No comments yet. Be the first to comment!