Open In App

How To Share File From Host Machine(Windows) To Guest Machine(Linux)

Last Updated : 30 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

We need to have Ubuntu installed in our Virtual Box for the purpose of this experiment. The host machine is Windows 10 in the following experiment.

Transfer File From Host Machine(Windows) To Guest Machine(Linux)

1. Method 1: Installing SSH on Ubuntu Terminal and allowing Firewall blockage

Open Terminal in Ubuntu which is installed in Virtual Box and enter the following commands for the given purposes.

Step 1: Installing SSH on the Ubuntu Virtual Machine using the command:

sudo apt install ssh. 

Running the command sudo apt install ssh

It creates a secure remote login from one machine to another.

Step 2: Enabling SSH on the Ubuntu Virtual machine allowed the transfer of files over TCP using the default port using the following command:

sudo systemctl enable –now ssh

Running the command sudo  systemctl enable –now ssh

Allowing any Firewall blockage using the following command:

sudo ufw allow 22/tcp. 

So that Firewall doesn’t block the file transfer from one machine to another.

Running the command  sudo ufw allow 22/tcp

Finding the IP address of the machine, which will be used to connect the Linux guest machine with the Windows host using FileZilla later:

ip addr

Running the command ip addr

Conclusion

We have successfully installed and enabled ssh on our Ubuntu machine, enabled Firewall blockage, and also found out our IP address of the Linux(Guest Machine).

2. Method 2: Downloading FileZilla

Download FileZilla Client for Windows 10 that is, in the host machine. Download the FileZilla Client as shown in the image below

Download FileZilla Client on Windows 10(Host machine)

Conclusion

We have successfully downloaded FileZilla in our Windows(Host Machine) in this step.

Method 3: Enabling Shared Clipboard and Drag’n’Drop.

Machine>Settings:

Machine->Settings

General>Advanced>Shared Clipboard->Bidirectional.

General>Advanced>Shared Clipboard->Bidirectional.

Next below Shared Clipboard, we will enable the Drag’n’Drop, which was previously Disabled, by making it Bidirectional,

.Enable Drag’n’Drop

Conclusion

In the VirtualBox, we have enabled “Shared Clipboard”, which won’t allow us to copy and paste between the host and the guest machine, and also enabled “Drag’n’Drop”, which will enable us to drag and drop files and folders from the host to guest and from guest to host.

4. Method 4: Create a folder to be transferred to the Guest Machine (Linux)

Creating a Shared Folder to Transfer Files from Host to VM. We can create any folder or file for transfer purposes here we created a “SharedFolder” named folder. 

  • Right click mouse button on your windows home screen 
  • Select “New” and select “Folder” from the right arrow. 
  • We have named the folder “SharedFolder” here for demonstration purposes.

Right click mouse button on Windows screen-> Select “New”->Select->”Folder”

The folder named “SharedFolder” created

Conclusion

We have successfully created a folder to be transferred to Guest Machine using FileZilla.

5. Method 5: Connect the Ubuntu machine using FileZilla and transfer the folder.

To connect the Ubuntu machine using FileZilla to the Windows Host System, we went to files inside it and created a new site where we had to put in the IP address (which we found in STEP 1), Username, and Password of the Ubuntu machine and choose the protocol to be SFTP, which helps in secure file transmission between remote SFTP server and local client system.

 

After this, a successful connection between the Windows 10(Host) operating system and the Linux(Guest) operating system in Virtual Box will be set up. 

On the left-hand side are the files of the Host machine whereas on the right-hand side will be the files of the Guest machine. We need to drag and drop the file we want to send to the Guest machine as shown below. We have transferred the file “SharedFolder” from the Host machine to the Guest machine.

Transferring files using drag and drop from left to right

As we can see the file “SharedFolder” has been transferred successfully to the Guest machine.

.File transferred successfully

Conclusion

We were successfully able to make a connection between the Host and the Guest machine using FileZilla and were able to transfer a file using it without copy-pasting from Host to Guest. 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads