Enroll Course

100% Online Study
Web & Video Lectures
Earn Diploma Certificate
Access to Job Openings
Access to CV Builder



Online Certification Courses

How to Transfer Files Between a Virtual Machine Guest and Host PC

How to Transfer Files Between a Virtual Machine Guest and Host PC. 

How You Can Share Data Between Your Host PC and a Virtual Machine

Using a virtual machine can improve your productivity considerably. But there’s often a sticking point: copying text or files from the host PC to the guest, or vice-versa.

A virtual machine is a software environment that emulates the hardware required to install an operating system (OS). In very general terms, this lets you install an operating system on an existing OS much like an app.

You won’t be surprised by the options for sharing data between a host PC any guest operating system running in a virtual machine. What may surprise you is how tricky they can be to set up. Your options are:

  • Copy and paste
  • USB drive
  • Network share

Clearly, each option is best for a specific type of data. For example, copy and paste is best for sharing text and small files, such as copying code from a browser on your host PC into a terminal session in the guest OS.

Below, we’ll look at sharing data using these three methods on virtual machines running on Oracle VirtualBox and VMware Workstation Player.

Copy and Paste Data

The simplest option is to copy the data from your host PC and paste it into the window of the guest VM. Or copy from the guest VM and into an open file browser on the host. But is it as simple as it sounds?

Thankfully, yes, it is.

Copy and Paste Data in VirtualBox

If you’re using VirtualBox, with your virtual machine running, select Devices > Drag and Drop. Here, you can choose from Host to Guest, Guest to Host, and Bidirectional. There’s also the default option, Disabled. For the best results, use Bidirectional.

That’s all there is to it.

How to Copy and Paste Data in VMware

For VMware users, you’ll need to first install the VMware Tools package, which brings additional features. You can commence this via VM > Install VMware Tools. If you haven’t already downloaded VMware Tools, instructions for doing so will be given.

You can then enable copy and paste in VM > Settings > Options. Select Guest Isolation, then Enable copy and paste and confirm with OK.

Sharing data between the guest and host operating systems in this way is best suited for smaller files. You might also share text strings, URLs, that sort of thing. Steer clear of large files though—you have other options for those.

USB Stick

Using a USB stick to transfer data between two physical machines is a time-honored tradition. USB flash drives essentially replaced 3.5-inch floppy disks in the early 2000s.

But how can you use a USB drive to share data between a virtual machine and your host PC?

Share Files From a USB Stick in VirtualBox

To be able to access USB devices from within VirtualBox, you’ll need to enable USB access. For this, the VirtualBox Extension Pack is required from www.virtualbox.org/wiki/Downloads.

Once you’ve done that, insert the USB device you wish to use. Next, open VirtualBox and click File > Preferences, then Extensions and click +. Browse to the downloaded Extension Pack, click Open, then when prompted, Install. Follow the prompts to complete the process. You can then check to confirm USB is enabled in Settings > USB.

With the USB support added, you’ll need to enable it. In the main VirtualBox window, right-click the VM you want to use and select Settings > USB. Click + then browse for the USB device. It will be available when you launch the VM. Additional drives can be added in the same way.

Copy Files from USB in VMware

With VMware, when a USB device is connected and the VM is the active window, the device is detected. However, it will not be detected by the host PC in this scenario. For this to happen, remove the drive, minimize the VM, then reconnect.

This option is the best for large files. Of course, you’re limited by the capacity of the USB device, so keep that in mind. Whatever VM software you use, safe ejection of USB devices is recommended on both host and guest virtual machines.

Create a Shared Drive

Another option is to set up a network share on your host PC that the guest VM can access. This means designating a portion of your PC’s hard disk drive as accessible over the local network. With this setup, the VM can then connect to the network and access the drive.

Although physically all on the same computer, this adds a higher capacity to your virtual machine data sharing.

Create a Share in VirtualBox

You should have already downloaded VirtualBox Guest Additions. This should be installed via Devices > Install Guest Additions, where you should browse for the appropriate EXE file. Follow the steps to the end, choosing the default options, then Finish.

Launch VirtualBox and open Devices > Shared Folders > Shared Folders Settings. Click +, then in Folder Path click the arrow and select Other. Browse (the host OS) for the folder you’re using as a share, highlight it, then Select Folder.

In the Add Share window, give the share a name (keeping the same name in the guest OS as in the host OS is wise). Check Auto-mount and Make permanent, then OK.

From the guest OS, you’ll find the share set up in the usual location for network shares. For example in Windows 10, this will be under Network Locations in Windows Explorer.

Corporate Training for Business Growth and Schools