在Ubuntu 12.10上安裝VirtualBox

來源:互聯網
上載者:User

標籤:style   class   blog   code   http   tar   

首先,根據以下官方指引進行安裝:

https://www.virtualbox.org/wiki/Linux_Downloads

因此,根據你的作業系統的版本號碼在/etc/apt/sources.list添加以下記錄:

deb http://download.virtualbox.org/virtualbox/debian trusty contrib  deb http://download.virtualbox.org/virtualbox/debian saucy contrib  deb http://download.virtualbox.org/virtualbox/debian raring contrib  deb http://download.virtualbox.org/virtualbox/debian quantal contrib  deb http://download.virtualbox.org/virtualbox/debian precise contrib  deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free  deb http://download.virtualbox.org/virtualbox/debian wheezy contrib  deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free  

1) 我們使用的是Ubuntu 12.10,所以需要添加到/etc/apt/sources.list的記錄為:

deb http://download.virtualbox.org/virtualbox/debian quantal contrib

 

2) 下載並註冊Orace的apt-secure公用密鑰:

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - 

3) 安裝VirtualBox:

sudo apt-get update  sudo apt-get install virtualbox-4.3  

4) Ubuntu/Debian使用者可能需要安裝dkms包來確保當Linux核心版本更改時VirtualBox主機核心模組也被更新:

sudo apt-get install dkms

5) 啟動VirtualBox,出現一個警告:

[email protected]:/home/aegis# virtualboxWARNING: The vboxdrv kernel module is not loaded. Either there is no module         available for the current kernel (3.5.0-17-generic) or it failed to         load. Please recompile the kernel module and install it by           sudo /etc/init.d/vboxdrv setup         You will not be able to start VMs until this problem is fixed.

6) 運行剛才的警告讓我啟動並執行命令:

[email protected]:/home/aegis# sudo /etc/init.d/vboxdrv setupStopping VirtualBox kernel modules ...done.Uninstalling old VirtualBox DKMS kernel modules ...done.Trying to register the VirtualBox kernel modules using DKMSError! Your kernel headers for kernel 3.5.0-17-generic cannot be found.Please install the linux-headers-3.5.0-17-generic package,or use the --kernelsourcedir option to tell DKMS where it‘s located ...failed!  (Failed, trying without DKMS)Recompiling VirtualBox kernel modules ...failed!  (Look at /var/log/vbox-install.log to find out what went wrong)

7) 這次我們安裝剛才的錯誤所說的linux-headers-3.5.0-17-generic:

[email protected]:/home/aegis# sudo apt-get install linux-headers-3.5.0-17-genericReading package lists... DoneBuilding dependency tree       Reading state information... DoneThe following NEW packages will be installed:  linux-headers-3.5.0-17-generic0 upgraded, 1 newly installed, 0 to remove and 473 not upgraded.Need to get 946 kB of archives.After this operation, 11.2 MB of additional disk space will be used.Get:1 http://cn.archive.ubuntu.com/ubuntu/ quantal/main linux-headers-3.5.0-17-generic amd64 3.5.0-17.28 [946 kB]Fetched 946 kB in 2s (404 kB/s)                         Selecting previously unselected package linux-headers-3.5.0-17-generic.(Reading database ... 142701 files and directories currently installed.)Unpacking linux-headers-3.5.0-17-generic (from .../linux-headers-3.5.0-17-generic_3.5.0-17.28_amd64.deb) ...Setting up linux-headers-3.5.0-17-generic (3.5.0-17.28) ...Examining /etc/kernel/header_postinst.d.run-parts: executing /etc/kernel/header_postinst.d/dkms 3.5.0-17-generic /boot/vmlinuz-3.5.0-17-generic

8) 再跑一次/etc/init.d/vboxdrv setup命令:

[email protected]:/home/aegis# sudo /etc/init.d/vboxdrv setupStopping VirtualBox kernel modules ...done.Uninstalling old VirtualBox DKMS kernel modules ...done.Trying to register the VirtualBox kernel modules using DKMS ...done.Starting VirtualBox kernel modules ...done.

9) 再次啟動VirtualBox,看起來沒有問題了:

[email protected]:/home/aegis# virtualbox[email protected]:/home/aegis# 

 

聯繫我們

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