In this tutorial, we will learn how to move files from our local machine onto an Ubuntu virtual machine.
This can be useful if we want to transfer files between two machines or if we want to backup our files onto a remote machine.
There are two ways to do this: using the scp command or using the SFTP protocol. We will cover both methods in this tutorial.

Contents
What you’ll need
In order to follow this guide, you will need the following:
- A computer with an Internet connection
- An Ubuntu virtual machine running on your computer
- A file that you want to move from your computer to your Ubuntu virtual machine
Creating an Ubuntu virtual machine
Assuming you have Ubuntu installed on your computer, the first thing you’ll need to do is install VirtualBox. VirtualBox is a free and open-source virtualization software that makes it easy to create virtual machines (VMs) on your computer.
- Once you have VirtualBox installed, launch the application and click the “New” button to create a new VM.
- You’ll be asked to give your VM a name (we’ll call it “Ubuntu VM” for this tutorial) and select the operating system you want to install.
- Choose “Ubuntu” from the drop-down menu and select the version you want to install (we’re using Ubuntu 18.04 in this tutorial).
- Click “Next” and you’ll be asked to set the amount of memory (RAM) you want to allocate to your VM. We recommend at least 2GB of RAM for a basic Ubuntu VM, but 4GB or more is ideal if you plan on running multiple programs or working with large files on your VM.
- Click “Next” again and you’ll be asked to create a virtual hard drive for your VM. Choose “Create a virtual hard drive now” and click “Create”.
- Select “VDI (VirtualBox Disk Image)” as the hard drive file type and choose whether you want a dynamic or fixed-size hard drive. We recommend choosing fixed size for better performance, but dynamic will work fine if you’re tight on storage space.
- Click “Create” and you’ll be asked to specify the size of your virtual hard drive. We recommend at least 20GB for a basic Ubuntu VM, but 40GB or more is ideal if you plan on storing a lot of files or installing multiple programs.
- Click “Create” one last time and your new VM will be created!
Installing Ubuntu on your virtual machine
Before you can start using Ubuntu on your virtual machine, you’ll need to install it. Here’s a quick guide on how to do that:
- Download the Ubuntu ISO file. You can get the latest version from the Ubuntu website.
- Create a new virtual machine in your virtualization software and select the ISO file you just downloaded as the “boot image”.
- Start the virtual machine and follow the on-screen instructions to complete the installation process. Once Ubuntu is installed, you can start using it just like any other operating system!
Configuring your virtual machine
There are a few ways to get files from your local machine onto your virtual machine (VM), but for this guide, we’ll use a shared folder.
Shared folders allow you to access files on your local machine from within the VM, and vice versa.
Any changes made to files in the shared folder will be visible on both sides.
Before you can use a shared folder, you’ll need to do two things:
- Install the Guest Additions on your VM
- Set up a shared folder
Move Files Onto an Ubuntu Virtual Machine
If you have files on your local machine that you want to access on your Ubuntu virtual machine, there are a few ways to move them over.
The easiest way is to use the scp (secure copy) command. With scp, you can transfer files between your local machine and your Ubuntu virtual machine without having to set up an FTP server.
To use scp, you will need to have an SSH client installed on your local machine. If you’re using Windows, we recommend using PuTTY.
Once you have PuTTY installed, open it and enter the IP address of your Ubuntu virtual machine in the “Host Name” field. Then click “Open”.
When prompted, enter your username and password for your Ubuntu virtual machine.
Once you’re logged in, navigate to the directory on your local machine that contains the files you want to transfer. Then type the following command:
scp file_name [email protected]_address:/path/to/destination
For example, if I wanted to transfer the file “test.txt” from my local machine to the “/home/user” directory on my Ubuntu virtual machine, I would use the following command:
scp test.txt [email protected]:/home/user
Accessing your files on your Ubuntu virtual machine
If you have files on your local machine that you want to access on your Ubuntu virtual machine, there are a few ways to do it.
One option is to use a cloud storage service like Dropbox or Google Drive. You can also use SSH to transfer files between your local machine and your Ubuntu virtual machine.
Conclusion
Now that you know how to move files between your Ubuntu VM and your Windows 10 host machine, you can start using Ubuntu for your development projects. If you have any questions, please feel free to ask in the comments below.
Leave a Reply