VirtualBox

From Freephile Wiki
Revision as of 18:09, 30 May 2018 by Freephile (talk | contribs) (add info about shared folders)

Jump to navigation Jump to search


First of all, if you're going to use VirtualBox with Ubuntu, and either dual-boot, or even if Ubuntu is the only thing on your machine, you will probably need to deal with EUFI Secure Boot. For example, if you have a Hewlett Packard system, you'll find instructions here for enabling and disabling Secure Boot. (hint; hit F10 at POST). While you're in your system setup (aka "BIOS" although it's not BIOS anymore) make sure you enable VT-x / VT-d

You'll always find a newer version of VirtualBox using the Oracle ppa, so use that rather than the packaged version that comes with your distro. Warning: if you've already got VirtualBox installed from packages, you should remove it (but not 'completely' meaning don't destroy your existing images). Also, under packaged Ubuntu, you can simply apt-get install virtualbox-guest-additions-iso; however with the PPA, you'll need to download it yourself.

You'll also want to download an ISO or two for your virtual machines http://releases.ubuntu.com/

Note: you don't have to mount the ISO, you can just select it by clicking the little folder icon during setup.

VirtualBox[edit | edit source]

"VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL)."

http://www.virtualbox.org/

Getting it[edit | edit source]

# prep
# Stop any virtual machines
vagrant halt qualitybox

cd ~/Downloads
wget http://download.virtualbox.org/virtualbox/5.0.26/virtualbox-5.0_5.0.26-108824-Ubuntu-trusty_i386.deb
sudo dpkg -i ~/Downloads/virtualbox-5.0_5.0.26-108824-Ubuntu-trusty_i386.deb

If you get a 'conflict with virtualbox' error, remove the existing package and re-try the previous install command sudo dpkg --remove virtualbox-4.3

You may also need to upgrade vagrant E.g. VirtualBox GUI runs fine, but 'vagrant up' does not. This happened to me when my installed version of vagrant 1.7.1 only supported VirtualBox <= 4.3. Upgrading to vagrant 1.8.5 added support for VirtualBox 5.x

sudo dpkg -i /home/greg/Downloads/vagrant_1.8.5_i686.deb

VBoxManage[edit | edit source]

Besides the GUI interface for VirtualBox, you can manage your VirtualBox machines with the VBoxManage command line tool.

Important Settings[edit | edit source]

Be sure to enable PAE/NX in the System -> Processor tab for your Ubuntu guests

Guest Additions[edit | edit source]

If you have problems with installing Guest Additions, see https://www.virtualbox.org/wiki/LinuxAdditionsDebug which describes what the drivers are, what they do, and how to install them manually.

Vagrant[edit | edit source]

"Vagrant is a tool for building and distributing virtualized development environments. By providing automated creation and provisioning of virtual machines using Oracle's VirtualBox (ed.: as well as other virtualization engines), Vagrant provides the tools to create and configure lightweight, reproducible, and portable virtual environments."

http://www.vagrantup.com/

The MediaWiki project uses vagrant and provides instructions as well as the configuration itself so that you can setup a development instance in a snap. See MediaWiki-Vagrant


Shared Folders[edit | edit source]

Once you create a shared folder in the VirtualBox UI, you may need to mount that folder from the guest.

E.g. for meza,

cd ~/src/meza
vagrant ssh # to get onto the guest
sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) opt_meza /opt/meza
# now the /home/greg/src/meza folder on the host is available to the vagrant user on the guest at /opt/meza

Disk Images[edit | edit source]

Learn more about VDI - Virtual Disk Images. All about how VirtualBox stores a 'snapshot' of a guest computer into a file on the host. http://forums.virtualbox.org/viewtopic.php?t=8046

Other Projects using VirtualBox[edit | edit source]

See Drupal/virtualization