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.
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: wget http://download.virtualbox.org/virtualbox/4.2.18/Oracle_VM_VirtualBox_Extension_Pack-4.2.18-88780.vbox-extpack
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.