How to transfer files from Ubuntu to Windows?

Saifudheen SidheeqLatest Posts, LinuxLeave a Comment

How to transfer files from windows to Ubuntu

I recently installed Ubuntu on my VMWare workstation pro, and I realized that I need to transfer some files from my windows host machine to the Ubuntu Guest OS and vice versa.

There are many ways you could transfer files from linux to windows . Lets look at the simple and easiest ways to transfer files between windows and Ubuntu.

There are two methods that we are going to use.

  1. Transfer files to Windows using SMB in Ubuntu
  2. Transfer linux files using WinSCP

Though I am showing these methods in Ubuntu which is installed in VMware workstation under windows, this method of transferring files from windows to Ubuntu would work with any other Ubuntu hosts as well, not just on vmware workstation. Provided, there should be a network reachability between the hosts and firewall is not blocking the access.

1. Transfer files to Windows using SMB in Ubuntu

Step 1. First step is to make sure that you have connectivity between the Host machine and the Guest OS.

  • On my workstation pro I am using NAT interface for the Ubuntu VM
Ubuntu vmware workstation network configuration
  • And the Ubuntu Guest machine got the IP address 192.168.239.142/24 from the NAT interface.
  • Let’s ping the IP and make sure we are able to reach the Ubuntu VM from the Windows Host. And, Yes I can ping the IP address.
ping ubuntu vm from windows machine

Step 2. Share the folder in windows that you would like to transfer files to the Ubuntu machine.

  • I created a folder called Ubuntu files in my windows host.
  • Right click on the folder that you just created and click on Properties.
  • In the Properties window click on Sharing, and click on Advanced Sharing.
how to share windows files or folder on the network.
  • In the Advanced sharing window check the option which says share this folder, and click on Permissions.
windows file transfer
  • In the permissions folder, you may control the permissions for the folder. I am giving full rights by checking all the options, Full control, Change and Read and click on OK.
giving sharing permission for windows folder for Ubuntu
  • You just shared a Folder on your windows machine, lets see how we are going to access the windows files from ubuntu.

Step 3. Access the windows files from Ubuntu.

  • Get the host windows machine IP address through CMD. As you can see my IP address is 192.168.0.19/24
transfer files from windows to ubuntu, check the ip of windows host
  • Open the file manager in Ubuntu and click on Other Locations.
  • Under connect to server type smb://192.168.0.19 and click on Connect.
enter smb address to transfer files from windows to ubuntu
  • As soon as you click on Connect the Ubuntu machine would prompt to enter the windows credentials.
enter the credentials to transfer files from windows to ubuntu
  • Once you are authenticated, you should be able to see the Ubuntu files folder that we had created under windows host machine.
we have successfully opened windows folder in ubuntu
  • Just double click on it and the folder would get auto mounted to your Ubuntu machine.
mount windows share folder in ubuntu
  • Now you can transfer files from windows to linux and linux to windows just like you would do on your regular PC.

2. Transfer linux files using WinSCP

If you ask someone who is an expert in linux world and ask them about How do I transfer files from a Linux box to windows, they would tell you to use WinSCP or FileZilla.

In this method we are going to use the tool called WinSCP.

What is WinSCP

WinSCP is a sofware that can let you transfer the files between different machine using a graphical user interface. It support verity of protocols such as SCP, FTP, SFTP and so on.

Step 1. Download the WinSCP software here on your windows machine, You may download the portable file or the installation setup file.

Step 2. In order for the SCP functions on the Ubuntu to work you would have to enable ssh in it, Follow the instruction here to enable the ssh on your Ubuntu machine.

Step 3. Open Winscp on your windows machine and in the login prompt

  • Select file protocol as SCP.
  • On the Host name field enter the IP address of your Ubuntu machine.
  • And enter the username and the password.
transfer files between linux and windows using winscp
  • Click on login and you will be able to see the windows files on the left side and the Ubuntu files on the right like below.
transfer files between linux and windows using winscp