We will try to transfer this sample_file.txt located in HOST_FILE folder from the host machine to virtual machine in virtual box.
Step 1: Go to virtualbox manager.
Step 2: Click your virtual environment.
Step 3: Click Settings.
Step 4: Go to Shared Folders.
Step 5: Click the blue folder with plus sign icon. Select the folder (not the file itself) where the file you want to transfer is located from your host machine or just type the folder path and press OK.
Step 6: Start your virtual environment.
Step 7: On your virtual environment, create a folder you want to place the file that you will transfer from your host machine.
Step 8: Open terminal and type sudo mount –t vboxsf <FolderNameFromHostMachine> <FolderNameFromVirtualMachine>
sudo mount –t vboxsf HOST_FILE GUEST_FILE
You shall find your stuffs in this GUEST_FILE folder.