Taming VirtualBox with VBoxHeadless and VBoxManage
First off, allow me to say, I have really come to appreciate Sun's VirtualBox. it really is the easiest open-source, cross-OS virtualization product I have found. I really hope Oracle keeps it rolling!
One of my favorite features of VirtualBox is that they have provided command line interface tools. The VBoxHeadless and VBoxManage programs allow access to a complete array of VirtualBox's functionality. You can create, configure, start and stop virtual machines all from the command prompt, thus meaning it can be all scripted via the normal methods.VBoxHeadless:
The VBoxHeadless program allows you to start a VirtualBox VM from the command line without the unnecessary step of launching the VirtualBox GUI application. To start a VM simply pass the -startvm <name|uuid> parameter...$ VBoxHeadless -startvm centos5or
$ nohup VBoxHeadless -startvm centos5 &The nohup version is only available under Linux, and lets you After you've given the VM ample time to complete it's boot, you'll be able to connect via ssh, vnc, Remote Desktop or any other method of connecting to a remote machine. NOTE: You should always shut the VM down from within.
VBoxManage:
The VBoxManage program is the meat and potatoes.Start a VM...
$ VBoxManage startvm "win7" VirtualBox Command Line Management Interface Version 2.2.2 (C) 2005-2009 Sun Microsystems, Inc. All rights reserved. Waiting for the remote session to open... Remote session has been successfully opened.
MD5 Hash in Python 3000
I normally use Python to quickly calculate MD5 hashes, so you can imagine my surprise when after typing 'import md5' Python returned 'ImportError: No module named md5'. It turns out that Python 3000 has decommissioned the md5 library in favor of hashlib, and it had been deprecated in Python 2.6...
>>> from hashlib import md5 >>> md5(bytes("password", "utf-8")).hexdigest() '5f4dcc3b5aa765d61d8327deb882cf99'
Starting MySQL
C:\_apps\mysql-5.1.30-winx64>bin\mysqld.exe --console
090109 18:17:34 InnoDB: Started; log sequence number 0 46409
090109 18:17:34 [Note] Event Scheduler: Loaded 0 events
090109 18:17:34 [Note] bin\mysqld.exe: ready for connections.
Version: '5.1.30-community' socket: '' port: 3306 MySQL Community Server (GPL)
090109 18:17:34 InnoDB: Started; log sequence number 0 46409
090109 18:17:34 [Note] Event Scheduler: Loaded 0 events
090109 18:17:34 [Note] bin\mysqld.exe: ready for connections.
Version: '5.1.30-community' socket: '' port: 3306 MySQL Community Server (GPL)