Software & AppsOperating SystemLinux

How To Share a Folder Between Windows 10 Host and Ubuntu VirtualBox Machine

Ubuntu 21

In this tutorial, we will be discussing how to share a folder between a Windows 10 host and an Ubuntu VirtualBox machine. This can be particularly useful when you want to exchange files between the two systems.

Quick Answer

To share a folder between a Windows 10 host and an Ubuntu VirtualBox machine, you need to set up a shared folder in VirtualBox, install necessary packages on Ubuntu, create a mount point, and mount the shared folder.

Prerequisites

Before we start, ensure that you have the following:

  • A Windows 10 machine.
  • VirtualBox installed on your Windows 10 machine.
  • An Ubuntu virtual machine running on VirtualBox.

Step 1: Setting Up Shared Folders in VirtualBox

First, you need to set up the shared folder in VirtualBox. Here’s how:

  1. Start VirtualBox and select your Ubuntu virtual machine.
  2. Go to Devices > Shared Folders > Shared Folder Settings.
  3. Click on the “Add new shared folder” button (the folder icon with a plus sign).
  4. In the dialog that opens, navigate to the folder on your Windows machine that you want to share and select it.
  5. Give it a name, such as “ubuntu_shared”. Make sure to remember this name as you will need it later.

Step 2: Installing Necessary Packages on Ubuntu

Next, you need to install the necessary packages on your Ubuntu virtual machine. These packages are required for Ubuntu to recognize and interact with the shared folder.

  1. Start your Ubuntu virtual machine.
  2. Open a terminal. You can do this by pressing Ctrl + Alt + T.
  3. Run the following command to install the necessary package:
sudo apt install virtualbox-guest-utils

In this command, sudo is used to run the command with root privileges, apt is the package handling utility in Ubuntu, install is the command to install a package, and virtualbox-guest-utils is the name of the package.

Step 3: Creating a Mount Point on Ubuntu

Now, you need to create a directory in your Ubuntu VM where you want to mount the shared folder. This is known as a mount point. Here’s how:

  1. In the terminal, run the following command:
mkdir ~/windows_shared

In this command, mkdir is used to create a directory, and ~/windows_shared is the path where the directory is created. The tilde (~) represents the home directory.

Step 4: Mounting the Shared Folder on Ubuntu

Finally, you can mount the shared folder using the following command:

sudo mount -t vboxsf ubuntu_shared ~/windows_shared

In this command, sudo is used to run the command with root privileges, mount is the command to mount a filesystem, -t vboxsf specifies the type of the filesystem (in this case, a VirtualBox shared folder), ubuntu_shared is the name of the shared folder in VirtualBox, and ~/windows_shared is the mount point.

Troubleshooting

If you encounter any issues, make sure that you have installed the VirtualBox Guest Additions in your Ubuntu VM. This can be done by going to Devices > Insert Guest Additions CD Image in the VirtualBox menu while the Ubuntu VM is running. Follow the on-screen instructions to install the Guest Additions.

For further troubleshooting, you can refer to the following resources:

Conclusion

By following the steps in this tutorial, you should now be able to share a folder between a Windows 10 host and an Ubuntu VirtualBox machine. This can be a great way to easily exchange files between the two systems. Remember to restart your Ubuntu VM after making any changes to ensure they take effect. Happy sharing!

How do I access the shared folder from Ubuntu?

To access the shared folder from Ubuntu, navigate to the mount point directory you created earlier (~/windows_shared). You can do this by opening the file manager and going to the "Other Locations" section. Look for the folder named "windows_shared" and click on it to access the shared files.

Can I have multiple shared folders between Windows 10 and Ubuntu VirtualBox?

Yes, you can have multiple shared folders between Windows 10 and Ubuntu VirtualBox. Follow the same steps mentioned earlier in "Step 1: Setting Up Shared Folders in VirtualBox" to add additional shared folders. Each shared folder will have a unique name that you can specify when adding it in VirtualBox.

How do I unmount the shared folder in Ubuntu?

To unmount the shared folder in Ubuntu, open a terminal and run the following command:

sudo umount ~/windows_shared

This will unmount the shared folder from the mount point directory. Remember to replace ~/windows_shared with the actual path of your mount point if you used a different directory.

Can I share a folder from Ubuntu to Windows 10 in VirtualBox?

Yes, you can share a folder from Ubuntu to Windows 10 in VirtualBox. The process is similar, but you need to set up the shared folder in the Ubuntu virtual machine settings within VirtualBox. Follow the same steps mentioned earlier in "Step 1: Setting Up Shared Folders in VirtualBox," but select the folder on your Ubuntu virtual machine instead of the Windows host machine.

Can I modify the shared folder from both Windows 10 and Ubuntu?

Yes, you can modify the shared folder from both Windows 10 and Ubuntu. Any changes made to the shared folder on either system will be reflected in the other. However, be cautious when making simultaneous changes as conflicts may occur. It is recommended to avoid modifying the same file simultaneously from both systems to prevent data loss or inconsistency.

Leave a Comment

Your email address will not be published. Required fields are marked *