QEMU: a Multihost, Multitarget Emulator
Looking back, a better size would have been 4GB, because that would have made it easier to create DVD backups.
Now that I had a virtual hard drive, I put my Windows XP Pro installation CD into my CD-ROM drive and launched QEMU with the appropriate arguments:
qemu -boot d -hda path/to/winxp.img -cdrom /dev/cdrom -m 256 -localtime
The -m 256 option set the memory allocated to the VM to 256MB—the default is 128MB, which is a bit small for Windows XP Pro. The -localtime option set the virtual BIOS clock to the local time on the host machine—the default is to set the BIOS clock to Universal Coordinated Time.
I found that installing Windows onto a virtual machine was very similar to installing it on a “real” computer. The installer comes up and has you choose where to install Windows. It asks you if you want to format your hard drive, prompts you to enter in your license key and so on. Once the base install was done, I shut down the VM, replaced my Windows XP Pro installation CD with my Microsoft Outlook installation CD and launched QEMU like so:
qemu -boot c -hda path/to/winxp.img -cdrom /dev/cdrom -m 256 -localtime
The only difference was to boot from winxp.img instead of from /dev/cdrom. The Outlook installation went like a typical Outlook installation—no real surprises there. When the Outlook installation was completed, I had a functioning Windows machine to call on whenever I needed it.
Now that I had my base operating system and needed application installed, I shut down the machine and created a GNOME launcher, so I could fire up my virtual Windows machine without typing it into my terminal every time. As you can see from Figure 4, I basically removed the CD-ROM info from the command, because I don't need a CD-ROM to be present during normal operation. Refer to the documentation for your distribution on how to create a custom application launcher.
There are a few ways to squeeze extra performance out of QEMU:
More RAM: the first thing I did was add more RAM. I did not want QEMU to have any reason to access my swap partition. Swap partitions are very useful, but too slow for resource-intensive tasks such as emulation. With more RAM, you get not only better performance from your VM, you also can run multiple VMs at the same time (see Figure 5 for an example of this).
KQEMU: the second thing I did to get better performance was to compile in the KQEMU accelerator module.
Set up a RAM disk: even with extra memory, there are times when QEMU needs to cache things to disk. To speed up this process, I set up a RAM disk. A RAM disk is a virtual disk drive created from free RAM. To create it, I entered the following into my /etc/fstab and then rebooted my machine:
tmpfs /dev/shm tmpfs defaults 0 0
A dilemma I ran into after I started using QEMU was how to get files out of my QEMU VM for backup purposes. The first method I tried was to install an SSH secure copy (scp) client for Windows and then use it to transfer files to myself. This works, but it was not as simple as I wanted the process to be.
The second method I tried worked much better. When starting QEMU, there is an option to specify a shared directory. QEMU makes it available to the VM through Samba, so you need to have Samba installed for this to work. The option is -smb dir—where dir is the directory on my host machine for which I want my Windows XP VM to have access. I then added the following line to C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS on my Windows XP VM:
10.0.2.4 smbserver
Accessing my shared folder from within my VM was then as easy as navigating to \\smbserver\qemu.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- RSS Feeds
- Trying to Tame the Tablet
- New Products
- What's the tweeting protocol?
- Dart: a New Web Programming Experience
- Reply to comment | Linux Journal
2 hours 10 min ago - Drupal is an Awesome CMS and a Crappy development framework
6 hours 49 min ago - IT industry leaders
9 hours 12 min ago - Reply to comment | Linux Journal
1 day 2 hours ago - Reply to comment | Linux Journal
1 day 4 hours ago - Reply to comment | Linux Journal
1 day 5 hours ago - great post
1 day 6 hours ago - Google Docs
1 day 6 hours ago - Reply to comment | Linux Journal
1 day 11 hours ago - Reply to comment | Linux Journal
1 day 12 hours ago








Comments
qvm86 is officially (?) obsolete
From qvm86's project site on Savannah a post from the admin:
-- BEING POST --
qvm86 is obsolete
posted by pbrook, Sunday 01/21/07 at 16:16 UTC - 4 replies
InnoTek have released their VirtualBox code under the GPL.
As far as I'm concerned this obsoletes qvm86, and I see no point continuing development. I recommend anyone interested in qvm86 use VirtualBox ...
-- END POST --
QEMU is alive
Actually, QEMU and VirtualBox are different products.
VirtualBox has a very nice GUI and is available both for Linux and Windows.
On the other hande, I find using QEMU very simple ;-)
BTW, great magazine article.