VirtualBox共用資料夾失敗

來源:互聯網
上載者:User
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 vboxsfvboxsf                 37328  1 vboxguest             195176  2 vboxsf

STEP04 該虛擬機器上沒有如上顯示,所以打算重新安裝增強功能包(Guest Additions)。

掛接增強功能包光碟片後,到/mnt/cdrom目錄下執行:./VBoxLinuxAdditions.run。發現有如下的錯誤(紅色強調部分):

linux-rwdx:/mnt/cdrom # ./VBoxLinuxAdditions.run installVerifying archive integrity... All good.Uncompressing VirtualBox 4.2.0 Guest Additions for Linux..........VirtualBox Guest Additions installerRemoving installed version 4.2.0 of VirtualBox Guest Additions...Removing existing VirtualBox DKMS kernel modules                      doneRemoving existing VirtualBox non-DKMS kernel modules                  doneBuilding the VirtualBox Guest Additions kernel modulesBuilding 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                         doneInstalling the Window System driversInstalling X.Org 6.9/7.0 modules                                      doneSetting up the Window System to use the Guest Additions               doneYou may need to restart the hal service and the Window System (or just restartthe 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 將虛擬機器的光碟機指向安裝光碟片,讓系統從光碟片啟動。

STEP02 從光碟片啟動後,在如下介面選擇“Installation”。

STEP03 一路Next,到“Installation Mode”介面,選擇安裝類型。

因為我們是在已安裝作業系統上補裝LinuxKernel,所以選擇“Update”安裝模式。

STEP04 點擊“Next”,進入“Installation Setting”介面。

STEP05 在上述介面中,點擊“Packages”,進入安裝包選擇介面。選擇過濾“Installation Sources”,然後右面的選擇框中,選擇“kernel-source”。

STEP06 點擊“Accept”到如下確認介面,選擇“Start Update”開始安裝。

STEP07 成功安裝後,我們再安裝增強包,如下提示表明成功安裝。

linux-rwdx:/mnt/cdrom # ./VBoxLinuxAdditions.run Verifying archive integrity... All good.Uncompressing VirtualBox 4.2.0 Guest Additions for Linux..........VirtualBox Guest Additions installerRemoving installed version 4.2.0 of VirtualBox Guest Additions...Removing existing VirtualBox DKMS kernel modules                      doneRemoving existing VirtualBox non-DKMS kernel modules                  doneBuilding the VirtualBox Guest Additions kernel modulesBuilding the main Guest Additions module                              doneBuilding the shared folder support module                             doneNot building the VirtualBox advanced graphics driver as this Linux version istoo old to use it.Doing non-kernel setup of the Guest Additions                         doneYou should restart your guest to make sure the new modules are actually usedInstalling the Window System driversInstalling X.Org 6.9/7.0 modules                                      doneSetting up the Window System to use the Guest Additions               doneYou may need to restart the hal service and the Window System (or just restartthe guest system) to enable the Guest Additions.Installing graphics libraries and desktop services components         done

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.