VirtualBox 4.1安裝CentOS6 Server版

版主: stnet253

回覆文章
tony
文章: 585
註冊時間: 2012-02-26, 07:04
聯繫:

VirtualBox 4.1安裝CentOS6 Server版

未閱讀文章 tony »

1,CentOS系統下載頁面http://wiki.centos.org/Download, 參考:x86,I386,i686, x86_64, x64,amd64、Windows Linux AIX下查看CPU位元數和作業系統位元數

2,64位Win7安裝不了CentOS-6.3-x86_64-minimal.iso,提示錯誤This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot - please use a kernel appropriate for your CPU. 參考:VirtualBox相關 解決:1,Virtualbox中啟用VT-x/AMD-v屬性配置後才能用(網路上找的,自己沒有修改過) 2,或者換i386的iso檔來安裝系統

3,64位Win7安裝CentOS-6.3-i386-minimal.iso,做完test media操作後提示錯誤:the centos disc was not found in any of your drivers. please insert the centos disc and press ok to retry. 解決:1,不進行test media,直接進行後續操作 2,或者執行完test media操作後,在虛擬機器的工具列Devices->CD/DVD Devices->下重新勾選上對應的iso檔

4,虛擬機器安裝完成後,發現外網無法訪問:預設NAT方式訪問網路,執行dhclient eth0命令使用dhcp方式訪問網路;也可以修改/etc/sysconfig/network-scripts/ifcfg-eth0檔,配置成使用dhcp方式訪問網路

CentOS安裝完成後,系統啟動時,顯示的是進度條而不是具體的執行資訊,編輯/boot/grub/grub.conf檔,找到下面的部分,將"rhgb"去掉,保存即可。其中"rhgb"表示"redhat graphics boot",就是圖形進度條模式。而"quiet"表示在啟動過程中只顯示重要啟動資訊,類似硬體自檢之類的消息不會顯示,可以有選擇地選用。

kernel /vmlinuz-2.6.32-71.el6.i686 ro root=UUID=697cb0d9-19f6-414a-90a1-5ceb2f40b03d rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=zh_CN.UTF-8 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet

5,安裝用戶端增強(Install Guest Additions),以使得工具列下面的Shared Folders共用資料夾和增大用戶端解析度功能能正常使用,關於Guest Additions參考官網描述:Chapter 4. Guest Additions

6,yum執行時出錯誤:yum from base: [Errno 256] No more mirrors to try 解決: 1,執行yum clean all 2,然後重新執行命令yum install gcc

7,yum執行時出錯誤:cannot find a valid baseurl for repo:base 解決: 1,網路不可用導致的 2,yum.repos.d下的設定檔中baseurl前的注釋符號去掉

8,Linux系統Mount點:mount的時候,mount的目的檔案夾/media/cdrom要手動創建
• Devices->Shared Folders-> auto-mount 會被自動Mount到/media目錄下,ls media可以查看到
• 安裝目錄下的VBoxGuestAdditions.iso檔mount到Linux系統(Devices->Install Guest Additions) mount /dev/scd0 /media/vbox
• iso系統安裝檔的mount(虛擬光碟機mount),mount /dev/cdrom /media/cdrom

9,CentOS命令列下安裝Install Guest Additions步驟
• yum update -------第一次更新要下載很多東西,不是必須做的
• yum install gcc
• yum install gcc make
• yum install kernel --包含所有內核原始程式碼
• yum install kernel-devel --只包含用於內核開發環境所需的內核標頭檔以及Makefile,安裝kernel後,可能就不用安裝kernel-devel了,我是先安裝kernel-devel,然後還是有錯誤,反過來安裝kernel
• reboot
• mount /dev/scd0 /media/vbox
• sh /media/vbox/VBoxLinuxAdditions.run

安裝VBoxLinuxAdditions時,發生下述錯誤:都是少安裝相關元件導致的,按照上述整理的步驟安裝後,問題解決。
building the main Guest Additions module FAILED
unable to find the sources of your current Linux kernel. Specify KERN_DIR-<directory> and run Make again

安裝結果:
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module
Building the shared folder support module
Building the OpenGL support module
Doing non-kernel setup of the Guest Additions
You should restart your guest to make sure the new modules are actually used.
Could not find the X.org or XFree86 Window System.(因為是Server版本,因此不存在X Window System)

殘留問題:Server版,由於沒有安裝桌面,虛擬機器解析度自動調整不起作用,又不能翻頁回去看命令列的歷史輸出結果,難道非要用putty?
一個命令輸出內容多於一屏時,使用more來分屏顯示 如 fdisk -l | more
回覆文章

誰在線上

正在瀏覽這個版面的使用者:Semrush [Bot] 和 1 位訪客