Virtualization Technology News and Information
Article
RSS
How to Share Files on Your Computer with a Virtual Machine

 

Virtual machines are remote containers, meaning the visitor operating system does not have access to the computer's file system. You will therefore need to configure the public files in a program like VMware or Virtual Box to share files.

Default-wise, VM cannot access folders or files on the host PC or other VM. To provide this access, you need to configure the shared folders in the virtual machine application. To help the guest operating system within the virtual machine understand what's happening, virtual machine applications display these shared folders as shared resources for network files. The visitor operating system has access to a folder on the PC - as you would do with a public file on a network.

So, let's see how to create public files in two of the most renowned virtual machine applications: VMware Workstation Player and Virtual Box. Notably, the procedure is similar when using other virtual machine applications.

Virtual Box

The Shared Folders feature of Virtual Box works with Windows and Linux guest operating systems. To use this feature, you must first install the Virtual Box guest additions on the guest virtual machine.

With the virtual machine running, click on the ‘Devices' menu and choose the ‘Insert CD image of guest additions' option. This inserts a virtual CD that can be used in the guest operating system to install guest additions.

After installing Guest Additions, open the ‘Machine' menu and click on the ‘Settings' option.

Switch the shared folders tab in ‘Settings'. You can then easily locate your configured folders. Basically, we have two categories of shared folders: the folders of the machine (which are long-lasting,  pending their deletion) and temporary folders that are transitory and therefore automatically deleted when you restart or shut down the virtual machine.

Click the ‘Add' button (the folder with a plus sign) to create a new shared folder.

In the ‘Add Share' window, specify the following:

  • Folder path: this is the location of the shared folder in the host operating system (your real PC).
  • Folder name: this is how the shared folder will appear in the guest operating system.
  • Read-only: By default, the virtual machine has full read and write access to the shared folder. Permit the ‘Read only' check box so that the virtual machine will be able to read the files from the shared folder, but do not change them.
  • Automatic Editing: this option causes the guest operating system to automatically mount the folder at startup.
  • Make Permanent: With this option, the shared folder becomes a machine folder. If you don't choose this possibility, it converts into a temporary folder, which is deleted when the VM reboots.

Make your choices and then press the ‘OK' button.

You should now see that shared folders appear as shared network files. If you're using a Windows guest operating system, open File Explorer, select ‘Network' and then search under the ‘ABXYZD' computer.

Shared VMware folders work with Windows and Linux guest operating systems. To use this feature, you must first install VMware Tools on guest virtual machines. Open the ‘Reader' menu, select the ‘Manage' menu, then choose the ‘Install VMware Tools' preference. A dialogue opens, asking you to download the tool; when this is complete, insert a virtual CD that can be used in the guest operating system to install the VMware tools.

After installing the VMware tools, open the ‘Player' menu, select the ‘Manage' menu and then select the ‘Virtual machine configuration' option.

In the ‘Virtual Machine Configuration' window, go to the 'Options' tab and click on 'Shared Folders' on the left side. By default, shared folders are deactivated and you can activate them in two ways: choose 'Permanently enabled' to ensure Shared Folders remain active - even when you restart the virtual machine. Select 'Enable until the next power off or pause' if you prefer the manual re-enablement of the function after restart.

Alternatively, you can choose the 'Assign as network drive on Windows guests' option if you want to share a drive letter to the guest operating system, instead of having to search for shared folders on the network. After enabling this function, click on the 'Add' button to add a new shared folder.

In the 'Add Shared Folder Assistant' window, click 'Next' to skip the welcome screen. In the 'Assign a name to the shared folder' screen, indicate the location of the shared folder on the host operating system 'route host' box (real PC). Use the 'Name' box to type the name of the folder as it should appear inside the virtual machine. When finished, click on the 'Next' button.

Select the 'Enable this shared resource' in the 'Specify shared folder attributes' screen. Otherwise, sharing will still be added to the list of shares and you can activate it later if necessary. By default, the virtual machine will have full read and write access to the folder. Select the 'Read Only' option if you prefer the virtual machine to read only the files from the shared folder, but do not change them. When complete, click on the 'Finish' button.

You should now see that shared folders appear as shared network files. If you're using a Windows guest operating system, open File Explorer, select 'Network' and then search under the 'vmware-host' computer.

On a Linux guest system, you should find the VMware shared folders in / mnt / hgfs in the root directory. If you're not sure how to find it, just double check the process and then repeat it again.

Bottom Line

Experts from Umbrellar Cloud hosting suggested that if you have multiple virtual machines, you must configure file sharing separately within each one - even if you can use the same shared folders on different virtual machines. However, be careful when you make use of shared folders. One of the best things about virtual machines is that they operate in their own sandbox, isolated from their real computer. If your virtual machine is compromised, malware could escape from your virtual machine by infecting files in your shared folders.

##

Published Monday, June 18, 2018 7:20 AM by David Marshall
Comments
There are no comments for this post.
To post a comment, you must be a registered user. Registration is free and easy! Sign up now!
top25
Calendar
<June 2018>
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567