How-To: Start VBox VM Using Scripts / Command Lines

From my previous post on how to run Bootcamp in VirtualBox, I just realize I forget to mention this launching tip, so here it is.

VirtualBox is a fantastic freeware. I really love it. It may not be as feature rich or efficiently good as other paid alternatives like VMware or Parallel, but it offers lots of great functionality, and is in active development.

To start a virtual machine (of VirtualBox) using command lines:

In Mac or Linux, open Terminal and type

vboxmanage startvm (vmname)

replace (vmname) with yours, for example Ubuntu, press Enter. That’s it.

If you use Linux, you can save this as a script file, and use it to start the vm instead.

In Mac, there is a neat and pretty way to start vm as app, using AppleScript. In AppleScritp Editor, type

do shell script "vboxmanage startvm (vmname)"

and save the file as an Application.

Save as Applications
By launching this app, it starts your VM. You can also change its icon, so it looks pretty and easy to recognize. This is how mine looks. I use Windows and Ubuntu icons found from the Internet (so they’re not mine), so I can distinguish them and they blend in my Applications folder well enough.

VM icons

New Pretty Icons

For Windows, you use similar approach with batch files. In Notepad, type this 2 lines in

cd "c:\Program Files\Oracle\VirtualBox"

vboxmanage startvm (vmname)

save as .bat file, and there you go, double click it to start the specified virtual machine.

Tips: If you don’t know what is your vm name, use this commands in Dos or Terminal, 😉

vboxmanage list vms

How To: Run Windows 7 (Bootcamp) in VirtualBox

Bootcamp is great and all, but… the fact that we have to reboot is not !

Sometimes you want to do a little task that really has to be run on Windows or there’s no alternative software for Mac, but you don’t want to reboot into Bootcamp to do it. And you want to keep Bootcamp, since it lets you run Windows to its potential. Well, VirtualBox can certainly help you ! It’s a great piece of freeware that I recently fell in love with.

It lets you startup Windows 7 that you have on Bootcamp as a virtual machine (VM) relatively easy. So the data stays in sync whether you boot up from Bootcamp or VBox inside Mac OS (since it’s really the same installation). Instead of creating a virtual hard disk file like normal virtual machine, it uses a small special file that essential let the VM access the real physical disk.

Step-by-step guide: Continue reading