However, If you need to work on both your host computer and the guest OS, you likely need to transfer files between them. But there’s no need to worry yet. The fact that you can’t directly access the files doesn’t mean that there’s no way to transfer files between the systems. In this article, you can find multiple methods to transfer files to a Virtual Machine.
How To Transfer Files To Virtual Machine
Below are some ways to transfer files to a Virtual Machine. They provide different options for the file transfer, so read carefully and pick one according to your need:
Transfer from USB External Storage
Using a USB drive is likely the first method users think of when they want to transfer files to a Virtual Machine. It is possible, but depending on the different VM software, you need to take a few additional steps first.
On VMware Workstation
You need to enable USB controllers on VMware Workstation to use such devices. To do so,Now, your VM can detect a USB device when the VM is active.But your normal system stops detecting it at the same time. So, to copy files from your PC, unplug the USB device, minimize the VM, and reinsert the USB.Similarly, to paste the files to the VM, unplug the USB device, maximize the VM, and reinsert the USB so that the VM detects it.You can also reverse this process to transfer files from the VM to the host PC. Also, make sure to safely remove the USB device from all active VMs and the host computer before disconnecting it.
On Oracle VirtualBox
You need to have the VirtualBox Extension Pack to get support for USB devices. So make sure to install it first. Then, follow the steps below to enable access to USB devices on your Virtual Machine:The device will be available whenever you launch the Virtual Machine, so you can directly use it to transfer files.
On Microsoft Hyper-V
Hyper-V has an enhanced session mode that allows redirection of local drives from your PC to a VM. You can only use this mode to not only transfer files directly from your local drive but also to enable the detection of a PnP USB device. Here are the necessary steps:The local drive you selected will always be available on the VM. And any USB you connect will show on the VM. So you can transfer files using these drives.
Copy Using Shared Clipboard
Another way to transfer files is to copy them from your host computer and paste them into the guest VM. You need to set up a shared clipboard to use this method. Most VMs also allow drag-and-drop to copy files. You can find the necessary steps to set up the shared clipboard and enable both options on different VM stations below.On VMware WorkstationOn Oracle VirtualBoxOn Microsoft Hyper-VYou can directly copy and paste files from a local drive or a PnP device using the enhanced session mode on Hyper-V. But if you want to use the drag-and-drop method to copy files from these drives, you also need to enable Guest Services. To enable the services,
Create Shared Folder
You can also create a shared folder to easily transfer files to your Virtual Machine.The shared folder will appear on your VM OS under the network location. Any files you transfer here will be available on your VM as well as your host PC.
On VMware Workstation
Follow the instructions below to create a shared folder on WMware Workstation:
On Oracle VirtualBox
Here’s how you can create a shared folder on Oracle VirtualBox:
On Microsoft Hyper-V
To create a shared folder on Hyper-V, you need to Share a folder from your host machine and then map a network drive to the folder. First, follow these instructions to share a folder,Then, open the Hyper-V VM and map a network drive to the Network Path using the steps below:On WindowsOn Mac
Mounting Virtual Disk
You can also transfer files from HDD or SSD to a VM by mounting a virtual disk with the files. The Virtual disk contains all the contents of the physical disk and acts as the hard disk of the VM. So, it will directly access the files within.First, you must create a VHD (Virtual Hard Disk), VDI (Virtual Disk Image), or VMDK (Virtual Machine Disk) image file of the physical disk depending on the VM software you are using. Then, you need to mount it to the Virtual Machine. The file will then appear as a local disk drive (or many if the file contains more partitions).You can directly copy it to other locations inside the VM. After you are done, unmount the virtual drive.
Transfer Through Cloud Storage
You can also transfer files to a Virtual Machine OS through cloud storage. First, upload the files to Google Drive, OneDrive, iCloud, or any cloud service. Then, download it from the VM’s web browser or cloud app.You can also use backup software to transfer files to VM in a similar way.
Using Command-line Interface on Hyper-V
Hyper-V also offers a method to use the PowerShell CLI to transfer files to a Virtual Machine. You need to enable Guest services to use this method. So, first,