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 open-source software available under GNU General Public License (GPL) version 2. It supports 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 than on a different system.
  • It 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 the 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 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 detect and identify USB devices after installing the Extension Pack, whereas the other 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 between the main system and the one installed in it is a bit trivial. Follow through and know how to enable shared folders in Virtualbox for Linux, Debian, Mint, or Ubuntu, and Arch Linux as a guest system. We shall put it in a universal way that will work for any Linux guest distribution.

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.

Note: If you are using another distribution as a guest, 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 that 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. For example, we share the Public Folder, make this permanent, and activate auto-monitoring by clicking on the options.
  • Next, reboot the guest system, once this has been you can find the shared folder within the data folder.
  • There is one problem: only one user can access 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 access the Data folder.
chown –R “whoami” :users /data/sf_Public/

Shared Folder Permissions

  • You need to log out and log in 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 must open up the terminal and 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 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, 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 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 any 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.

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 access 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, you first need to log out and then log in to gain 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 unaware, Linux Mint and Ubuntu come with VirtualBox guest addition preinstall by default. If not, this can be installed 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 log out 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 you may have saved locally, it just doesn’t make sense. Please leave your feedback and thoughts in the comments below.

Previous articleHow to Enable Group Policy Editor in Windows 10/11 Home (4 Methods)
Next articleHow To Get Help With Notepad in Windows 11 (Open, Use, Shortcut)
Lee White
Lee is currently a full-time writer at DekiSoft that is eager to discover new and exciting advancements in Technology, Software, Linux and Cyber Security. Lee has spent the past 18 years working as an Systems Engineer providing support for various operating systems and networks. When not at his desk or writing, you will find him tinkering with retro tech.

Leave A Reply

Please enter your comment!
Please enter your name here