Oct 6, 2022 by Frederic Hallot | 701 views
Most people using kali won't use it on a dedicated machine. For Windows users most would use kali from WSL (Windows Subsystem for Linux). Other would use a virtual machine in VirtualBox or other virtualization environment. In this post we will only cover VirtualBox. In this case it can be useful to have a folder on the host machine that can be shared in the kali environment.
In WSL the solution is quite straightforward, every host hard drives are visible in the /mnt folder so a symbolic link would suffice to give direct access for example to an assets folder from the home folder
sudo ln -s /mnt/<hd letter>/<path/to/your/folder>/ /home/kali/assets
In Virtual box two steps are needed to get the same result
First you have to share the folder from your host machine in the virtual machine configuration
After step 1 your folder is visible in the /home/kali/assets folder and belongs the vboxsf group
In older version of the kali VM distributions, the kali users was not added to the vboxsf group, and when you try to connect to the /home/kali/assets directory, you receive a security error message
If this is the case you can solve the problem by executing:
sudo adduser $USER vboxsf
and then you have to logout and login again
After next, suddenly your folder shared from your host machine will be available definitively in your home directory!
Hope this helps