Install virtualbox in ubuntu

Source: Internet
Author: User

The official source is virtualbox-ose, an open-source version.
 
You can download it from virtualbox.org.
 
Http://www.virtualbox.org/wiki/Linux_Downloads
 
 
 
Note the platform Selection
 
Download the DEB package and install it directly. The following error occurs due to kernel update:
 
VirtualBox will not start until this problem is fixed. please consult/var/log/vbox-install.log to find out why the kernel module does not compile. most probably the kernel sources were not found. install them (the package name is probably linux-headers-<version> whereby <version> can be determined by 'uname-R') and execute
 
/Etc/init. d/vboxdrv setup
 
As root.
 
Because virtualbox needs to be re-compiled based on the kernel version, Our updates are directly carried out in the source, and the corresponding kernel source files are not stored.
 
Run the following command:
 
Sudo apt-get install linux-headers-$ (uname-r)
Sudo/etc/init. d/vboxdrv setup
 
Re-compile virtualbox
 
 
 
 
 
Solutions to conflicts between virtualbox and kvm:
 
Lsmod | grep kvm
 
Check whether your module is kvm_intel or kvm_amd.
 
For example
 
Zlciai @ zlciai :~ $ Lsmod | grep kvm
Kvm_amd 33036 0
Kvm 162688 1 kvm_amd
 
 
 
Sudo rmmod kvm_amd
 
Or: sudo modprobe-r kvm_amd
 
You can start virtualbox
 
 
 
Switch back to kvm
 
Rmmod vboxdrv
 
Rmmod vboxnetadp
 
Rmmod vboxnetflt
 
 
Modprobe kvm
 
Modprobe kvm_amd
 
 
 
You can write a switchover script.
 
Reference: http://hi.baidu.com/bailiangcn/blog/item/59e69da86db74bbbcb130c9d.html
 
#! /Bin/bash
NOW_VM = 'lsmod | grep vbox'
If [x "$ NOW_VM" = x ""]; then
Echo "Now is kvm, swithing to vbox ..."
Sudo rmmod kvm_amd
Sudo rmmod kvm
 
Sudo modprobe vboxdrv
Sudo modprobe vboxnetadp
Sudo modprobe vboxnetflt
Else
Echo "Now is vbox, swithing to kvm ..."
Sudo rmmod vboxnetflt
Sudo rmmod vboxnetadp
Sudo rmmod vboxdrv
 
Sudo modprobe kvm
Sudo modprobe kvm_amd
Fi
 
Echo "Switching from to xxx done ."
Lsmod | grep kvm
Lsmod | grep vbox
Echo "enjoy it now! "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.