VirtualBox共享文件夾失敗


VirtualBox是個不錯的虛擬機,今天打算從VMWare遷移到VirtualBox。安裝VirtualBox和虛擬機的方法請參照本博客的其他文章,這里重點說下,在安裝共享文件夾時的一個失敗原因。
1 -- 安裝共享文件夾失敗現象以及查錯
STEP01 在VirtualBox上設置共享文件夾名稱:MyShareE,該共享文件夾指向主機的“E:/Share”目錄。
STEP02 在虛擬機上進行掛接:mount -t vboxsf MyShareE /mnt/Share。執行該語句之后出現如下錯誤:
/sbin/mount.vboxsf: mounting failed with the error: No such device
STEP03 在網上搜索之后,發現出現該問題的原因是沒有正確安裝增強功能包。我們可用命令“lsmod | grep vboxsf”來檢測是否成功安裝該增強包。
如果已經正確安裝到虛擬機上,執行該命令后,將出現如下顯示:
linux-rwdx:~ # lsmod | grep vboxsf
vboxsf                 37328  1 
vboxguest             195176  2 vboxsf
STEP04 該虛擬機上沒有如上顯示,所以打算重新安裝增強功能包(Guest Additions)。
掛接增強功能包光盤后,到/mnt/cdrom目錄下執行:./VBoxLinuxAdditions.run。發現有如下的錯誤(紅色強調部分):
linux-rwdx:/mnt/cdrom # ./VBoxLinuxAdditions.run install
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.0 Guest Additions for Linux..........
VirtualBox Guest Additions installer
Removing installed version 4.2.0 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules                      done
Removing existing VirtualBox non-DKMS kernel modules                  done
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module                              failed
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions                         done
Installing the Window System drivers
Installing X.Org 6.9/7.0 modules                                      done
Setting up the Window System to use the Guest Additions               done
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services components         done
STEP05 按照錯誤提示,到日志文件“/var/log/vboxadd-install.log”中查找原因。該日志中有如下錯誤提示:
linux-rwdx:/mnt/cdrom # cat /var/log/vboxadd-install.log
/tmp/vbox.0/Makefile.include.header:115: *** Error: unable to find the include directory for your current Linux kernel. Specify KERN_INCL=
 
 
 
         
          
  
  
   and run Make again.  Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
 
 
 
         
根據此錯誤提示,推斷應該是沒有安裝內核源代碼,所以決定為該虛擬機重新安裝Kernel。
2 -- 安裝Linux內核源代碼
STEP01 將虛擬機的光驅指向安裝光盤,讓系統從光盤啟動。
cc
STEP02 從光盤啟動后,在如下界面選擇“Installation”。
bb
STEP03 一路Next,到“Installation Mode”界面,選擇安裝類型。
因為我們是在已安裝操作系統上補裝LinuxKernel,所以選擇“Update”安裝模式。
2
STEP04 點擊“Next”,進入“Installation Setting”界面。
3
STEP05 在上述界面中,點擊“Packages”,進入安裝包選擇界面。選擇過濾“Installation Sources”,然后右面的選擇框中,選擇“kernel-source”。
4
STEP06 點擊“Accept”到如下確認界面,選擇“Start Update”開始安裝。
5
STEP07 成功安裝后,我們再安裝增強包,如下提示表明成功安裝。
linux-rwdx:/mnt/cdrom # ./VBoxLinuxAdditions.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.0 Guest Additions for Linux..........
VirtualBox Guest Additions installer
Removing installed version 4.2.0 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules                      done
Removing existing VirtualBox non-DKMS kernel modules                  done
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module                              done
Building the shared folder support module                             done
Not building the VirtualBox advanced graphics driver as this Linux version is
too old to use it.
Doing non-kernel setup of the Guest Additions                         done
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers
Installing X.Org 6.9/7.0 modules                                      done
Setting up the Window System to use the Guest Additions               done
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services components         done


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM