詳解VirtualBox中與主機共享文件夾的方法(圖文)
安裝VirtualBox為了共享文件夾,折騰了一晚上!網(wǎng)上的很多資料都不是很全面,這里就全面的總結一下,如果有其他的疑問,可以留言多多交流。
設置共享文件路徑
點擊虛擬機 設置-->選擇 共享文件夾
(圖1 設置共享文件夾)
設置共享文件夾路徑
- 1 選擇路徑
- 2 填寫自定義的共享名稱(在后面需要與掛載路徑相對應)
- 3 設置自動掛載/固定分配
(圖2 設置共享文件路徑屬性)
安裝VirtualBox增強工具
先安裝必備的包
執(zhí)行下面的命令:
yum install -y gcc gcc-devel gcc-c++ gcc-c++-devel make kernel kernel-devel
安裝完后,重啟虛擬機:
shutdown -r now
點擊 設置-->點擊 安裝增強功能...
(圖3 點擊設置)
自動執(zhí)行安裝 或者 進入目錄/media/VBOXADDITIONS_5.1.2_108956,執(zhí)行命令
./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中的文件了
(圖4 windows文件)
[root@localhost shared]# ll total 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
如果宿主機是windows經(jīng)常需要來回的拷貝內容,那么可以打開【共享粘貼板】,步驟為:
設備-->共享粘貼板-->雙向
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關文章
virtualBox虛擬機安裝增強功能后開機超慢問題解決方案
virtualBox虛擬機安裝增強功能后開機超慢問題解決方案,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-06-06VirtualBox下CentOS7網(wǎng)絡配置教程(可連外網(wǎng))
這篇文章主要介紹了VirtualBox下CentOS7網(wǎng)絡配置教程,可連外網(wǎng),具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-03-03Windows系統(tǒng)下安裝VirtualBox及安裝Ubuntu16.04的詳細教程
這篇文章主要介紹了Windows系統(tǒng)下安裝VirtualBox及安裝Ubuntu16.04的教程詳解,圖文并茂給大家介紹的非常詳細,需要的朋友可以參考下2019-10-10VirtualBox實現(xiàn)虛擬機中共享本地目錄的方法
VirtualBox 是一款開源虛擬機軟件。VirtualBox 是由德國 Innotek 公司開發(fā),由Sun Microsystems公司出品的軟件,使用Qt編寫,在 Sun 被 Oracle 收購后正式更名成 Oracle VM VirtualBox這篇文章主要介紹了VirtualBox實現(xiàn)虛擬機中共享本地目錄的方法,需要的朋友可以參考下2017-11-11利用virtualbox虛擬機實現(xiàn)端口轉發(fā)
這篇文章主要為大家詳細介紹了利用virtualbox虛擬機實現(xiàn)端口轉發(fā),具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-06-06教你在virtualBox搭建一個本地kubernets集群問題
這篇文章主要介紹了virtualBox搭建一個本地kubernets集群,本文分步驟通過圖文實例相結合給大家介紹的非常詳細,需要的朋友可以參考下2022-01-01VirtualBox CentOS7.7.1908 Python3.8 搭建Scrapy開發(fā)環(huán)境【圖文教程】
這篇文章主要介紹了VirtualBox CentOS7.7.1908 Python3.8 搭建Scrapy開發(fā)環(huán)境,本文通過圖文并茂的形式給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2019-10-10