How to share files between a virtual machine and the PC

Working with different operating systems forces users to always have all their files accessible, either to consult them or to edit them. If your needs involve sharing files between a virtual machine and a PC, in this article we show you the best options to do it quickly and easily.

A virtual machine is software that allows you to install other operating systems in a simulated environment, that is, without having to create a specific partition on the storage unit.

Share files between a virtual machine and the PC

In a virtual machine we have: an operating system called host and one or more operating systems called guests. If we stop using or no longer need any of the guest operating systems, we can delete it as if it were a file, it is not necessary to format the disk, delete partitions, modify the system startup…

If we talk about virtual machines, we have to talk about VirtualBox and VMWare . Although they are not the only ones (KVM, Hyper-V, Virtual PC, Xen…), they are the two applications that offer us the greatest versatility. And they are for which we are going to explain how to share files between the VM and the real machine.

VirtualBox

Behind VirtualBox we find the Oracle company, a company that has been in the market for more than 40 years and that focuses on offering cloud storage solutions. VirtualBox is an open source and completely free application that allows us to install 32 and 64-bit operating systems, although version 6.x is only compatible with 64-bit processors. However, through its website, we can download previous versions that are compatible with 32-bit operating systems.

This program is available for Windows, macOS, GNU/Linux, Genode and Solaris… among others.

share a folder

The easiest method to share files between different devices is to use a shared folder. Sharing a folder between VirtualBox and the different guest operating systems that we have is as simple as following the steps that I show you below.

The first thing will be to open the application and select the virtual machine with which we want to share the files of our team. Next, we click on the orange gear wheel at the top, just above where the details of that virtual machine are displayed.

Ajustes VirtualBox

In the configuration window, in the left column, we go to the Shared Folders section. In the section on the left, the folders that we have shared with the virtual machine at that time will be displayed. As of now, there is none, nothing is displayed. To add a folder, click on the folder icon with the + sign on the right.

compartir carpetas VirtualBox

In the window that appears, in the Folder path section, click on the drop-down box and select Other. At that moment, the file explorer will be displayed from which we must select which folder we want to share with the virtual machine.

If we want to change the name with which it will be displayed in the guest operating system, in the Folder name section, we write the new name.

We check the “Automount” box so that every time we start the virtual machine, the host computer shares the folder with the guest operating system.

compartir carpetas VirtualBox

Finally, click OK to save the changes. We must carry out this process with each of the folders that we want to share.

compartir carpetas VirtualBox

To be able to enter these folders, we simply have to open the virtual operating system, and search for new folders on the network. These will appear as shared folders on the LAN, and we will be able to access them, and all their content, without problems or more configurations.

Pen drive

If we work from a pen drive or external hard drive, although it is not the most convenient method to share files in a virtual machine, we also have that option from VirtualBox by performing the following steps.

We access the configuration options of the virtual machine with which we want to use external storage units to share files. Within the configuration options, in the left column, click on USB.

compartir archivos usb virtualbox

Now we must connect the storage unit that we are going to use to the computer, since the system must previously recognize it to allow us to share it. In the left section, check the Enable USB controller box and click on the icon of a USB connection with the + sign.

compartir archivos usb virtualbox

Next, all the units and devices connected via USB on our device will be displayed. We must choose the storage unit that we want to use in the guest operating system to share files and click OK.

compartir archivos usb virtualbox

If we want to share more storage units, we must carry out the same steps with all the units that are connected to the computer at that time.

When we boot the virtual machine, the pendrive will be disconnected from the host and mounted on the host as if we had physically connected it to the PC.

Drag and drop / clipboard

By far the easiest method is to drag and drop from the host to the guest operating system. If it is text, we can use the Windows clipboard function. Of course, to be able to use this function we must have the Guest Additions installed on the PC.

We can enable both features in VirtualBox by doing these steps. Within the VirtualBox configuration options, in the General section, click on the Advanced tab, a tab that is located to the right of the one that is shown by default.

Arrastrar archivos virtualbox

To enable the function that allows us to drag files between the virtual machine and the PC, in addition to using the clipboard function to copy and paste text between both operating systems, click on the Share clipboard and Drag and drop drop-down box, selecting in both cases Bidirectional .

compartir archivos usb virtualbox

Now we can start using this function.

vmware

If we talk about VMware, we have to talk about the computer manufacturer Dell. Unlike VirtualBox it is not completely free. VMware is available in two versions:

  • VMware Workstation Player . This version is completely free for non-commercial purposes, it only allows us to install a virtual machine and does not allow us to share folders between the computer and the virtual machine.
  • VMware Workstation Pro . This is the most complete version of this emulation software and it is not available for free. It has a price of 180 euros and we can try it completely free of charge for 15 days before buying the license.

Unlike VirtualBox, VMware is not translated into Spanish. If you follow the instructions that we show you below, you will not have any problem sharing files between a virtual machine and the PC.

With Shared Folders

VMware also allows you to create shared folders to allow access to exchange files between host and guest. We access the configuration options of the virtual machine, which we have previously selected, click on the VM menu on the top bar and then on Settings .

Ajustes VMware

To access the configuration options for the operation of the guest operating system, click on the Options tab.

Ajustes VMware

Within the Options tab, click on the Shared Folder section and, in the left section, check the Always enable box.

Compartir carpetas VMware

In the Folder section, click on the Add button and a wizard will open that will invite us to select the folder to share with the virtual machine’s operating system.

Compartir carpetas

Click on the Browse button and select which folder on the host computer we want to share. In the Name section, we can modify the name of the folder if we do not want it to be called the same as where it is located and click on the Next button.

Compartir carpetas

Finally, we check the Enable this share box and click on the Finish button.

Compartir carpetas

Once the folder is mounted, we can access it from the virtual system as if it were a shared folder on the LAN.

from a USB

Unlike VirtualBox, we do not have to modify any of the virtual machine configuration options to be able to use a pen drive or external storage unit in the host operating system. We just have to connect it to the computer and the virtual machine will recognize it.

We can also find the pendrive icon at the bottom right of the virtual machine window. and, if we click on it, we will see the “Connect” option that will allow us to connect it to the guest system.

Drag and drop / clipboard

In order to make use of this function we will have to first install the VMware Tools in the virtual system. Once done, we will have to activate them, in case they are deactivated. To do this, we access the configuration options of the virtual machine, click on the Options tab and click on Guest Isolation .

Arrastrar y soltar VMware

In the left section, we check the Enable drag and drop and Enable copy and paste boxes. Finally, click on Ok so that the changes in the virtual machine configuration are stored.

Arrastrar y soltar VMware

We can now start using these tools.

Cloud storage

Using a cloud storage platform allows us to access from any device all the content stored on our computer from another computer or mobile device, regardless of its operating system.

The main cloud storage platforms such as Google Drive, OneDrive, Dropbox, Mega… offer applications for Windows, macOS and Linux. If we use these applications, we do not have to modify any settings in the configuration options of the guest operating systems.