2

Tech Blog

Saturday, 06 July 2024 12:57

3 Ways to Transfer Files Between a Virtual Machine and PC on VMware and VirtualBox

Written by
Rate this item
(0 votes)

Virtual machines (VM) allow you to run a different operating system in an isolated environment.

Since virtual machines, by nature, are isolated, you cannot directly access files on your host PC.

Copying files from a VM to a local machine from the host PC, or vice versa, is often a major sticking point for virtual machine users. While it might seem complicated, if you want to move files from the VM to the host again, you don't need to jump through different hoops, as the process is relatively straightforward.

How to Copy Files From a VM to a Local Machine

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

The options for sharing data between a host PC and guest operating system running in a virtual machine are what you might expect:

  • Drag and drop (also known as copy and paste)
  • USB drive
  • Shared Folder

Each method is ideally suited for a specific type of data and expected use. For example, copying and pasting 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.

Many users don't know how to transfer files from VirtualBox to host; even if they do, some don't exercise the option because they feel it's unsafe or a hassle to get configured. However, there are three methods to transfer files on virtual machines running on Oracle VirtualBox and VMware Workstation Pro.

1. Drag & Drop and Shared Clipboard

The simplest option to transfer files between your host PC and a virtual machine is to set up a shared clipboard and drag and drop. This will allow you to use a common clipboard, meaning you will be free to copy/paste text/images and files between the virtual machine and your host PC.

This method of sharing data between the guest and host operating systems is best suited for smaller files. You might also share text strings, URLs, and similar things. Steer clear of large files, though you have other options.

How to Transfer Files From Virtualbox to Host Using Shared Clipboard Option

If you're using Oracle VirtualBox, then you can set up a Shared Clipboard and Drag'n'Drop in just a few quick steps:

virtualbox general settings-1

  1. Select your virtual machine, right-click, and select Settings.
  2. In the window that pops up, click on General and then click on the Advanced tab.
  3. You should now see the Shared Clipboard and Drag'n'Drop dropdown options.
  4. You can choose from Host to Guest, Guest to Host, and Bidirectional. There's also the default option, Disabled, which prevents your attempts to copy files to VirtualBox.

Select Bidirectional in both drop-down boxes to enable two-way file sharing.

How to Copy Files to VMware Workstation Pro Using Drag and Drop

Similar to the VirtualBox functionality, you can also set up a shared clipboard or enable drag-and-drop in VMware. You might need to install the VMware Tools package, which brings additional features.

vmware workstation pro drag and drop options
  1. With VMware Workstation Pro running, navigate to VM > Install VMware Tools. Instructions will be available during installation if you haven't already downloaded VMware Tools.
  2. Enable copy and paste in VM > Settings > Options.
  3. Select Guest Isolation.
  4. Here, Enable copy and paste and Enable drag and drop.

Confirm with OK.

2. Copy Files to the Virtual Machine Using a USB Drive

Using a USB drive (like an external HDD or SSD, or even a USB thumb drive) to transfer data between two physical machines is a time-honored tradition. Although not ideal, a USB stick can transfer files between the host PC and the virtual machine.

Given the potential size of a USB drive, it's a useful way to transfer larger files from a device to your virtual machine.

How to Transfer Files to VirtualBox From a USB Drive

You'll need to enable USB access to USB devices from within VirtualBox. For this, you need to download the VirtualBox Extension Pack.

Once the extension pack downloads:

virtualbox extension manager options

  1. Insert the USB device you wish to use.
  2. Launch VirtualBox. Head to File > Tools > Extension Pack Manager
  3. Browse to the downloaded Extension Pack, click Open, then when prompted, Install.
  4. Follow the prompts to complete the process. You can then check to confirm USB is enabled in Settings > USB.
  5. Right-click the VM you plan to use and select Settings > USB.
  6. Click +, then browse for the USB device, which will be available when you launch the VM. Additional drives can be added in the same way.

You can then use the USB device to copy files to VirtualBox.

How to Transfer Files to VMware Workstation Pro From a USB Drive

vmware workstation pro enable usb device

 

It's a simpler process to enable a USB drive on VMWare Workstation Pro.

  1. Locate your active virtual machine in the virtual machine library, found on the left of screen.
  2. Right-click the virtual machine, then head to Removable Devices > [USB Device Name] > Connect (Disconnect from host)

The USB drive will now be available in your virtual machine. Follow the same process to disconnect the USB stick from your virtual machine and reconnect to the host device.

3. Create a Shared Folder to Transfer Files to the Virtual Machine

Your third option for copying files from the host to the guest PC is to set up a network share. This means designating a portion of your PC's hard disk drive as accessible over the local network. With this setup, the VM can connect to the network and access the drive.

Although physically on the same computer, this increases your virtual machine data-sharing capacity.

How to Transfer Files to VirtualBox Using a Shared Folder

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

  1. Launch VirtualBox, then right-click the virtual machine and open Settings.
  2. Head to Shared Folders, then select the green + icon.
  3. Select Folder Path > Other, then browse the folder you want to share with the virtual machine.
  4. Now, select Auto-mount, and press OK.

Leave the Read-only option unchecked unless you're only pulling files from the folder.

If you can't transfer files between VirtualBox and the host PC, you can consider a few notable virtual machine options that are close alternatives to Oracle's VirtualBox.

How to Transfer Files to VMWare Workstation Pro Using a Shared Folder

The process of creating a shared folder on VMware Workstation Pro is straightforward:

  1. Within VMware Workstation Pro, select your virtual machine, then Edit virtual machine settings.
  2. Click on Options > Shared Folders. You can then choose a sharing option under Folder Sharing.
  3. Click Add to set up your shared folder and follow the on-screen instructions in the Add Shared Folder Wizard.
  4. In the Host path field, type or browse to the directory you want to share and name your folder.
  5. Once you click Next, you decide on the folder access (Read-only or Enable this share, the latter allows both host and the virtual machine complete access to the shared folder).
  6. Click on Finish to create your shared folder.

Linux users can view the shared folder under the /mnt/hgfs directory. While this is the most complicated option to set up, you can share larger files effortlessly. These might include installers, disk image files, and hi-res videos.

Whether using VirtualBox or VMware, sharing data between your physical PC and a virtual machine is surprisingly simple, and there are several ways to get the job done.

Source: MUO

Read 367 times Last modified on Monday, 08 July 2024 13:52

IT Solutions and Support

We are an Information Technology Company driven by service excellence, simplicity, effectiveness, efficiency and timeliness.

We take care of the modern-day tool of business (Information Technology) to allow our clients to focus on their business goals and objectives.

Get In Touch

5 Babajide Close, Off Association Avenue, Ikotun, Lagos

+234 803 3233 193

+234 814 5636 831

info@tishritechnologies.com

https://www.tishritechnologies.com