virtualboxfedoramacos-catalinavirtualbox-guest-additions

How do I create a shared folder between my host (Mac OS) and guest (Fedora Server) in VirtualBox?


Specifics

Host OS: macOS Catalina v10.15.2 (19C57)

Guest OS: Fedora 31 (Server Edition)

Virtualization Product: VirtualBox v6.1.0 r135406 (Qt5.6.3)


Solution

  • How to create a shared folder between your host (macOS Catalina) and guest (Fedora 31 SE) provisioned through VirtualBox 6.1.

    1. Open VirtualBox, right click on the Virtual Machine that you want to share the folder with, and click 'Settings'.

    Virtual Machine settings.

    1. Select the Shared Folders tab, then click the Add Folder icon on the RHS of the screen.

    Shared folders.

    1. Select 'Other' from the Folder Path drop-down menu and navigate to the folder you wish to share, and click Open. Now tick the checkbox next to Auto-mount and click OK to complete, and again to exit the Settings menu.

    Shared folder configuration.

    1. Start the Virtual Machine and run the following commands:

      1. sudo dnf -y install kernel-devel-$(uname -r)

      2. sudo dnf -y groupinstall 'Development Tools'

      3. sudo mkdir /media/cdrom

    2. Select Devices > Optical Drives and ensure that Remove disk from virtual drive is greyed out. If it isn't, select this option to eject the ISO (presumably) used to provision the VM.

    3. Select Devices > Insert Guest Additions CD Image...

    4. Run the following commands within the VM:

      1. sudo mount /dev/cdrom /media/cdrom

      2. cd /media/cdrom

      3. sudo ./VboxLinuxAdditions.run

      4. sudo usermod -G vboxsf -a $USER

    5. Restart the Virtual Machine and your new folder should now appear under /media/.

    Happy Hunting!