Initial Steps

Open VirtualBox

image

Go to Shared Folders section and add a new shared folder

image
image

On Add Share prompt, select the Folder Path in your host that you want to be accessible inside your VM. Type shared for the Folder Name. Make sure that Read-only and Auto-mount are unchecked and Mount point is blank. Then click OK.

image

Once your VM is up and running, go to Devices -> Insert Guest Additions CD image

image

Use the following command to mount the CD

1
2
sudo mkdir /media/cdrom
sudo mount -t iso9660 /dev/cdrom /media/cdrom

Install dependencies for VirtualBox guest additions

1
2
sudo apt-get update
sudo apt-get install -y build-essential linux-headers-`uname -r`

Run the installation script for the guest additions. Wait until the installation completes.

1
sudo /media/cdrom/./VBoxLinuxAdditions.run

Reboot VM

1
sudo shutdown -r now

Create shared directory in your home

1
mkdir ~/shared

Mount the shared folder from the host to your ~/shared directory

1
sudo mount -t vboxsf shared ~/shared

The host folder should now be accessible inside the VM.

1
cd ~/shared

Q&A

error while loading shared libraries: libXt.so.6:

1
sudo apt install libxt6