background preloader

VirtualBox

Facebook Twitter

VBoxManage. As briefly mentioned in Section 1.16, “Alternative front-ends”, VBoxManage is the command-line interface to VirtualBox.

VBoxManage

With it, you can completely control VirtualBox from the command line of your host operating system. VBoxManage supports all the features that the graphical user interface gives you access to, but it supports a lot more than that. It exposes really all the features of the virtualization engine, even those that cannot (yet) be accessed from the GUI. You will need to use the command line if you want to use a different user interface than the main GUI (for example, VBoxSDL or the VBoxHeadless server);control some of the more advanced and experimental configuration settings for a VM. There are two main things to keep in mind when using VBoxManage: First, VBoxManage must always be used with a specific "subcommand", such as "list" or "createvm" or "startvm". Second, most of these subcommands require that you specify a particular virtual machine after the subcommand. 8.5. 8.6.

Port Forwarding

Run VirtualBox headless over an SSH session. When SSH’ing into a linux box, you may want to run a VM headless (that is, not dependent on the console X session).

Run VirtualBox headless over an SSH session

TO RDP into your windows box (assuming you are running a Windows VM over Linux), you’ll want to be sure to engage your -L port:ip-address-of-VirtualBoxHost:port, port forwarding. Assuming you have VirtualBox remote port forwarding engaged (which will forward ports into the VM, for example if you’re running Windows XP as a VirtuaBox VM and you want to RDP into it on port 3389), I discuss port forwarding on VirtualBox hosts, here. Though VirtualBox supports a quick and easy VRDP option to enable for easy RDPing into a box without having to do any of the complex port forwarding, my port-forwarding post explains how to forward other ports to your VM for any other applications or if you want to RDP into your Windows VM on a port other than 3389.

To engage the VM over an SSH session, simply type: VBoxHeadless -startvm "Name of VM Here" VBoxManage list vms rdesktop localhost:3389. VirtualBox’s Little Secret: The Command Line. Casual VirtualBox users might not know about the awesome power that lurks just beneath the surface in the Command Line Interface (CLI).

VirtualBox’s Little Secret: The Command Line

The most obvious question is, “Why work at the command line when you have a perfectly good GUI?” The answer is power. Since 1995, there’s a whole generation of computer users who think that the computer is a collection of windows and graphics, but, in reality, nothing could fall farther from the truth. Why, 1995, you ask? 1995 ushered in a new age of graphical computing with the introduction of Windows 95. It may surprise you to know that sneaking around under that cute VirtuaBox GUI, with its colorful graphics, explicit Settings page and numerous dropdown lists, is the occult world of the command line. Command Line Power The rectangular box to which I refer is the terminal window. For virtualization, the command line allows you to rapidly create virtual disks, add a new network interface, start VMs and create new VMs, all without the use of a GUI.