Using VMware shared folders
Idea contributed by Ivan. Comments/bugs to Sam Kingston.
One way to access files on the host operating system from
within the virtual machine is to use VMware's Shared Folders.
NOTE! There is an issue with stat()ing files on the
hgfs file system - directory entries appear as 0 bytes. When
testing your A0 implementation, do not attempt to ls
files/directories on the hgfs file system or you will get
incorrect sizes and may think your program is not working
correctly.
First we need to shut down the VM guest and change some of
its settings:
- Click: VM -> Settings -> Options -> Shared
Folders. Add the folders you want to shared here.
- Click: VM -> Settings -> Add -> CD/DVD Drive
-> Use physical drive -> Select auto detect and connect
at power on.
Now install the VMware tools, which provides kernel support
for interfacing with VMware from within a Linux guest:
- Start the virtual machine
- Get the latest version of the tools ISO: Click VM ->
Install VMware tools -> Download
- Log in to a terminal in the VM and type the following
commands:
-
cd
-
sudo mkdir /mnt/cdrom
-
sudo mount /dev/cdrom1 /mnt/cdrom
-
tar -xf /mnt/cdrom/*.tar.gz
-
cd vmware-tools-distrib
-
sudo ./vmware-install.pl
Accept all default questions by pressing [Enter]. When the
script asks if you want it to run the initialisation
script, say yes and let it build the kernel modules. Say no
when the script asks if you want to install the vmsync
feature.
-
sudo reboot
You may now remove the vmware-tools-distrib directory. The
shared folders will be available in /mnt/hgfs.