實體機是Win7,在Virtualbox虛擬機上安裝瞭一個Linux操作系統,需要設置一個共享文件夾,這裡給還不會設置的朋友分享一下教程,其實並不難。
虛擬機主機共享文件夾具體設置步驟如下:
操作方法如下:
1、點擊虛擬機 設置-->選擇 共享文件夾
(圖1 設置共享文件夾)
2、點擊加號創建一個共享文件夾,設置共享文件夾路徑,分配方式,是否自動掛載
3、設置共享文件夾需要安裝Virtualbox增強工具,在虛擬機中點擊設備—安裝增強功能;
先安裝必備的包
執行下面的命令:
yum install -y gcc gcc-devel gcc-c++ gcc-c++-devel make kernel kernel-devel
安裝完後,重啟虛擬機:
shutdown -r now
安裝virtualBox增強工具
點擊 設置-->點擊 安裝增強功能...
自動執行安裝 或者 進入目錄/media/VBOXADDITIONS_5.1.2_108956,執行命令
./VBoxLinuxAddtion.run
得到輸出內容
[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 共享文件夾名稱(在設置頁面設置的) 掛載的目錄
然後進入/home/xingoo/shared,就可以看到windows中的文件瞭