Contact Form

Name

Email *

Message *

Search This Blog

Total Pageviews

Popular Posts

Translate

Saturday, September 13, 2014

Virtual Machines

I've agreed to talk about Virtual Machines at the September SVFIG meeting, and just noticed this posting in the InformationWeek Daily email: emc-vmware-not-for-sale. I didn't know that EMC owned 80% of VMware but ok, this is a good place to start.

VMware - http://www.vmware.com/

I can't remember when VMware became a standard tool for me, but I almost always have a Ubuntu box on my Win8.1 TaskBar these days. It used to be that I could only run a 32-bit "Guest OS", but now that I have a system that can handle the hardware and firmware requirements for 64-bit guest operating systems (1003945), I almost never run the 32-bit virtual disk file (VMDK).

You can either pay VMware for their Workstation or find their Free Player. In either case, I highly recommend downloading a Virtual Appliance to get started. With the Workstation, you can certainly roll your own guest, but it is so much easier to start with someone else's work unless you really like getting your hands that dirty. You can find just about anything in the Markeplace, but sometimes, it takes a little bit of work to find the version you want. I think the last time I started from scratch, I started here: Ubuntu 12.04 LTS Desktop, but then, updating it is handled by the guest.

Once you get used to playing with the guest, and learned how to back it up (~40GB) in the inevitable case that you mess it up, you can play with some of the settings. The VMX file is a standard text file that contains many useful settings, like the disk image (VMDK) file name. There are also utilities that can manipulate the VMDK to either split it up, combine it, compress it or repair it, depending on your needs. Over time, you will find the need to touch it, so just get used to that.

The integration between the host and the guest OS is where all the fun begins, and for the most part, VMware does a really good job, but it's never perfect. For example, determining which OS gets to have control over which device, especially if the device is removable (e.g. USB), can be problematic. However, I was able to get things like hub-ctrl to work, so just be persistent when you run into issues.

QEMU - http://wiki.qemu.org/

This is the generic, open-source way to emulate many microprocessors. Most recently, I was using it to experiment with eLua, but I can't remember if I ever did manage to get it running. It's not always easy to work with, but over the years, I've found various people who were willing to put in the effort and posted how to get things running. I remember one for colorForth, but it was enough different that the effort died after Chuck updated his system, many times. The instructions that could still find are for setting up Open Virtual Machine Firmware (OVMF), which is part of the Tiano Core UEFI support for Virtual Machines.

I got into this both during my last days at Apple as they geared up to dump OpenFirmware, and more recently at Nook Media, LLC as we tried to make a Win8 Nook before they killed their entire manufacturing capability. I was the only one who knew how to get started, so I pulled down qemu-w64-setup-20140801 and added it to my path. However, when I tried to run the code that I had compiled back then, it didn't run. So, I'm probably going to have to do all the setup process again before I can demo this piece. ;(

Setting up the compiler is problematic, but I found that the following command worked on the old image that I have: qemu-system-x86_64 -pflash ./bios.bin -hda fat:hda-contents

I just found this one recently. I downloaded DOSBox0.74-win32-installer and installed it. Then I simply mounted my old polyFORTH folder (MOUNT C C:\FORTH) and ran "PF HI EXPRESS LOAD MIXER LOAD RUN" and the Mix Master was running again. It's been years since I've been able to do that, but if you've got some old DOS apps, this is a good way to use them again.

As far as host integration goes, the basics work pretty well. There were no windows back then, without custom applications, so Alt-Tab gets you in and out from the mouse being captured.

The Mix Master is the demo that was include with FORTH, Inc.'s EXPRESS which was used by various projects, some of which are described in the following app notes:

VMGEN - http://www.rootr.net/man/info/vmgen

This is the smallest VM that I am aware of and it is fitting that it is part of the gforth distribution. There appears to be an ACM paper called Vmgen: a generator of efficient virtual machine interpreters, but I'm not a member and some slides here and another paper here.

Installing gforth is always an adventure, but I maintain mine in cygwin and pull down the development version in the git repository on Savannah. However, to get started from scratch, you need a precompiled executable for your platform, because gforth is required to compile gforth. On linux, use the standard package install method (e.g. sudo apt-get install gforth) or go to the Home of Gforth to find other distributions (e.g. Win32). Don't worry about it being the "latest" version, since you will typically build that from the git source.

Once you have it installed and checked, you can make and run the tiny Modula-2-like
language with a small JavaVM-like virtual machine called mini.

Dennis@DaRPC /usr/src/gforth/vmgen-ex
$ mini -h
Usage: mini [options] file
Options:
-h      Print this message and exit
-d      disassemble VM program before execution
-p      profile VM code sequences (output on stderr)
-t      trace VM code execution (output on stderr)

Dennis@DaRPC /usr/src/gforth/vmgen-ex
$ mini fib.mini
result = 9227465

You can also run gforth, which is another "product" of vmgen, but it uses many undocumented features that would be too confusing for the uninitiated (including me).

So, I think I will publish this now, so people can start asking questions, if they'd like to, or ask for more details, which I can research before the talk on 27Sep14.

I'd love to see more people come to the meetings, but if you can't, please be sure to catch the videos that we will post during and after the live meeting takes place.

DaR

No comments:

Post a Comment