Category: VirtualBox

November 4th, 2013 by ronny


Create the virtual machine, named MySQL in this example:
VBoxManage createvm –name “MySQL” –register

We give it 512MB ram, enable acpi, boot on dvd and a bridged network card:
VBoxManage modifyvm “MySQL” –memory 512 –acpi on –boot1 dvd –nic1 bridged –bridgeadapter1 eth0

Create the virtual hard drive (Size in MB):
VBoxManage createhd –filename MySQL.vdi –size 10000

Set up the IDE controllers for the DVD player and the hard drive. We also mount an Debian 7 iso image into the dvd player:
VBoxManage storagectl “MySQL” –name “IDE Controller” –add ide

VBoxManage storageattach “MySQL” –storagectl “IDE Controller” –port 0 –device 0 –type hdd –medium MySQL.vdi

VBoxManage storageattach “MySQL” –storagectl “IDE Controller” –port 1 –device 0 –type dvddrive –medium /home/debian-7.1.0-i386-netinst.iso

The virtual machine should now be ready to run.
If you haven’t allready, installing screen would be handy. So you can free up your console if you like. apt-get install screen


To run the virtual machine from our example.
screen vboxheadless –startvm “MySQL”
You can now press ctrl+a and then ctrl+d to deattach from the process and have access to console again.

To stop the virtual machine you can do this.
vboxmanage controlvm “MySQL” poweroff

To unmount the installation iso, you can do that like this.
VBoxManage storageattach “MySQL” –storagectl “IDE Controller” –port 1 –device 0 –type dvddrive –medium none

To have your virtual machine to start up automaticly on boot. Add this to your boot script: vboxmanage startvm “MySQL” –type headless


If you need for some reasons to remove your virtual machine. You need to start with unregistering the hard drive, and then delete it. Then you can unregister the virtual machine and remove it. Here is how.
To list the hard drives: vboxmanage list hdds
Remove the hard drive: vboxmanage modifyvm “MySQL” –hda none
Find the UUID for the hard drive: vboxmanage showvminfo “MySQL” | grep vdi*
Unregister the hard drive: vboxmanage unregisterimage disk f3620364-399d-413b-b08e-d8b2f13392f0
Delete the hard drive file (of course use your own location): rm -rf /home/MySQL.vdi
Unregister the virtual machine: vboxmanage unregister vm MySQL

Your virtual machine and virtual hard drive is now gone.

Happy imagining!

Posted in Debian, Linux, VirtualBox, Virtualization

November 4th, 2013 by ronny

virtualbox_logoI find Virtualbox easy to work with, and usually stable. For performance I would check out KVM or XEN HVM instead. Update! The larger Linux distros are skipping XEN for KVM in latest versions.

Anyway, let’s get it in there.
Add it to the repository:
vim /etc/apt/sources.list

Add this line to the bottom of the sources file:
deb wheezy contrib

To add the public key:
wget -q -O- | apt-key add –

Time to update package list:
apt-get update

Ready to install VirtualBox:
apt-get install linux-headers-$(uname -r) build-essential virtualbox-4.2 dkms

VirtualBox is now installed. We want to add the extention pack, so we can install guest systems via remote desktop. Download current version of the extionpack:

If you need to run on another use than root:
adduser hostman(or any user you want) vboxusers

Your system is now ready to run. Ready to create and start guest systems.

Happy computing!

Posted in Debian, Linux, VirtualBox, Virtualization