Share files between the host machine (Win) and the virtual machine (Linux)

A virtual machine virtualBox is installed on the computer, and JDK is intended to be installed in the virtual machine. The version of ubuntu is: ubuntu-16.10-server-amd64.iso.
After searching various methods on the Internet, I plan to install the JDK in the virtual machine by sharing files between the host machine (Win) and the virtual machine (Linux).
Let's do it.


First, set up a shared folder
First, set the D:\baidu\shareFolder directory as a shared folder, and the method will not be repeated.
Then set the shared folder on the virtual machine:



2. Mount the shared file and
execute: sudo mount -t vboxsf shareFolder /home/fuhy/winshare
but the execution fails, showing: -unknown filesystem type vboxsf
After searching, refer to https://segmentfault .com/a/1190000004362463
found that the host (win) and virtual machine (Linux) need to install Guest Additions, so click "Device - Install Enhancements...":

But the installation reported an error:

Need to mount VboxGuestAdditions.iso, so Execute: sudo mount /dev/cdrom /home/fuhy/winshare

to check, it can be seen that it is mounted:


execute it: sudo sh ./VboxLinuxAdditions.run

The last sentence: Failed to set up service vboxadd, please check the log file, explain Execution failed.
Check the log:

There is this sentence: Please check that you have gcc, make, the header files for your Linux kernel and possibly perl installed..
It can be seen that gcc, make and other software may not be installed, try it:


then install gcc and execute sudo apt -get install build-essential

wait for a while, after the installation is complete, execute: gcc --version

to see that the installation is successful, re-execute: sudo sh ./VboxLinuxAdditions.run

The last sentence: Could not find the X.Org or Xfree86 Windows System, skipping. It doesn't matter, this has no effect.
Continue to execute: sudo mount -t vboxsf shareFolder /home/fuhy/winshare to

see that the mount is successful.



Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326618037&siteId=291194637