Entries Tagged as ''

Qemu-KVM

I am a big fan of VMware.  Ever since pre-ordering their Workstation V1.0 offering for Linux in 1999, I have been purchasing their upgrades over the years — the use of VM technology on a workstation for me was a no-brainer.  And even though other VM technologies have emerged, there was this decent community-edition VMware Player, which made it even easier to distribute VMs to run on workstations.

Over the past couple of years, I have tinkered with qemu from the command-line to test-drive “live” media on ISO files.  It was the easiest thing to do, not particularly fast, but very convenient and it ran entirely in userspace.  No need to worry about matching VM drivers with the kernel, or worse, having to boot-up the machine with a Xen-enabled kernel.  Yes, we live in a Right Now era.

With Fedora 12 installed, I have found that qemu and associated tools have matured a lot.  There is even this newer invocation, qemu-kvm, which leverages KVM (loaded as a dynamic kernel module) for wider and improved access to host hardware.  And since my workstation supports Virtualization Technology, I should expect even better speeds from qemu’s FAST! compiler.

Well, after creating a new Windows XP Professional guest using virt-manager, I was not too impressed by its speed.  It was usable, mind you, but it did not compare with what I was getting from VMware Player.  Curious though, other blog writers were writing about their successes and how excited they were with the results.  Could it be my expectations were too high because of what I was getting from VMware and Xen?

Well, this required a little digging just to make certain.

$ lsmod | grep kvm
kvm                   163952  0

Eh??!  Checking the boot log revealed that my processors VT extensions were NOT enabled in BIOS:

$ dmesg | grep kvm

Shocking!!  Re-booting and finding the darn BIOS setting to enable VT was all I needed to do.  After which, booting up Fedora 12 and launching the WinXP guest, I can now see the kernel module in use:

$ lsmod | grep kvm
kvm_intel              48184  4
kvm                   163952  1 kvm_intel

… and the speed is simply wonderful from what it was earlier.  Woot!

While virt-manager is an easy tool to manage a variety of VM guests, I wanted it even simpler to invoke.  I made this Avant Window Navigator launcher icon that runs this script simply as: winxp.sh start

$ cat bin/winxp.sh
#!/bin/sh
# ...what virt-manager does...
#qemu-kvm -S -M pc-0.11 -cpu qemu32 -m 1024 -smp 2 -name WinXP \
#         -uuid a71bb397-7edf-a068-bc36-96c6ec6df713 \
#         -monitor unix:/var/lib/libvirt/qemu/WinXP.monitor,server,nowait \
#         -localtime -boot c \
#         -drivefile=/media/Tank/virt/winxp.img,if=ide,index=0,boot=on \
#         -drivefile=,if=ide,media=cdrom,index=2 \
#         -net nic,macaddr=52:54:00:4c:bc:aa,vlan=0,name=nic.0 \
#         -net tap,fd=20,vlan=0,name=tap.0 -serial pty-parallelnone \
#         -usb -usbdevice tablet -vnc 127.0.0.1:0 \
#         -k en-us -vga cirrus -soundhw es1370
# ... let's use the management interface instead ...
[ -n "$1" ] && sudo virsh -c qemu:///system $1 WinXP
sudo virt-viewer WinXP &

And if I were to accidentally close down the VNC window to the WinXP guest without first shutting down the guest OS, I can also run this script as: winxp.sh shutdown

After my first re-boot, however, this launcher script did not work.  Running it from a shell showed it failed with a cryptic message that the virbr0 device did not exist.  Being familiar with Xen and its virtual bridge networking requirements, I hunted down where the libvirt daemon configuration is kept in /etc/libvirtd with the expected autostart subdirectories. Inspecting man virsh revealed the ‘right way’ of configuring virtual network adapters to startup after a re-boot:

$ virsh -c qemu:///system net-autostart default

Fini.

Legacy Engineering Group

A nice Christmas gift surprise arrived yesterday in the mail for me — it was a 14-month old order I made with this online store dubbed Legacy Engineering Group.  From what was reported, between health issues and an unprecedented demand for this product, it made for an equally unprecedented wait for me.  No worries, as I personally have just about every joystick created under the sun, but I would have liked to have bundled it with some retro-gaming software as gifts (last year, this year), but hey, there is always next year for that …

Anyways, I assembled one of the four for my personal collection, which was an easy insert-and-twist of the handle into its base.  And the supplied USB cable is ample in length.  Fired up the new VICE 2.2 software using Fedora 12 and its SDL UI immediately recognized the joystick as “USB HID v1.01 Gamepad [USB_Classic]“. No compatibility issues whatsoever — nice!

Even nicer was that old Atari joystick feel. As cheap and lightweight these joysticks go, nothing beats that old wigglin’ away and pounding that little red fire button as if pressing down any harder will make the 8-bit action perform any better — heh. I witnessed many such maneuvers from fallen opponents that took a classic beat-down from yours truly. The handle would creak mercilessly from the strain, followed by that wincing poppin’ sound of plastic giving in to the futile gesture. Usually, the busted joystick would go airborne and I’d have to go ducking.

Ah, thanks, Curt, for bringing back such lovely memories!

Atari-style joystick for your PC

Atari-style joystick for your PC

Mega-Cart ROM dump

A clever programmer (Daniel) created this special tool for Mega-Cart that does appropriate bank-switching and dumps the memory blocks to an IEC-based device — such as a Commodore 1581 floppy at .5mb chunks or the full 2mb dump of the cartridge to a more modern uIEC/SD device.  There were some failure issues on every attempt, but interestingly enough, I could get a complete dump if I slaved the uIEC/SD off of the Commodore drive instead of directly hooking it up to the VIC 20 — guessing that it made for more tolerance during its write-phase.  The programmer had no issues with his tool using a European PAL VIC, so perhaps the American NTSC version adds to the mystery.

Nevertheless, I am perfectly fine with a backup dump of my Mega-Cart, to be played using the new release of VICE 2.2 which supports the 2mb image, 8kb NvRAM, and all the appropriate bank-switching.  Cool!!

VICE Mega-Cart

VICE Mega-Cart

xvic -cartmega mega-cart.rom -mcnvramwriteback -mcnvramfile mega-cart.nv

‘Low End’ Computers (1985)

Ran across this info program from that day chronicling what the home computer giants, Atari and Commodore, were doing and envisioning.  Of course, Atari got Jack Tramiel, former CEO and founder of Commodore, or even they would not be in this picture.  It was cool seeing a glimpse of the (new) Commodore 128 and hearing about the future with Amiga.