Autostart a Virtualbox VM in Windows 7 the Easy Way

Update: I’d suggest checkout out James’ solution in the comments as an alternative to mine which doesn’t require 3rd party programs. I haven’t tested it yet so let me know if it works OK for you.

I’ve seen a few tutorials out there about setting up a headless Virtualbox service in windows in order to autostart a VM and wasted a few hours of my life following pages of instructions ending in giving up. I recently reinstalled windows 7 on my home HTPC/Server and wanted a linux VM to autostart whenever Windows decided to run updates and auto restart. I swore I wouldn’t attempt the awful services method again and would insead follow the principle of keep it simple stupid.

My only caveat in setting up this autostarting headless VM was that Windows 7 remain password protected when it started up (task scheduler’s on start trigger function didn’t prove much help with this goal BTW)…a little less simple but I managed to keep it under 3 steps somehow, mostly thanks to superuser’s superb knowledge base and some luck googling. Keep in mind I have a single user setup on this windows 7 machine. Multiple users might require you force the machine to always logon to your VirtualBox/Startup script user by default after a reboot…so you’ve been warned. Here’s how it’s done:

  1. download hstart (see README)
  2. Remove/un-check the “User must enter a username and password to use this computer” checkbox option from Start -> Run -> `control userpasswords2` (But wait…didn’t you just say…YES KEEP READING)
  3. write a batch script in your startup folder containing (psudocode): C:/hstart.exe /NOCONSOLE “VMBoxHeadless.exe -start-vm ‘your-vm-name'” followed by “rundll32.exe user32.dll,LockWorkStation”

The name VMBoxHeadless is a bit misleading since you still have a cmd window to leave open as long as you want your VM running if you run it through a batch script, that’s where hstart comes in. Then you have to tell windows to logon automatically instead of waiting for the user to enter a username/password. Finally your batch script run VMBoxHeadless through hstart and then just re-locks your computer afterwards and you have a primed and ready VM waiting for you upon restart. If your VM name has spaces it might require escaped quotes or single quotes around it, I used a hyphen in my name so I didn’t have to deal with that problem.

Here’s an eaxmple batch script

C:\Users\HTPC\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\hstart a-serv headless.bat:

"E:\scripts\hstart64.exe" /NOCONSOLE "C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe -startvm a-serv" 
rundll32.exe user32.dll,LockWorkStation

References (yay superuser!)
What is the best way to hide a command prompt window?
Command line cmd command to lock a windows machine

Synchronize save games between windows computers. Cloud save games with Dropbox. [Minecraft/Dragon Age]

Steam Cloud in games like Valve’s Half Life franchise and Torchlight is really handy for synchronizing save games across laptops/desktops or work computers. But I want it in more games! So I did it my self with some easy symbolic links and a Dropbox account (signup for one now using my link if you don’t have one yet). Here are two quick examples of how you would make Minecraft and Dragon Age: Origins saves go to your dropbox rather than your user account tied to your computer.  You’ll have to do this on each computer you want to syncronize save games to the cloud.  Keep in mind, if you don’t know what you’re doing and screw up you might loose your saves by trying this so here’s your warning: Back up your save folders before running the below commands.

I’m writing the symbolic link commands so they are as copy pastable as possible, for multiple windows releases. If all else fails, use the full path rather than the environment variable (%APPDATA%, %HOMEPATH%).

Lets Begin, first make a folder in your dropbox folder called ‘Game Saves’ to house your new save games. Then within this new saves folder make a folder for your games, (e.g. Minecraft/Dragon Age)

Now you need to know where your save game folder is for each game, we’ll start with Minecraft. In either windows XP, Vista, or 7 you can just go to your Start button, Run (or windows+R shortcut) and enter `%APPDATA%\.minecraft\` and you’ll see the saves folder. Move it to some place safe or just rename it to “saves_backup”. Then you want to put another copy of the `saves` folder in your newly crated `Dropbox\Game Saves\Minecraft\` folder. [Note: Copying a large Minecraft saves folder can take a while because of the massive amount of tiny files used by Minecraft]

After that’s done successfully, open another Run prompt from the Windows Start menu and this time type in `cmd`. In the black DOS command prompt that opens enter this (Note you may need to change the Dropbox path if yours is “My Dropbox” or customized)

mklink /D "%APPDATA%\.minecraft\saves" "%HOMEPATH%\Dropbox\Save Games\Minecraft\saves"

For Dragon Age: Origins you should find your save games in `%HOMEPATH%\Documents\BioWare\Dragon Age`. Move and or backup the Characters folder. Then copy the Characters folder to `Dropbox\Game Saves\Dragon Age Origins\`

mklink /D "%HOMEPATH%\Documents\BioWare\Dragon Age\Characters" "%HOMEPATH%\Dropbox\Save Games\Dragon Age\Characters"

Just to reiiterate the fact you have to change your path, here is another command I had to run using a different dropbox path (one computer used ‘My Dropbox’, the other just used ‘Dropbox’ for some reason).

mklink /D "%HOMEPATH%\Documents\BioWare\Dragon Age\Characters" "%HOMEPATH%\My Dropbox\Save Games\Dragon Age\Characters"

This concept is easily applied to any game. Just change the paths to match where that game’s saved files folder are located; usually they’re in my `documents/my saves`, or` my docuemnts/publisher name`, or one of application data’s folders.

Spamato vs SpamBayes [Win7]

Which spam prevention product wins: SpamBayes vs Spamato? SpamBayes is the clear winner in my mind.

I used Spamato with my outlook 2007 first and recently switched to Spambayes because Spamato simply wouldn’t work with Windows 7 even after going through an enormous hassle of hacking Microsoft’s .NET Framework 1.1 installer to get it to install in Windows 7.

I’m really glad I switched, SpamBayes has amazing accuracy when trained with your Spam/Ham folders. It even has a ‘Junk Suspects’ folder which has caught all (1 or 2) my ham messages which is mistook for spam. I don’t think any Ham has ended up in the Junk folder unless it was an automated mail/newsletter and those quickly stopped going to junk after useing the ‘recovering from spam’ toolbar button to improve training.

I used Spamato for more than a year and it works fairly well, I liked it and recommended it to others. Every time I recommended it to a non technical person I cringed a little bit after remembering the fact that it requires a couple, not so simple to explain over the phone, prerequisites.

The finite accuracy seems better in SpamBayes and the installation is definitely a hell of a lot easier than Spamato.

Outlook 2007: None of the Authentication Methods Supported By This Client Are Supported By Your Server

Can’t send from certain locations and keep having to turn on/off outgoing server SMTP Authentication in outlook 2007? You might see this error too: “None of the Authentication Methods Supported By This Client Are Supported By Your Server

My Answer: Goto Email Accounts, Change the problem account, More Settings, Outgoing Server tab, and check outgoing server require authentication and choose “Log on to incoming mail server before sending mail” instead of “Use same settings as incoming” – Outlook 2007 is the first and only mail program to require any of our mail servers to use this setting. So far I’ve only confirmed the problem to be on older sendmail servers. There can be other solutions to this error message but this is one I find most often resolves it.

The Question: As a systems administrator I take calls for our tech support queue and one user called with a really odd problem. Basically it’s detailed here:

Like the above link describes the user would have to disable SMTP auth in certain locations (That’s a workaround, not the solution), even though all our servers require SMTP authentication. The above link eventually shares the true solution but it’s buried under many comments thanking the poster for the work around. So I decided to help fellow googlers by making this post.

Update: Comments about other people’s experience with this error made me want to add my further experience with it. I’ve seen this error a lot more often since I first made this post and am convinced it’s really some sort of bug with Outlook 2007. Some people cannot get rid of the error and have to continually switch between “Log on to incoming mail server before sending mail” and “Use same settings as incoming” to keep outlook sending correctly. Whereas if they switch to Windows Mail (The Vista and Windows 7 equivalent of outlook express) they never need to do anything but set ‘use same settings as incoming’ and never have any problem sending. If it’s not a ‘2007 Bug’ then it’s definitely a Outlook 2007 incompatibility with certain MTAs – specifically (maybe just older) sendmail – our postfix servers don’t seem to have this bug, but like I just said only 2007 has this incompatibility so you can’t entirely blame sendmail.

Windows 7 – What I do after installing

I thought I’d make a list of applications I usually need after a fresh windows install and what order I install them in. Since this time I’m using Windows 7 (W7) Beta I’ll be commenting about major differences I take notice of about W7 along the way too – I’ve had tastes of Vista before so I know my way around their new control panel and other menu changes. Note I’m running the 64-bit version so some of my links are to 64-bit apps/drivers.

Windows 7 bugged me about anti virus right away so I grabbed that first…
Continue reading