Taming VirtualBox – or How I Learned To Love Launching Scripts




First off, let me say that I am an avid Linux user. I converted to using Linux as my main operating system in 2000, and I’ve never looked back. In fact, I’ll admit to being pretty smug about it for a long time, and if I’ve annoyed any of my long-time friends by snidely remarking about “upgrading” their Windows machines to Linux, I apologize.

(I wasn’t *wrong*, mind you… it really is an upgrade, but I apologize for the snide way I might have come across.)

((mostly))

ANYWAY, one of the things I’ve always been frustrated with is the very few programs that I really appreciate using which are not available on the Linux platform. As a minister, there are a couple of Bible programs that simply do not play nice with Linux. I have had some moderate success getting older versions of Windows bible programs to run in Linux using Wine, but as for the more highly integrated-with-internet-access offerings, I’ve had to resort to another trick.

VirtualBox.

For my non-geek readers, VirtualBox is a program which allows the user to create an operating system WITHIN an operating system. If you are running Windows, and you’d like to experiment with using a Linux app, you can create a virtual machine, and run Linux inside of that. I, of course, do the opposite – I run Linux full time, but for those Windows programs I just can’t live without, I run them in a virtual machine of Windows XP.

To clarify: my Bible applications are running on Windows XP *inside* of a virtual machine, which is actually a program running on my Linux box. Clear as mud, right?

Well, here’s the nifty part, as far as I’m concerned: I’ve found a way to set up a specific shortcut which allows me to specifically launch one particular program within WinXP inside of my virtual machine from my home system. I imagine a Windows user could do the opposite process and launch Linux programs like GIMP directly from their Start menu if they wanted. Here’s how it works on my system, assuming that a Linux user already has VirtualBox installed, with a WinXP virtual machine:

1) in virtualbox, start your virtual XP machine, and install whatever program you want to access. In my case, I installed two Bible programs, WORDsearch and Logos 4. Once everything was installed, I opened ONE of these programs, and set it up to be exactly how I wanted it to be when I access it (maximized window, resources that I knew I’d use already loaded, that kind of thing).

2) Once the program is running the way you want it, CLOSE the virtual machine (not within WinXP, but within the “Machine” menu of VirtualBox, and SAVE the MACHINE STATE. This means that the next time you start the virtual machine in VirtualBox, Windows XP will fire right up with your program already started and ready to go – no login, no boot up sequence, just the program.

3) Once complete, shut down the VM, return to the main VirtualBox window, and click the Snapshots tab. Highlight the Current State, then click the Take Snapshot icon and give it a name and description, e.g. “WORDSearch″.

4) Now, start your virtual machine from your saved snapshot (which will put you right back to where you left), and set up your NEXT program you want to use. Close the first one (I closed WORDsearch), and then start your next program (Logos 4, in my case), and get IT set up just how you want it. Once set up, then within the “Machine” menu of VirtualBox, and take a different snapshot. Give it a different name (in my case, Logos). You should now have two different snapshots, each with a different saved instance of Windows running the specific program you like.

5) The cool bit: you can directly from the command line access specific snapshots. It takes two commands:
> vboxmanage snapshot “YourVirtualMachineName” restore “YourSnaphotName”
> vboxmanage startvm “YourVirtualMachineName”

The first command tells VirtualBox to select the specific snapshot that you’ve named. In my case, it’s either WORDSearch or Logos. The second command tells VirtualBox to start using that specific snapshot. When you combine these two commands in one shell script (or batch file, for you Windows people), you can directly launch your virtual machine with your saved state with your preferred program already running. Here’s the script that I’m using:

#!/bin/sh
#launcher for virtualbox logos4
vboxmanage snapshot "XtraPainfulToo" restore "Logos"
vboxmanage startvm "XtraPainfulToo"

I’ve saved this script, make it executable, and put in with all my other scripts.

6) Create a launcher which calls your script. Some of you might use a desktop icon launcher, or a .desktop file, or a keyboard shortcut. The end result is that you’ll need some way to launch this script. In the background, your computer will run the script, and the only thing you’ll see is your Windows program popping up on your Linux screen.



I hope that’s clear enough for you to start using this process. I have found it very helpful in my day-to-day use of WinXP programs inside of Linux, for those programs that I just can’t work without. Clarification for this process was found in articles at http://www.sitepoint.com/virtualbox-branched-snapshots-tutorial/ and http://www.virtualbox.org/manual/ch08.html#idp58552576

About these ads

1 Response to “Taming VirtualBox – or How I Learned To Love Launching Scripts”



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Pastor Ed Backell

Flickr Photos

teepeeindiangirls1

x-default

rachelthrone

More Photos

Pastoral Tweets

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 649 other followers


Follow

Get every new post delivered to your Inbox.

Join 649 other followers

%d bloggers like this: