VirtualBox

From Indie IT Wiki
Jump to: navigation, search

HOWTO: INSTALL: Ubuntu PPA Repository

sudo apt-get install dkms
wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian utopic non-free contrib" >> /etc/apt/sources.list.d/virtualbox.org.list'
sudo apt-get update && sudo apt-get install virtualbox-4.3

In the final line above alter the version number to the latest available.

HOWTO: Physical To Virtual

http://goo.gl/YJ4YwC

https://docs.google.com/document/d/1UFmoqJsQPO7p98Bv743xNsIF6BsdZruiJFkd3cqlb7A/edit?pli=1

http://serverfault.com/questions/33603/creating-a-virtual-machine-in-virtualbox-from-a-physical-one

http://www.macrium.com/help/v5/How_to/ImgToVHD/Create_a_virtual_machine_using_ImgToVHD.htm

http://www.sysprobs.com/physical-virtual-virtualbox-virtualbox-p2v

HOWTO: ADD: User To VirtualBox Group

Terminal :~$

sudo usermod -aG vboxusers username

HOWTO: FIX: Missing Menu Bar

To re-establish the menu bar (Machine - View - Devices - Help) on a running virtual press host+C (host is by default the right hand CTRL key).

HOWTO: FIX: Kernel Error

NEW

  1. Install gcc-4.9
  2. Reconfigure to use gcc-4.9
  3. Redo VBox Kernel drivers
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 30
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 30
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
which gcc
/usr/bin/gcc -v
sudo /sbin/rcvboxdrv setup


...

This error message when trying to start a virtual machine:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (2.6.24-21-386) or it failed to
load. Please recompile the kernel module and install it by

sudo /etc/init.d/vboxdrv setup

Until it is resolved you will not be able to run any VirtualBox virtual machines.

The error relates to a change of the kernel of the host system not being updated within VirtualBox.

To correct:

Terminal:~$

sudo KERN_DIR=/usr/src/linux-source-2.6.24   /etc/init.d/vboxdrv setup

Change the above line to reflect your running kernel.

Solution found here.

HOWTO: Command Line Tools

Help

VBoxManage --help

https://www.virtualbox.org/manual/ch08.html

List VMs

VBoxManage list vms

List Running VMs

VBoxManage list runningvms

Show VM Info

VBoxManage showvminfo "Ubuntu Server 16.04"

Start VM GUI

VBoxManage startvm "Ubuntu Server 16.04" --type gui

Start VM Headless

VBoxManage startvm "Ubuntu Server 16.04" --type headless

Shutdown VM

VBoxManage controlvm "Ubuntu Server 16.04" acpipowerbutton

Shutdown All Running VMs

VBoxManage list runningvms | sed -r 's/.*\{(.*)\}/\1/' | xargs -L1 -I {} VBoxManage controlvm {} acpipowerbutton