I use Kali Linux as a virtual machine in VMware Workstation Player with Windows 10 Home as host.
The Player has the option to pick a Windows folder to be used as a shared folder.
I set this up, it says it's enabled, but in Kali Linux this shared folder should be present in /mnt/hgfs
. /mnt
exists, but is empty. I'm stuck here.
-
1You need to learn that on Unix/BSD/Linux, they are "directories" and not the Windows-ism of "folders" which is not the same thing.– RobCommented Jun 21, 2020 at 10:55
-
Conceptually they are the same to me. The details is in the semantics.– Petoetje59Commented Jun 21, 2020 at 11:12
-
1If you are going to run Linux, use the correct terminology. They are not the same thing.– RobCommented Jun 21, 2020 at 11:33
4 Answers
Both stackprotector's AND petoetje59's answer helped with this issue.
cd /mnt/hgfs
- If the folder is missing -->
sudo mkdir hgfs
sudo vim /etc/fstab
- Enter
vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other,nofail 0 0
at the end of the file and save sudo reboot now
ls /mnt/hgfs
- The Shared Folder you enabled in VMware Fusion Settings will appear
The short of it is below, but here's a little ten minute video that goes through a good step by step process.
Even if the hgfs folder was present, it would be empty. The host has made the files available to the vm, but the vm still needs to be told about their presence. The same thing happens occasionally when you plug in a thumb drive. To do this, from the Kali command line you use the mount command. After you're done working with the shared folder I would use umount, so that I wouldn't have a persistent connection across my operating systems. Keep us updated on your fix.
Executed the instructions mentioned in that video, and as expected, that guy on Youtube left out half the story to make it really work - even by reading up on the comments... Sigh. I finally assembled everything I found into my answer, and tested it successfully.
I have a working VMware Workstation Player (VMWP) with Windows 10 Home as the host and Kali Linux 2020.2 as guest OS. The required VMware Tools for Linux have been installed (I use a premade VM image which had them already embedded).
To REALLY setup a shared folder for both OS:
Create the shared folder on the host, e.g.:
E:\VM_SHARE
Start the guest.
From the VMWP :
Player Manage Virtual Machine Settings... Options tab Shared Folders Always enabled Add..., Next Browse... Host path : E:\VM_SHARE Name : VM_SHARE Next Enable this share Finish OK
- According to this the shared folder on the guest is supposed to appear in
/mnt/hgfs
but the last folder was missing on my system. Open a terminal window in the guest, and create the missing folder:
cd /mnt sudo mkdir hgfs
- From the terminal window create (or add to) the - in my case also missing - file
/etc/rc.local
:
mousepad /etc/rc.local
Add the following line:
sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
Important, the first line in this file has to be: #!/bin/sh -e
Save the file.
- No you're not there yet, the file must be made executable:
ls -l /etc/rc.local
In my case this line started with the wrong attributes: -rw-r--r--
Make it executable:
sudo chown root /etc/rc.local sudo chmod 755 /etc/rc.local
Test : ls -l /etc/rc.local
The right attributes should now be: -rwxr-xr-x
Put some test file
test.txt
inE:\VM_SHARE
on the host.Restart the VM, and check whether the test file also appears on the guest - using the graphical File System on the guest's desktop:
/mnt/hgfs/VM_SHARE/test.txt
That's it.
If I missed something that might also spoil things, feel free to add to this answer.
-
For people finding this answer in the future, most of what your answer is dong is getting the folder to mount itself on bootup by editing the rc files. This is unnecessarily complicated. The line "sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other" is where all of the magic happens. Because it's a complicated command, I recommend to the average user to make it an alias that you can either run yourself, or put into ~.bashrc which will run when you launch your shell, effectively auto-mounting it. In general, you shouldn't mess with rc files in /etc. Glad it works for you though. Commented Jun 28, 2020 at 20:39
Just add the following line to your /etc/fstab
and reboot your machine:
vmhgfs-fuse /mnt/hgfs fuse defaults,allow_other 0 0
You will find your shared folder at /mnt/hgfs/<FOLDER_NAME>
afterwards.