Mounting a host folder in WSL or VirtualBox Kali machine

Oct 6, 2022 by Frederic Hallot | 1873 views

Kali CSC

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

1. Sharing the folder in VirtualBox

First you have to share the folder from your host machine in the virtual machine configuration



2. Adding the user to the vbox group (if necessary)

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

This blog post is licensed under CC BY-SA 4.0

This website uses cookies. More information about the use of cookies is available in the cookies policy.