VirtualBox在CentOS中安装VBOXADDITIONS
在 Oracle Linux 上安裝 Shared Folders
對于 Oracle Database 11g,ZIP 安裝文件總共有 2 GB 多。由于需要從每個來賓 VM 訪問它們以安裝數(shù)據(jù)庫,我決定利用 Oracle VM VirtualBox 的 Shared Folders。Shared Folders 特性允許來賓 VM 訪問主機文件系統(tǒng)中的存儲,因此它允許我對每個 VM 都訪問相同的安裝文件。
Shared Folders 是 Oracle VM VirtualBox 的 Guest Additions 中提供的附加功能。Guest Additions 程序包提供可增強來賓操作系統(tǒng)基本功能的設備驅(qū)動程序和系統(tǒng)應用程序。除了 Shared Folders 功能之外,Guest Additions 還包含多個操作系統(tǒng)特定的插件,如無縫窗口、鼠標指針集成和更好的視頻支持。
Oracle VM VirtualBox 安裝目錄中的 ISO 文件中提供了受支持的來賓操作系統(tǒng)類型的 Guest Additions。要安裝適用于特定 VM 的 Guest Additions,可將來賓 VM 中的 ISO 文件掛載為虛擬 CD-ROM 映像(如果尚未掛載)并從那里進行安裝。我使用了 Linux 來賓中的一個終端窗口,并將目錄更改為 ISO 掛載點以運行安裝腳本。我第一次嘗試在 Oracle Linux 來賓 VM 中安裝 Guest Additions 時,安裝失敗了,如清單 2 所示。
清單 2:Guest Additions 安裝失敗# sh ./VBoxLinuxAdditions.runVerifying archive integrity... All good.Uncompressing VirtualBox 4.1.2 Guest Additions for Linux.........VirtualBox Guest Additions installerRemoving existing VirtualBox DKMS kernel modules?????????? [? OK? ]Removing existing VirtualBox non-DKMS kernel modules?????? [? OK? ]Building the VirtualBox Guest Additions kernel modulesThe headers for the current running kernel were not found. If the followingmodule compilation fails then this could be the reason.The missing package can be probably installed withyum install kernel-devel-2.6.32-100.26.2.el5Building the main Guest Additions module?????????????????? [FAILED](Look at /var/log/vboxadd-install.log to find out what went wrong)Installing the Window System driversInstalling X.Org 7.1 modules?????????????????????????????? [? OK? ]Setting up the Window System to use the Guest Additions??? [? OK? ]You 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 component[? OK? ]Press Return to close this window...清單 2 中所示輸出的日志文件 /var/log/vboxadd-install.log 指示問題在于缺少內(nèi)核資源:
# more /var/log/vboxadd-install.log/tmp/vbox.0/Makefile.include.header:94: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.? Stop.在 Fat Bloke 博客的幫助下,我確認了問題的根源。Oracle Linux 自帶了兩個內(nèi)核:一個是與 Red Hat 100% 兼容的,另一個是 Unbreakable Enterprise Kernel (UEK)。我的 Linux 來賓運行的是 UEK,因此需要安裝相應的gcc 和kernel-uek-devel 程序包,以便 Guest Additions 安裝能夠正常工作。這是因為 Guest Additions 安裝需要構(gòu)建和安裝內(nèi)核驅(qū)動程序。我使用了以下yum install 命令來下載和安裝缺少的程序包:
# yum update# yum install gcc# yum install kernel-uek-devel? ??(yum output not shown)這次,腳本運行無誤,如清單 3 所示。
清單 3:Guest Additions 安裝成功# sh ./VBoxLinuxAdditions.runVerifying archive integrity... All good.Uncompressing VirtualBox 4.1.2 Guest Additions for Linux.........VirtualBox Guest Additions installerRemoving installed version 4.1.2 of VirtualBox Guest Additions...Removing existing VirtualBox DKMS kernel modules?????? ?[? OK? ]Removing existing VirtualBox non-DKMS kernel modules?? ?[? OK? ]Building the VirtualBox Guest Additions kernel modulesBuilding the main Guest Additions module?????????????? ?[? OK? ]Building the shared folder support module????????????? ?[? OK? ]Building the OpenGL support module???????????????????? ?[FAILED](Look at /var/log/vboxadd-install.log to find out what went wrong)Installing the Window System driversInstalling X.Org 7.1 modules?????????????????????????? ?[? OK? ]Setting up the Window System to use the Guest Additions?[? OK? ]You 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 component[? OK? ]Press Return to close this window...注意,OpenGL 模塊仍然失敗,因為 Oracle Solaris 主機平臺沒有 OpenGL 驅(qū)動程序(Windows、現(xiàn)代 Linux 環(huán)境和 Mac OS X 不是這樣),但這并不重要,也與我想做的無關(guān)。
使用 Shared Folders
為了能夠從 Linux 來賓 VM 訪問主機文件夾,首先要確保該文件夾已經(jīng)正確導出以備共享。然后,只需單擊來賓 VM 的 Oracle VM VirtualBox Manager 窗口中Details 下的Shared Folders。于是顯示一個彈出窗口,允許配置我想要訪問的主機文件夾的路徑和該來賓 VM 用于掛載點的文件夾名稱,如圖 5 所示。還可以使用 VBoxManage 命令在命令行設置對 Shared Folders 的訪問;參見用戶手冊。
圖 5. 設置 Shared Folders
默認情況下,來賓 VM 將主機文件夾掛載為 /media/sf_<name>,其中 <name> 是您在創(chuàng)建掛載點時指定的名稱。例如,在重新啟動來賓之后,可以看到主機文件夾/Downloads 中的內(nèi)容在來賓 VM 的/media/sf_Downloads 中。現(xiàn)在,我可以在來賓 VM 中訪問已下載的數(shù)據(jù)庫 ZIP 文件。
VirtualBox安裝上最新的CentOS6.4,安裝增強組件時卻發(fā)現(xiàn)
Building the OpenGL support module???????????????????????? [FAILED]
最后網(wǎng)上一找,得到解決方法
cd /media/VBOXADDITIONS_4.1.8_75467/
export MAKE='/usr/bin/gmake -i'
./VBoxLinuxAdditions.run
安裝的時候使用"make -i" , -i, --ignore-errors?? Ignore errors from commands.忽略錯誤。
快樂無極提示您:默認安裝的CentOS,在安裝VBOXADDITIONS前還需要
yum groupinstall "Development Tools"
yum install kernel-devel
oracle?vm,virtualbox增強包VboxAdditions的安裝和共享文件夾
1開機登錄linux系統(tǒng)?點擊?設備—安裝增強功能
2桌面上會顯示VBOXADDITIONS_4.1.2_73507
3?不是root用戶的切換到root用戶輸入su?–?按下確定
4?輸入cd?/media/?點確定
5?輸入cd??VBOXADDITIONS_4.1.2_73507
6?輸入?sh?./?VBoxLinuxAdditions.run(看具體文件名叫什么)
7安裝好重啟
這樣這個增強包就裝好了
接著和主機共享文件
1首先先在主機上新建一個文件夾共享這個文件夾
2然后點擊虛擬機上的???設備按鈕
然后點添加數(shù)據(jù)空間
分配好了確定
在root的權(quán)限下實施如下命令:#mkdir?/mnt/gongxiang?????建樹一個目錄來掛載共享文件夾;當然你可以在任何處所建樹一個目錄?
然后輸入這個命令?#?mount?-t?vboxsf?gongxiang?/mnt/gongxiang?
到這如果你要和主機共享什么文件????就把這個文件拖到這個文件夾里
設置共享文件夾
?
點擊【設備】,選擇【共享文件夾】菜單,如下圖所示。
?
點擊添加一個共享文件夾,選項固定和臨時是指該文件夾是否是持久的。共享名可以隨意取,如【share1】,盡量使用英文名稱,不要有空格,選擇文件夾所處的位置,比如【E:\share1】,點擊確定,如下圖所示。
?
打開終端,在CentOS系統(tǒng)中建立一個文件夾,如在/mnt下建立一個share1文件夾。
代碼如下:
Linux代碼 ??在CentOS系統(tǒng)中,訪問在之前系統(tǒng)中設立的共享文件夾。
代碼如下:
Linux代碼 ??其中"share1"是之前創(chuàng)建的共享文件夾的名字。而"/mnt/share1"是在CentOS中共享文件夾的路徑,如下圖所示。
?
現(xiàn)在虛擬機和主機可以互傳文件了,在原系統(tǒng)“E:\share1”中拷貝兩個文件,然后在CentOS中查看,如下圖所示,就可以在此CentOS中看到這兩個文件了。
?
設置共享文件夾完成。
http://hermosa-young.iteye.com/blog/1798006???????????
再分享一下我老師大神的人工智能教程吧。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們?nèi)斯ぶ悄艿年犖橹衼?#xff01;https://blog.csdn.net/jiangjunshow
總結(jié)
以上是生活随笔為你收集整理的VirtualBox在CentOS中安装VBOXADDITIONS的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: tiff格式在arcmap中可以显示,在
- 下一篇: 实达BP-690KII打印文字歪及缩放问