How To Enable and Fix Virtualbox Shared Folder for Ubuntu

Virtualbox is high in performance product that carries new and unique features for all its users. The best thing is that this is the only software available as open-source under terms of GNU General Public License (GPL) version 2. It provides support to Linux, Windows, Sun Solaris, FreeBSD and Macintosh. You can now allow VirtualBox shared folders for Ubuntu or Debian on a Windows 10/11 host.

Why VirtualBox as a hypervisor though?

  • It allows PC hardware to run different OS images at the same time.
  • It can run software or apps in a different environment rather than on a different system.
  • Saves money by being able to run different servers virtually on one system.

Why is VirtualBox better for Shared Folders than VMWare

  1. This is a general-purpose full virtualizer for x86 hardware, it is targeted at server, desktop and embedded use.
  2. Share your clipboard between virtualized and host operating systems with help of this.
  3. As VMWare supports Windows, and Linux but not Mac, it, on the other hand, works with Mac, Windows and Linux computers.
  4. It comes in free, though it has a few bugs that can be fixed.
  5. Offers users an unlimited number of snapshots.
  6. Easy to install.
  7. Take fewer resources
  8. It runs fast when compared with the VMware server.
  9. It offers limited support for 3D graphics whereas the other one carries high-level 3D graphics support that too with DX10 and OpenGL 3.3 support.
  10. One of the features known as remote file sharing is built within the package.
  11. If we talk about CPU and memory utilization then VMWare outperforms it.
  12. With the guest addition, you can easily drag files and copy them between the VirtualBox and the host.
  13. It can both detect and identify USB devices after installing the Extension Pack whereas the other one fails to detect USB devices.

RECOMMENDED: How To Transform Windows 11 Into Linux Without a theme.

Enable VirtualBox Shared Folder on Windows Host for Linux OS (Guest)

With the help of a virtual box, we can easily install OS within the main system. However, sharing files is a bit trivial between the main system and the one installed in it. Follow through and know how to enable shared folder in Virtualbox for Linux, Debian, Mint or Ubuntu, and Arch Linux as a guest system. We shall be putting in a universal way that will work for any Linux guest distribution.

Now, to enable a shared folder between the host and the guest we need to follow a few steps.

  1. Install guest additions for the guest system.
  2. Create a shared folder.
  3. Change user permission for the shared folder.

For now, our Arch Linux is our host system but keep in mind that the host system does not matter in this case as we shall do all settings there in the guest system.

Recommended:  How to Calibrate Monitor for Gaming/Photography in Windows 10/11

Note: If as a guest you are using another distribution then look at instructions or Debian. This is a universal way and shall work for all.

First things first, you need to keep your Arch Linux guest system up to date, for this open the terminal and update it.

pacman –Suy

After this, you need to get the Kernel headers. We have used Linux Kernel LTS therefore we need to install the Linux-Its-headers package. Now, if you are using the standard one then install Linux-Headers.

pacman –s Linux-Its-headers

Then you need to get virtualbox-guest-utils package, now you shall be able to select a package: either virtualbox-guest-modules-arch or virtualbox-guest-dkms. The Arch Linux wiki suggests that we select the first package if using Linux Kernel and if using other Kernels such as LTS then we need to select the second package. Again, we use Linux-Its Kernel therefore need to get virtualbox-guest-dkms package.

pacman –s virtualbox-guest-utils

VirtualBox Guest Utilities Install

Next, you need to enable the Kernal modules.

Sudo systemctl enable vboxservice
  • In the VirtualBox you need to head towards the devices menu > shared folders menu > settings.

VirtualBox Shared Folder for Windows Host

  • In the window which pops up, you shall see a button to add a new one to the right side, click on this.
  • You need to choose the folder that you wish to share between systems. like for us we share the Public Folder, make this permanent, and activate auto-monitoring by clicking on the options.
  • Next, just reboot the guest system, once this has been you can find the shared folder there within the data folder.
  • There is one problem; only one user can have access to the folder. To get access as a regular user you need to open the terminal in the guest system and then add the user to the vboxsf group.
usermod –a –G vboxsf “whoami”

For those who do not know “whoami” stands there to paste the username automatically, moreover, you can also directly type in the username.

  • After this, you need to grant this user permission so that he can have access to the Data folder.
chown –R “whoami” :users /data/sf_Public/

Shared Folder Permissions

  • You need to log out and login again, then open up your file manager and you shall have access to the shared folder just like a regular user.

FEATURED: The easier way to copy and move files in Linux (Beginner friendly).

Turn On Shared Folder in VirtualBox for Debian Linux

When you install Guest addition in Debian is a bit different from that in Arch Linux. We shall show you a more of universal way which can be applied to any distro including Arch Linux. The one mentioned before is suggested for Arch Linux.

In the Debian guest, you need to open up the terminal and then install build-essentials, dkms and Linux-headers packages.

Apt install build-essentials dkms Linux-headers-$ (uname –r)
  • After this add in a shared folder. This is the same as before. All you need to do is go to the devices menu > then click on the Settings option.
  • Click on the button again present on the right to add to a shared folder. Set options as you desire and then hit the “ok” button.
  • Once you have installed the packages and it has been added, just reboot the VM.
  • Once the guest addition has been started all you need to do is head towards the Devices menu and hit the “insert guest addition image” option.
  • After this, open up the file manager and go to VBOXADDITION CD, click right in the directory and then hit on the “open terminal here” option.
  • You need to run the following command in the terminal:
sh VBoxLinuxAdditions.run

Be sure that it gets installed without any errors and lags. If anyhow errors occur then you need to read the message and probably instructions for fix shall be provided. If you pass the error reboot your system.

Recommended:  CentOS 7 vs CentOS 8 - Which is a better choice for you?

ALSO CHECK: How To use WhatsApp on Linux To Chat with your friends.

You shall not be able to access the shared folder if it is mounted to check this out you need to go to /data folder there in the file manager.

To have access to a regular user, do what was done for Arch Linux, and add the user to the vboxsf group.

usermod –a –G boxsf “whoami”
  • Change permissions of the data folder
chown –R “whoami” :users /data/
  • After this first you need to log out and then log in to have access to a shared folder.

This is a universal method and shall work out for any distro.

Turn on the shared folder in VirtualBox with Linux Mint and Ubuntu Support

For those who are unaware both Linux Mint and Ubuntu come with VirtualBox guest addition preinstall by default. If not, then this can be installed by using a software manager such as Synaptic.

  • You need to open the software manager, search and then:
install ­–virtualbox-guest-X12, virtualbox-guest-utils
  • Perform the same as you did for Arch Linux and Debian. First, add to the shared folder.
  • Next, reboot the system and add user to vboxsf group.
usermod –a –G vboxsf “whoami”
  • After this change the permissions.
chown –R “whoami” :users /data/
  • In the end login and logout and you shall see that the shared folder is working.

ALSO CHECK: Reset Your Kali Linux Password in VirtualBox Environment.

Conclusion

Shared folders save the biggest time when you are moving files between a Windows host and a guest operating system. You do not have to use a cloud service or go around in circles to access files that you may have saved locally, it just doesn’t make sense. Please do leave your feedback and thoughts in the comments below.

Leave A Reply

Please enter your comment!
Please enter your name here