Prerequisites
Ensure the VirtualBox Guest Additions image (VBoxGuestAdditions.iso) is available. Install essential development utilities within the guest system.
Installing Guest Additions
- Log into the Linux guest environment.
- Navigate to the virtual machine's menu bar, select "Devices" -> "Insert Guest Additions CD Image...".
- Acknowledge the prompt to run the software. If not prompted, proceed manually.
Manual Installation Steps
Create a mount point and attach the Guest Additions image:
sudo mkdir -p /media/vbox_guest_additions
sudo mount /dev/sr0 /media/vbox_guest_additions
Execute the installation script from the mounted directory:
cd /media/vbox_guest_additions
ls -l
sudo ./VBoxLinuxAdditions.run
If the script fails, install required dependencies based on the error message. A typical set of commands includes:
sudo yum install -y bzip2 kernel-devel kernel-headers gcc make
sudo yum update -y
Re-run the installation script after installing dependencies.
Configuring and Accessing a Shared Folder
- In the VirtualBox Manager, select the target VM and open its "Settings".
- Go to the "Shared Folders" section.
- Click the add-folder icon. Specify the absolute path to the directory on the Windows host you wish to share. Assign a name (e.g.,
win_share) to the folder. Enable the options for auto-mounting and making it permanent. Confirm the setitngs.
Mounting the Shared Folder in the Guest OS
Create a local directory to serve as the mount point and mount the shared folder:
sudo mkdir -p /mnt/shared_windows
sudo mount -t vboxsf win_share /mnt/shared_windows
To verify access, list the contents of the mounted directory:
ls /mnt/shared_windows