Quantcast
Channel: HackHut » Windows
Viewing all articles
Browse latest Browse all 3

Turning VMWare Workstation into Server, kind of, and with still limited features

$
0
0

I introduced Misaka to you earlier and a RAM upgrade for her should be shipping the next days. I also told you the beautiful sexy’s mainly virtualizing things. There’s only a limited number of options, though, if you want to have a Windows host and virtualize stuff with the (perceived) need for state of the art options and the good performance. I don’t mean to say that my way’s the best or even good, but as I’ve been working with VMWare stuff for some years I chose to stay with Workstation under these circumstances.

The, on top of all, free Server has some benefits. It runs service based, comes with features to start and stop VMs with your host and also remote management options. Those have a crappy feel to them, imo, but there’s also a command line utility that allows to send commands over the network for all kinds of basic VM operations. I’m using it at work and it does a great job there because it’s been made for exactly what I use it for there. And some of the functionality was missing with Workstation.

Problem number one was that the running VMs are bound to a user account. Especially if you log off there’s the problem that all machines just get their power cord pulled. That’s nothing difficult and instead of writing some log off script that gets the names of all running VMs and the suspends them or shuts them down I just switched to using a dedicated account. Also comes with the benefit of being able to remote into the box while the GF watches television. Just needed some hex editing… Google for concurrent RDP sessions and Windows 7 for instructions.

Problem number two was the missing options to have VMs start with the host. I don’t have quite the original options, but a batch file in the autostart folder’s good enough for me.

Problem number three was a bit more difficult, though. With the RAM getting short the need to shut down and start up certain VMs from time to time came up. The usual way of doing this by remoting into the host and using the UI was getting tedious for the always same clicks. While Server’s got the possibility of using command line and network, Workstation lacks that. But with the host providing network shares that’s something easily solvable by crude methods. Kludging time!

The host starts a batch file at logon, which also triggers VM boot, and this thing loops indefinitely. It looks for the existence of certain files and if they exist it performs commands. Example:

:start
if exist “U:SomePathFilename.customextension” (
“C:Program Files (x86)VMwareVMware Workstationvmrun.exe” -T ws start “U:Path to VMVM.vmx” nogui
echo debug output: VM started
del “U:SomePathFilename.customextension”
)
goto start

That’s crappily simple. No, I am not even going as far as fetching the commands from the file placed there by a simple call statement. Issuing the command is kludged in a similarly facepalm inducing way. See:

echo sending command > “U:SomePathFilename.customextension”

You could just alter this stupidly simple solution easily to look just for a single, certain filename on the machine to be remoted that gets called if it exists and deleted afterwards. Then you’d just need to echo the batch you want to be executed remotely. If there’s enough error handling to have the script terminate under any circumstances that’s as good as writing directly to a remote console without reading the output. Of course you could have it echo into a file and just read that, too.

Of course a lot of you surely think “D’uh, tell me something I haven’t known when I was 12 already!”. So did I after getting that idea. But I wouldn’t be surprised if this actually inspires some people, as the blatantly obvious solutions often get overlooked. Especially since we’re used to having a GUI with buttons for everything these days.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images