How to mount a shared folder in VirtualBox

发布时间 2023-05-07 21:28:23作者: lightsong

How to mount a shared folder in VirtualBox

https://www.pragmaticlinux.com/2021/02/how-to-mount-a-shared-folder-in-virtualbox/

 

Background

VirtualBox comes with a feature called shared folders. As the name implies, a shared folder enables file sharing between the host and the guest operating systems. With the host operating system I mean the operating system, where you installed the VirtualBox program itself. The guest operating system is the one you run inside a VirtualBox virtual machine.

When you work with virtual machines, sooner or later you run into a situation where a file resides on the host OS and you want to access it on the guest OS, or the other way around. Some example scenarios:

  • While trying out a new Linux distribution in a virtual machine, you want to configure the desktop environment the exact same way as on your host OS. This includes the background image. Through the use of a shared folder, you can quickly copy the background image to the guest OS.
  • You took a few screenshots inside a guest OS. You want to insert these screenshot images in a document you are writing on your host OS. With the help of the shared folder, you can easily copy the screenshot image files to your host OS.
  • You cloned one of your GitHub repositories inside your guest OS. After fixing or improving some code, you want to push the changes back to the remote repository. You need the correct SSH keys on the guest OS, for write access to your GitHub repository. Thanks to the shared folder feature, you can simply copy the SSH keys from your host OS to your guest OS.

This article shows you step-by-step how to configure and mount a shared folder for your Linux based guest OS, running as a VirtualBox virtual machine.

 

 

https://askubuntu.com/questions/659427/cant-access-virtualbox-shared-folder

https://askubuntu.com/questions/456400/why-cant-i-access-a-shared-folder-from-within-my-virtualbox-machine

 

sudo usermod -aG vboxsf $(whoami)
sudo reboot