調整Virtual Box中螢幕尺寸(解析度) .

來源:互聯網
上載者:User

調整Virtual Box中螢幕尺寸(解析度) .

當在 Virtual Box 中安裝完 CentOS (或者其他,比如win7 or ubuntu)後,螢幕的解析度只能是4:3的,這樣如果自己的螢幕不是4:3的話,看起來非常不方便。這個時候就需要安裝VBoxGuestAdditions_x.x.x.iso 這個增強功能了。

但在安裝過程中產生了錯誤:

Buildingthemainguestadditionmodules[Failed].(Yoursystemdoesnotseemtobesetuptobuildkernelmodules.Lookat/var/log/vboxadd-install.logtofindoutwhatwentwrong)
Building the main guest addition modules [Failed].  (Your system does not seem to be set up to build kernel modules.  Look at /var/log/vboxadd-install.log to find out what went wrong) 

同時,在檔案/var/log/vboxadd-install.log 中發現如下錯誤:

Error:unabletofindthesourcesofyourcurrentLinuxkernel.SpecifyKERN_DIR=<directory>andrunMakeagain..Stop.
Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again..  Stop. 

測試環境:Mac OS 10.9.4, Virtual Box-4.3.14-95030, CentOS-7.0-1406-x86_64-GnomeLive
解決方案:

首先,檢查自己的核心版本:(我的版本號碼是3.10.0-123.el7.x86_64)

  1. uname-r
uname -r

然後,檢查自己有沒有安裝kernel-devel, 且版本號碼與kernel是否一致:(版本是3.10.0-123.6.3.el7.x86_64,不一致)

rpm-qkernel-devel
rpm -q kernel-devel

如果沒有安裝,使用如下命令進行安裝:

yuminstallkernel-devel
yum install kernel-devel

如果二者不一致,需要對kernel進行更新:

  1. yumupdatekernel
yum update kernel

接下來,安裝一些必要的程式:

yuminstallgcc

yum install gcc

最後,就可以安裝VBoxGuestAdditions_x.x.x.iso了:(首先使用root許可權進入iso的檔案夾)

./VBoxLinuxGuestAddition.run
./VBoxLinuxGuestAddition.run

reboot 一下就可以了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.