CentOS 7 安裝VirtualBox

來源:互聯網
上載者:User

標籤:virtualbox   centos   yum   

昨天給centos6.5裝VirtualBox,裝了一天也沒,今天閑著沒事,試試centos7,結果成功了 PS 小弟也是初學linux,許多地方只是找到瞭解決方法,但不知道為什麼,莫見

怪O(∩_∩)O哈!

1、安裝centos7,這個就不說了,centos7的安裝比舊版本簡單的多。

2、連網設定,剛裝完centos後用ifconfig查看發現沒有ip地址,解決辦法:

    cd /etc/sysconfig/network-scripts/

    vi ifcfg-eno16777736 #注意,我們平常見的都是ifcfg_eth0,具體是什麼,用ifconfig看看。

    ONBOOT=yes    #將onboot設為yes

    然後重啟網卡: /etc/init.d/network restart

2、安裝virtualbox:

    1> 下載VirtualBox的RHEL軟體庫設定檔:

         cd /etc/yum.repos.d         wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

    2> 安裝RPMForge.

      首先從http://pkgs.repoforge.org/rpmforge-release/上下載相應的rpm檔案,我下載的是rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm,具體版本

      資訊請參考:http://wiki.centos.org/zh/AdditionalResources/Repositories/RPMForge。

<span style="font-family:Courier New;">       rpm -ivh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm</span>

    3> 安裝DKMS(Dynamic Kernel Module)    

        yum install dkms

    4> 安裝開發環境和核心:

<span style="font-family:Courier New;">      yum groupinstall "Development Tools"       yum install kernel-devel</span>

     5> 安裝qt和qt-

       yum install qt qt-x11


    6> 安裝VirtualBox

      我是先在官網下載下來的,版本是VirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm, https://www.virtualbox.org/wiki/Downloads

       yum install VirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm
    

    7> 安裝擴充:    

      VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.16-95972.vbox-extpack 
   

      這個地方就出問題了。

VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackFile, interface IExtPackFile, callee nsISupports
VBoxManage: error: Context: "Install(fReplace, NULL, ptrProgress.asOutParam())" at line 1140 of file VBoxManageMisc.cpp

但此時系統中已有virtualbox了,所以說這個問題可以忽略,繼續接下來的。

    

     8> /etc/init.d/vboxdrv setup

     這裡又出現了錯誤:

Building the VirtualBox Guest Additions kernel 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. 
Once you have corrected it, you can run /etc/init.d/vboxadd setup to build them. 
查看錯誤記錄檔:
/tmp/vbox.o/Makefile.include.header:97: *** 
Error: unable to find the source of your current Linux kernel.Specify KERN_DIR=<directory> and run make again. Stop.

    解決辦法:

    yum install kernel-headers    yum install kernel-devel    yum install gcc*     yum install make    reboot

  重啟

   /etc/init.d/vboxdrv setup

   大功告成


           

CentOS 7 安裝VirtualBox

相關文章

聯繫我們

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