Vmware windows ubuntu shared folder

Ubuntu · September 29, 2024


In today’s interconnected world, the ability to share files seamlessly between different operating systems is crucial, especially for developers, IT professionals, and businesses that utilize virtual machines. This article will explore how to set up file sharing between Ubuntu and Windows running on VMware, providing a step-by-step guide to facilitate this process.

Understanding VMware and Its Role

VMware is a powerful virtualization platform that allows users to run multiple operating systems on a single physical machine. By creating virtual machines (VMs), users can run Windows and Ubuntu simultaneously, making it easier to test applications, develop software, or manage different environments without the need for multiple physical devices.

Prerequisites

  • A computer with VMware Workstation or VMware Player installed.
  • Windows and Ubuntu operating systems installed as virtual machines.
  • Basic knowledge of navigating both operating systems.

One of the simplest ways to share files between Ubuntu and Windows in VMware is by using the Shared Folders feature. Here’s how to set it up:

Step 1: Configure Shared Folders in VMware

  1. Open VMware and select the Windows virtual machine.
  2. Go to VM > Settings.
  3. In the Options tab, select Shared Folders.
  4. Enable Shared Folders by checking the box.
  5. Click on Add to create a new shared folder.
  6. Choose a folder on your Windows host that you want to share with Ubuntu.
  7. Make sure to select the options for Read-only or Read/Write based on your needs.
  8. Click Finish and then OK to save the settings.

Step 2: Accessing Shared Folders in Ubuntu

Once the shared folder is configured in VMware, you can access it from your Ubuntu virtual machine:

  1. Start your Ubuntu virtual machine.
  2. Open a terminal window.
  3. Install the necessary VMware tools if you haven’t done so already. You can do this by running:
  4. sudo apt update
    sudo apt install open-vm-tools open-vm-tools-desktop
  5. After installation, restart your Ubuntu VM.
  6. Once restarted, the shared folder should be mounted automatically. You can find it in the /mnt/hgfs/ directory.
  7. To verify, run:
  8. ls /mnt/hgfs/
  9. You should see the name of the shared folder listed.

Using Samba for File Sharing

If you prefer a more robust solution or need to share files over a network, you can use Samba, which allows for file sharing between Linux and Windows systems. Here’s how to set it up:

Step 1: Install Samba on Ubuntu

  1. Open a terminal in Ubuntu.
  2. Install Samba by running:
  3. sudo apt update
    sudo apt install samba

Step 2: Configure Samba

  1. Edit the Samba configuration file:
  2. sudo nano /etc/samba/smb.conf
  3. Add the following lines at the end of the file to create a shared directory:
  4. [shared]
    path = /path/to/shared/directory
    available = yes
    valid users = your_username
    read only = no
    browsable = yes
    public = yes
    writable = yes
  5. Save and exit the editor.
  6. Create the shared directory:
  7. mkdir /path/to/shared/directory
  8. Set permissions for the directory:
  9. sudo chmod 777 /path/to/shared/directory
  10. Add a Samba user:
  11. smbpasswd -a your_username

Step 3: Accessing the Shared Folder from Windows

  1. Open File Explorer in Windows.
  2. In the address bar, type:
  3. \ip_address_of_ubuntu_machineshared
  4. Replace ip_address_of_ubuntu_machine with the actual IP address of your Ubuntu VM.
  5. Enter the Samba username and password when prompted.

Conclusion

File sharing between Ubuntu and Windows on VMware can be accomplished through various methods, including VMware’s Shared Folders feature and Samba. Each method has its advantages, depending on your specific needs and use cases. By following the steps outlined in this article, users can enhance their productivity and streamline workflows across different operating systems.

For those looking to explore more about virtualization and hosting solutions, consider checking out USA VPS Hosting options available at USAVPS.

Ubuntu is one of the leading Linux distribution many people like to get hands-on experience. It has desktop and server versions. In this guide, I will show how to install the latest Ubuntu 19.10 on VMware workstation with working VMware tools and setting up a VMware shared folder between the guest OS and host Windows 10 OS.

Installing another OS such as Ubuntu Linux on a Windows 10 computer by using virtualization software like VMware is the best way to experiment with any kind of new OS. You do not need to install on the physical hard disk or modify the Windows 10 boot loader to have Linux OS with Windows.

Also, VMware’s ‘Easy Install’ feature makes this installation super easy. You can find more about ‘Easy Install’ from the official VMware site.

This guide is divided into 4 parts:

  1. Install Ubuntu on VMware by using the ‘Easy Install’ method. This step will also install the VMware tools provided you have the working internet on the host computer.
  2. Guide to install VMware tools manually.
  3. Setup and test the VMware shared folders between host and guest computer.
  4. The download link of the pre-installed Ubuntu 19.10 VMware image that I used in this guide.

Part 1: Installing Ubuntu 19.10 on VMware Workstation

1) Download the latest desktop version of Ubuntu from the official site. It is an ISO file.

2) Make sure you have the newest version of VMware workstation. If you have VMware player, you may not find some of the options, but it works well for this purpose.

3) Create a new virtual machine and browse the ISO file. VMware will detect the OS type from the ISO file and show that it can use ‘Easy Install’.

Attach ISO File

‘Easy Install’ is like an unattended method of installing a new OS. Once we provide the required details, it will do all steps during the installation process and finalize the OS installation without any user intervention.

4) Provide user account details that will be used in Ubuntu Linux VM.

5) I always prefer to store the virtual hard disk as a single file. Before completing the setup and powering on the VM, click the Customize Hardware button.

6) Set enough processor cores and memory for the VM. I configured 4 processor cores and 4GB of RAM.

Processor And RAM

7) Power on the VM now. Make sure you have working internet on the host computer. The installation will use the internet to download the latest packages for Ubuntu 19.10 OS and install VMware tools. It will create the partitions and do all the necessary steps to install the OS properly. Once everything installed automatically, you will get the login screen after a few minutes.

Ubuntu Installation On Windows 10 By VMware

8) Typing the same password you set while configuring the virtual machine will let you log in.

9) To verify whether the VMware tools installed successfully during the ‘Easy Install’, check the full-screen mode, and change the VMware console screen to different sizes, the VM will adjust and work on fit-to-screen view. That confirms the proper working VM tools. Also, you will feel the smoothness inside the VM while working.

Part 2: How to Install VMware tools manually on Ubuntu 19.10

Let’s assume for some reason you need to install the VMware tools manually. Then, follow these steps:

10) After powering on the VM, click on ‘VM’ from the menu and select the ‘Install VMware Tools’ option. This will mount the installation ISO file inside the VM.

11) Access the CD drive from the Ubuntu Linux VM, and copy the VMware Tools file to the Desktop (or any location). It is a compressed file; we need to extract it. You can open this gzipped compressed file by double-clicking it. Then select the content and extract as shown below. In this example, I’m extracting to the same Desktop folder.

Extract VMware Tools

Now you will see the extracted folder on the desktop.

12) Open Terminal and browse the extracted folder.

13) Type sudo ./vmware-install.pl -d

Running Vmware Tools Script

You need to re-enter your password which has root access to allow the installation.

14) Reboot the VM once the installation completed. Now we have successfully installed the VMware tools manually on Ubuntu 19.10. These methods are applicable for any desktop or server version of Ubuntu.

Installing Vm Tools Manually On Ubuntu

Part 3: Setup VMware Shared folders between Ubuntu & Windows 10 (or any versions)

15) Setting up shared folders between Linux and Windows machines is super easy nowadays. Once the VMware tools installed successfully, go to the settings of the virtual machine and click the options tab.

Enable Shared Folders

Here you can add a folder or partition from the Windows 10 host computer. I’m adding a partition in this example.

Added Share

16) Enable the share and select the ‘Read Only’ option if you do not need to write anything from the Linux guest OS to this Windows share/partition. Most of the time, we do not need to select the ‘Read Only’ option.

Press OK to save the settings.

17) Now inside the VM, go to Computer –> mnt -> hgfs folder. Here you will find the share which is coming from the Windows host computer.

Accessing VMware Shared Folder

If you haven’t selected the ‘Read-only’ option, now you should be able to write/modify folders/files on this share.

Windows 10 Partition From Ubuntu

This method helps to transfer and share folders and partitions between guest and host computers without setting up a network.

Part 4: Download link of the pre-installed Ubuntu 19.10 VMware image

If you need to avoid the installation and update process, you can download the latest Ubuntu 19.10 pre-installed image for VMware below. It is in 7zipped format. You need to extract the file to get the VMDK file. Then create a new Linux Ubuntu virtual machine from a VMware workstation, player, or even on the vSphere and attach this VMDK file instead of creating the new virtual hard disk.

Ubuntu 19.10
More Information: Username: sysprobs
Password: sysprobs123
Plaftform: 64Bit
OS Update: Installed (as on 07/03/2020)
VMware Tools: Installed
Minimum VM Config: 2 VCPU, 2GB RAM
Language: US English

TL;DR

If you are using Open VMWare Tools on a Linux Mint (or Ubuntu) virtual machine, here is how you get the “Shared Folders” to work between the host operating system (Windows 10 in my case), and the host operating system (Linux Mint 19):

Note: Run these commands from the guest operating system.

  1. Make sure you have Open VMWare Tools installed on your guest operating system. If not, install it, and then reboot your guest virtual machine.
1
2
sudo apt update
sudo apt install open-vm-tools open-vm-tools-desktop
  1. Create the directory in which the shared folders will be accessed on the guest operating system:
1
sudo mkdir -p /mnt/hgfs
  1. Mount the file system, and you should then be able to see the folders you have shared in the guest operating system in the directory /mnt/hgfs:
1
sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
  1. Finally, in order to get the shared folders to automatically mount every time you boot up your virtual operating system, add the following line to /etc/fstab:
1
.host:/ /mnt/hgfs   fuse.vmhgfs-fuse    auto,allow_other  0   0

Source

Steps taken from this post.

The Rest of the Story

I recently decided to upgrade, and virtualize my Desktop environment. The outcome vision is basically all my day-to-day activities will run on my Linux Mint 19 virtual machine, and leave my Windows 10 host machine for gaming only.

Ironic that I went to this extent to get back into PC gaming, and then I heard about Steam Play Beta, which allows crap-ton of Windows-only games to now be played on Linux via Steam. Oh well…maybe when Linux Mint 20 gets released, I’ll redo my setup; I’m too far in now ;-)

Ok, jumping out of that rabbit hole, here is what I wanted to share. Usually when I install a guest operating system using VMWare, I immediately install the VMWare Tools that are included with, in my case, VMWare Player for integration between the guest and host operating system. However, this time, after installing Linux Mint 19 as the guest operating system, I was prompted to install the Open VMWare Tools. Now these have been around for a while, but I never bothered to use them until now.

I have had issues updating the standard VMWare Tools on my guest operating systems in the past after kernel updates, plus it’s a manual process, but with Open VMWare Tools it’s all taking care of by the Linux Mint (guest operating system) package manager.

However, upon trying to use “Shared Folders” (see screenshot), I was unable to find the folders on the guest operating system (/mnt/hgfs).

/posts/open-vm-tools-and-folder-sharing/VMWare-Shared-Folders-01.png

VWMare Shared Folders

After some searching, I ran across this post, and the following steps to get VMWare Shared Folders to work for Linux Mint 19 (or Ubuntu) guest operating systems with Open VMWare Tools are taken from that post. Many thanks to the author for the original post.

Just to make sure I’m clear my host operating system (physical PC) is Windows 10, and my guest operating system (VMWare virtual machine) is Linux Mint 19.

Steps to Access Shared Folders

Note: Run these commands from the guest operating system, in my case, Linux Mint 19

  1. Make sure you have Open VMWare Tools installed on your guest operating system. If not, install it, and then reboot your guest virtual machine.
1
2
sudo apt update
sudo apt install open-vm-tools open-vm-tools-desktop
  1. Create the directory in which the shared folders will be accessed on the guest operating system:
1
sudo mkdir -p /mnt/hgfs
  1. Mount the file system, and you should then be able to see the folders you have shared in the guest operating system in the directory /mnt/hgfs:
1
sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other

![VMWare Shared Folders 2](/posts/open-vm-tools-and-folder-sharing/VMWare-Shared-Folders-02.png «VWMare Shared Folders in File Manager»)

  1. Finally, in order to get the shared folders to automatically mount every time you boot up your virtual operating system, add the following line to /etc/fstab:
1
.host:/ /mnt/hgfs   fuse.vmhgfs-fuse    auto,allow_other  0   0

![VMWare Shared Folders 3](/posts/open-vm-tools-and-folder-sharing/VMWare-Shared-Folders-03.png «Auto-mount VMWare Shared Folders Directory»)

That’s all there is to it. Feel free to leave comments, or questions below.

End of Line.

(NB: adapted from this Ask Ubuntu thread — tested to work on Ubuntu 16.04 LTS through Ubuntu 22.04 LTS (Jammy).

Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools package doesn’t auto-mount shared VMWare folders. This can be frustrating in various ways, but there’s an easy fix.

TL;DR

Install open-vm-tools and run:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other

(Make sure /mnt/hgfs exists and is empty)

You can put configuration stanzas in /etc/fstab to facilitate this, and then mount /mnt/hgfs will work.

See the Setting up auto-mounting section for setting up auto-mounting instead.

Pre-work

Make sure open-vm-tools (and open-vm-tools-desktop if you’re using a desktop environment) are installed, and that you’ve rebooted after their installation.

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

Make sure you have a /mnt/hgfs directory made and empty. If not:

sudo mkdir -p /mnt/hgfs

Mounting

To mount the filesystem, run:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other

The shared folders will now be in subdirectories of /mnt/hgfs

Setting up auto-mounting

Add the following line to /etc/fstab:

.host:/	/mnt/hgfs	fuse.vmhgfs-fuse	auto,allow_other	0	0

Update: based on extensive testing, the auto keyword seems to work fine. Prior versions suggested noauto. If you have trouble with auto, change to noauto and see below

If using the noauto keyword, but you want automount

  1. Create or edit the script /etc/rc.local (as root), and add the line:

  mount /mnt/hgfs

  1. make sure rc.local is executable and owned by root:

    sudo chown root:root /etc/rc.local
    sudo chmod 0755 /etc/rc.local
    
  2. enable the rc.local service in systemd:

    sudo systemctl enable rc-local.service
    
  3. reboot

The rc.local script runs as the last step of startup, allowing the HGFS filesystem to mount after open-vm-tools services are running, which is required for successful operation.

Browse /mnt/hgfs at will.

Do you have an Ubuntu VM in VMware Workstation and want to share a folder with it but can’t figure it out? If so, this guide is for you! Follow along as we go over how to access VMware shared folders on Ubuntu!

Before we begin

This article covers VMware Workstation 16, using Ubuntu as a guest operating system. For this reason, you’ll need to have VMware Workstation 16 installed on your host operating system.

The host operating system in this guide is Arch Linux. It has been tested extensively, and VMware 16 is available for installation through the Arch Linux AUR.

That said you do not have to use Arch Linux as your host OS. VMware Workstation 16 can also be installed on other Linux operating systems and Mac OS and versions of Microsoft Windows. 

If you’re not sure how to install VMware Workstation 16 on your host operating system, or if you’re using an older release, you’ll need first to install VMware Workstation 16 to continue with this guide. For more information, click on this link here. 

Setting up an Ubuntu VM

Before a shared folder can be accessed, you must create an Ubuntu guest VM in VMware Workstation 16. Head over to Ubuntu.com, and go through the process of configuring and setting up an Ubuntu VM in VMware.

Alternatively, if you don’t want to set up a VM from scratch, you can download a pre-configured VMDK image directly from OSboxes.org. They distribute many releases of Ubuntu for VMware as well as virtualbox.

Once you’ve gotten your Ubuntu VM configured, turn it on and start it up. When the VM is turned on, log into your user account using the user credentials created during the installation process.

Adding a shared folder to the Ubuntu VM

To add a shared folder to your Ubuntu VM, you will need to go into the VM settings in VMware. To do this, go to the VMware Workstation 16 UI, and right-click on the Ubuntu VM.

After right-clicking on the Ubuntu VM, select “Settings.” When you click on the “Settings” button, a “Virtual Machine Settings” window will appear on the screen. On this screen, you’ll see two tabs. These tabs are “Hardware” and “Options.”

Find the “Options” tab, and click on it with the mouse. Then, when you make it to the “Options” area, you’ll see a sidebar on the left-hand side. In this sidebar, there are tons and tons of options available. 

Look through the “Options” sidebar for “Shared Folders.” Select “Shared Folders” and click on the “Always enabled” box. This box will turn on Shared Folders in the Ubuntu VMware VM at all times.

Note: if you only need shared folders for a limited time, consider instead selecting the “Enabled until next power off or suspend” option.

After enabling shared folder support in the VM, you must add your shared folder. Go to the “Folders” box, and click on the “+ Add” button with the mouse. Then, use the file browser to make a folder on the Host OS available to the Ubuntu VM.

When you’ve selected your folder, click on the “Save” button to apply your Shared Folder settings to the VM.

Once the shared folder is mounted in VMware, it will automatically be available in the Ubuntu VMware Workstation VM via the /mnt/hgfs/ folder. You can access your shared files either via the command-line terminal or the Ubuntu file manager.

To access your shared folder and files via the file manager, do the following. First, open up the Ubuntu file manager. Then, click on the “Other Locations” button. Inside the “Other locations” area, find the “Computer” icon and click on it to access the root folder.

Inside the root folder, locate the “mnt” folder and click on it. Then, select the “hgfs” folder. In this folder, you’ll see your shared folder from the Host OS. Click on it to access your files.

To bookmark the shared folder, do the following. First, click on the “hgfs” item in the address bar. After clicking on “hgfs,” a menu will appear. In this menu, select the “Add to Bookmarks” button to add it to the sidebar. 

Once the “hgfs” folder is on the sidebar as a bookmark, you’ll always be able to access your shared files in an instant quickly.

Access the folder via the command line

To access your shared files via the Linux terminal window, use the following CD command.

cd /mnt/hfgs/

From here, you can access your shared folder right from the command line. If you’d like to view the contents of this folder, run the ls command. It will display everything in the folder.

default avatar image

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как сделать нового пользователя в windows 10 с правами администратора
  • Windows 10 тестовый режим для чего
  • Esd windows 10 загрузочная флешка
  • Dameware mini remote control windows 10
  • Команда для входа в безопасный режим windows 10