How to create a shared folder in VirtualBox

2 weeks ago 6
PR Distribution

Sharing folders betwixt VirtualBox hosts and guests isn't astir arsenic hard arsenic you think, and the results of the task tin marque your virtual machines acold much flexible. Jack Wallen shows you how.

virtualboxhero.jpg

Image: Oracle

VirtualBox is simply a large instrumentality for creating, running, and managing virtual machines. It's free, it's flexible, and it's powerful. If you usage this instrumentality successful your information center, you mightiness find the request to make a shared folder betwixt a big and a guest. In fact, this is simply a coagulated mode to stock a folder with aggregate guests oregon usage it arsenic a mode to grow the disposable retention for your virtual machines.

No substance however you usage these shared folders, you person to cognize however to make them first. Let maine amusement you however to bash truthful successful VirtualBox 6.1.

SEE: Kubernetes: A cheat expanse (free PDF) (TechRepublic)

What you'll request

To marque this work, you'll request a moving lawsuit of VirtualBox 6.1 and a impermanent VM already created. I'll beryllium demonstrating with a Fedora impermanent and a Pop!_OS host, but the process should beryllium the same, nary substance which operation you use. You volition besides request to marque definite you've already installed the Guest Additions for the impermanent VM. To bash that, travel these steps:

  1. Boot the impermanent virtual machine.
  2. Log successful to the impermanent and click Devices | Insert Guest Additions CD Image.
  3. When prompted, click Run.
  4. Type your idiosyncratic password and click Authenticate.
  5. Allow the installation to complete.
  6. When prompted, deed the Enter cardinal connected your keyboard.
  7. Reboot the guest, truthful the changes volition instrumentality effect.

How to specify the shared folder successful the impermanent

Before we bash thing with the guest, we request to either take a folder connected the big oregon make one. Let's make a folder successful /home/USER/ named SHARED (Where USER is the aforesaid idiosyncratic who runs VirtualBox). Open a terminal model and contented the command:

mkdir ~/SHARED

With this folder created (or chosen), spell backmost to your VM and prime Settings. From the Settings window, prime Shared Folders. In the resulting popup (Figure A), click the Folder Path drop-down and prime Other.

Figure A

vbshareda.jpg

Creating your shared folder successful VirtualBox 6.1.

This volition unfastened your host's record manager. Navigate to the newly-created (or chosen) folder and prime it. Next, benignant a sanction for the caller stock and click the cheque container for Auto-mount. Click OK to prevention the changes and OK to disregard the Settings window.

Create the equine constituent with the command:

mkdir ~/share

You tin sanction the equine constituent immoderate you like. In my case, I named it pop_share (since it's being shared with Pop!_OS). Mount the stock with the command:

sudo equine -t vboxsf SHARE ~/share

Again, alteration the names SHARE and stock to immoderate you've named those folders.

You tin present unfastened your record manager to spot that the contents of the SHARE folder connected the big present amusement up connected the stock equine constituent connected the guest. 

How to marque this imperishable

Unfortunately, clicking Make Permanent successful the VirtualBox settings for the stock doesn't really work. To marque this stock permanent, you person to adhd an introduction to the fstab file. Open that record connected the impermanent with:

sudo nano /etc/fstab

At the bottommost of that file, adhd the pursuing line:

SHARED /home/USER/share vboxsf uid=1000,gid=1000 0 0

Make definite the alteration retired SHARED for the sanction of the shared folder connected the host, USER with your username connected the guest, and stock with the equine constituent connected the guest.

Save and adjacent the file. Now, erstwhile you reboot the guest, the stock volition beryllium automatically mounted.

And that's each determination is to creating a shared folder betwixt a VirtualBox big and guest. This would assistance marque your information halfway virtual machines much flexible and usable.

Data Center Trends Newsletter

DevOps, virtualization, the hybrid cloud, storage, and operational ratio are conscionable immoderate of the information halfway topics we'll highlight. Delivered Mondays and Wednesdays

Sign up today

Also see

Read Entire Article