How to access VirtualBox host folders from Ubuntu guest machines

|

,

|

VirtualBox allows users to access a host computer’s shared folders from guest machines, using the application’s folder-sharing feature. This sharing exposes host files to virtual machines. The process requires a current version of VirtualBox Guest Additions installed on the guest operating system. Following installation, a user’s account must be added to the VirtualBox file-sharing group…

You can access the host computer’s shared folders directly from VirtualBox’s guest machines.

This is made possible by the VirtualBox host folder-sharing feature. You can easily share files with shared folders among virtual machines and the host computer. Folder sharing exposes the host computer files and folders to virtual machines.

To use shared folders, you must have the current version of VirtualBox Guest Additions installed on the guest operating system, and you must configure your guest machine’s settings to specify which directories will be shared.

Sharing host folders with guest machines in VirtualBox is useful when transferring files or data between the host and guest operating systems. It eliminates the need to use external storage devices or network transfers, which can be time-consuming and less secure.

By sharing folders, you can easily access files and folders on the host computer directly from the guest machine and vice versa. This feature is particularly useful for software developers or testers working on multiple operating systems simultaneously.

Installing VirtualBox Guest Additions.

Before installing the VirtualBox guest additions tool, run the commands below on the Ubuntu guest machine first.

sudo apt install linux-headers-$(uname -r) build-essential dkms

After installing the packages above, restart and install the Guest Additions Tool…

You must install VirtualBox guest additions on the guest machines to work shared folders. For this tutorial, we’re using the Ubuntu 17.10 guest machine.

To install the tool, turn the guest machine on, select the Devices, and click Insert Guest Additions CD image.

This should mount a virtual CD/DVD drive on the Ubuntu guest machine and prompt you to run the installation. Then, click Run to begin the installation.

After installing the tool, run the commands below to add your account to the VirtualBox file-sharing group.

sudo adduser USERNAME vboxsf

After that, shut down the Ubuntu virtual guest machine. Continue below to add the shared folder.

Share the Host Folder

Now that the guest tool is installed, edit the guest machine settings to add the folder you want to share with the host machine. Then select the Settings tab and pick the Shared Folders from the list.

Then, please enable it and locate the folder you wish to add. Click OK when done.

Save your changes and exit. Next, turn on the Ubuntu machine and browse the  /media/sf_Download folder. You should see the shared host folder mounted on the Ubuntu guest machine there.

This is how to share the VirtualBox host folder with Ubuntu guest machines.

Congratulation! You successfully shared the VirtualBox host folder with the Ubuntu guest machine.

Like this:



6 responses to “How to access VirtualBox host folders from Ubuntu guest machines”

  1. Me Avatar
    Me
    1. Ben Avatar
      Ben

      Thanks so much, I was searching for this!

      How to fix (credit: bignumber9):
      1. Install the guest OS as usual.
      2. apt-get install linux-headers-$(uname -r)
      3. apt-get install build-essential
      4. apt-get install dkms
      5. Reboot
      6. Install guest additions as usual.

      This blog post is fake, but at least I found my answer through it.

      1. !robot Avatar
        !robot

        Thanks, I have updated the post.

  2. Me Avatar
    Me

    You need to install a Perl compiler, first:
    https://help.ubuntu.com/community/InstallingCompilers

  3. bytestorm Avatar
    bytestorm

    This method works and it’s the simplest, permanent solution I found. Thanks

  4. Andrew Zahra Avatar
    Andrew Zahra

    The “sudo adduser USERNAME vboxsf” should be “sudo adduser $USERNAME vboxsf”

Leave a Reply to Andrew Zahra Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.