手把手教你在VirtualBox中與主機(jī)共享文件夾,具體如下:
VirtualBox下載地址,版本為5.1.6
設(shè)置共享文件路徑
點(diǎn)擊虛擬機(jī) 設(shè)置-->選擇 共享文件夾
(圖1 設(shè)置共享文件夾)
設(shè)置共享文件夾路徑
1 選擇路徑
2 填寫(xiě)自定義的共享名稱(chēng)(在后面需要與掛載路徑相對(duì)應(yīng))
3 設(shè)置自動(dòng)掛載/固定分配
(圖2 設(shè)置共享文件路徑屬性)
安裝VirtualBox增強(qiáng)工具
先安裝必備的包
執(zhí)行下面的命令:
yum install -y gcc gcc-devel gcc-c++ gcc-c++-devel make kernel kernel-devel
安裝完后,重啟虛擬機(jī):
shutdown -r now
安裝virtualBox增強(qiáng)工具
點(diǎn)擊 設(shè)置-->點(diǎn)擊 安裝增強(qiáng)功能...
(圖3 點(diǎn)擊設(shè)置)
自動(dòng)執(zhí)行安裝 或者 進(jìn)入目錄/media/VBOXADDITIONS_5.1.2_108956,執(zhí)行命令
./VBoxLinuxAddtion.run
得到輸出內(nèi)容
[root@localhost VBOXADDITIONS_5.1.2_108956]# ./VBoxLinuxAdditions.run Verifying archive integrity... All good.Uncompressing VirtualBox 5.1.2 Guest Additions for Linux...........VirtualBox Guest Additions installerRemoving installed version 5.1.2 of VirtualBox Guest Additions...vboxadd.sh: Stopping VirtualBox Additions.vboxadd-service.sh: Stopping VirtualBox Guest Addition service.Copying additional installer modules ...Installing additional modules ...vboxadd.sh: Building Guest Additions kernel modules.vboxadd.sh: You should restart your guest to make sure the new modules are actually used.vboxadd.sh: Starting the VirtualBox Guest Additions.You may need to restart the the Window System (or just restart the guest system)to enable the Guest Additions.
即安裝成功!
掛載共享文件夾
切換到root用戶輸入掛載命令:
sudo mount -t vboxsf shared_file /home/xingoo/shared
注意格式為
sudo mount -t vboxsf 共享文件夾名稱(chēng)(在設(shè)置頁(yè)面設(shè)置的) 掛載的目錄
然后進(jìn)入/home/xingoo/shared,就可以看到windows中的文件了
(圖4 windows文件)
[root@localhost shared]# lltotal 337516-rwxrwxrwx. 1 root root 149599799 Aug 15 21:29 apache-hive-2.1.0-bin.tar.gz-rwxrwxrwx. 1 root root 196015975 Aug 15 21:31 hadoop-2.6.4.tar.gz
其他使用技巧
如果宿主機(jī)是windows經(jīng)常需要來(lái)回的拷貝內(nèi)容,那么可以打開(kāi)【共享粘貼板】,步驟為:
設(shè)備-->共享粘貼板-->雙向
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持武林網(wǎng)。
新聞熱點(diǎn)
疑難解答
圖片精選