虛擬機(jī)主機(jī)共享文件夾具體設(shè)置步驟如下:
操作方法如下:
1、點(diǎn)擊虛擬機(jī) 設(shè)置-->選擇 共享文件夾
(圖1 設(shè)置共享文件夾)
2、點(diǎn)擊加號(hào)創(chuàng)建一個(gè)共享文件夾,設(shè)置共享文件夾路徑,分配方式,是否自動(dòng)掛載
3、設(shè)置共享文件夾需要安裝Virtualbox增強(qiáng)工具,在虛擬機(jī)中點(diǎn)擊設(shè)備—安裝增強(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)功能...
自動(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 installer Removing 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 共享文件夾名稱(在設(shè)置頁(yè)面設(shè)置的) 掛載的目錄
然后進(jìn)入/home/xingoo/shared,就可以看到windows中的文件了