The Best of Both Worlds
I recently bought an IBM ThinkPad laptop with 1GB of RAM and Windows XP preinstalled. Because I have been using only Linux for many years, I immediately thought about making it a dual-boot system (actually a multiboot system, because I usually install several copies of Linux on my computer).
As I said, I mainly use only Linux, but I also keep a copy of Windows around, because other people may need to use my computer who are not able to use Linux. Also, being a computer specialist, I like knowing all the ways of using a computer, not only the best one, and as many people still use Windows, I want to understand their points of view.
So, I now can reboot and switch from Linux to Windows and from Windows to Linux. However, I thought it would be useful to run both systems in parallel, instead of switching from one to the other. One of the reasons for this is the Windows XP Home Edition that was installed on my laptop is customized by IBM specifically for this laptop, and there are some tools developed by IBM that make things more convenient. Another reason is that I wanted to test a client-server network with Windows as the client and Linux as the server. I'm sure you can think of other reasons for doing this as well.
After some research and testing, I decided to use QEMU. Now I can run any of the Linux distributions that are installed on the other partitions on Windows. I also can access Windows from the Linux system. I can access the Internet from the Linux system, and I can access any of the Linux services from Windows. Additionally, I can access certain Linux services from the network. It's like having two systems running on the same machine at the same time.
Running Linux inside Windows using QEMU is not difficult; however, doing it well requires some tricks that I didn't discover immediately.
Installing QEMU in Windows is easy. I downloaded qemu-0.9.0-windows.zip and extracted it in D:\QEMU. I didn't forget to read README-en.txt (always read READMEs). Then, I made a copy of the batch file (script) qemu-win.bat and renamed it start-linux.bat. To access it more easily, I created a shortcut (link) for it on the desktop by doing a right-click and selecting Send to→Desktop. Then, I modified the last line of start-linux.bat to look like this:
qemu.exe -L . -m 128 -hda \\.\PhysicalDrive0 -soundhw all -localtime
The modification consists of replacing the parameter -hda linux.img with the parameter -hda \\.\PhysicalDrive0. Now, when I start QEMU by running this script, instead of using the file linux.img as a virtual hard disk, it uses my real hard disk and boots from it. Then, I see the beautiful GRUB menu that is installed in the MBR of my hard disk, and I select and boot one of my Linux systems. Isn't it great?
Be careful not to boot Windows again inside Windows. According to the documentation, using the same disk image in more than one machine can corrupt it.
The system that I usually boot inside Windows is Fedora Core 6. The parameter -m 128 tells QEMU to use up to 128MB of RAM for the emulated system. With 128MB of RAM, Fedora isn't able to run in graphic mode and falls back to text mode. However, with 256MB of RAM, it works. If you have 1GB of RAM in your machine, like me, you could be generous and give 512MB to Linux.
The graphical interface is important to me, but I am quite happy with command-line Linux. In order to run Fedora in text mode, even though it has 256MB of RAM, I pass the 3 parameter to the kernel, which tells it to boot in run-level 3. Initially, I did this manually, with these steps:
Select Fedora in the GRUB menu.
Press E to edit it.
Select the kernel line.
Press E to edit it.
Append 3 at the end of the kernel line, and press Enter to return.
Press B to boot the modified Fedora entry.
Later, I added another entry to the menu, with the 3 parameter appended to the kernel line in order to boot it more quickly, which looks like this:
title Fedora Core TextMode (2.6.18-1.2798.fc6)
root (hd0,7)
kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/hda8 rhgb quiet 3
initrd /boot/initrd-2.6.18-1.2798.fc6.img
Sometimes I see several error messages and failures while Linux is booting (for example, when I tried Scientific Linux), but I ignore them. The reason for this is the hardware of the emulated machine (which is being emulated by QEMU) is somewhat different from the hardware of the real machine. The same thing happens when the hard disk is taken from one machine and placed in another. Linux autodetects the machine's devices and reports that some devices are missing and new devices are added (for example, network cards). I simply keep the configurations of the “removed” devices and let Linux autoconfigure the new devices it finds.
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 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- A Topic for Discussion - Open Source Feature-Richness?
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Home, My Backup Data Center
- New Products
- Paranoid Penguin - Building a Secure Squid Web Proxy, Part IV
- Trying to Tame the Tablet
- Developer Poll
- Looking Good
42 min ago - Hey God - You may not be
4 hours 55 min ago - Reply to comment | Linux Journal
7 hours 28 min ago - Drupal is an Awesome CMS and a Crappy development framework
12 hours 7 min ago - IT industry leaders
14 hours 29 min ago - Reply to comment | Linux Journal
1 day 7 hours ago - Reply to comment | Linux Journal
1 day 9 hours ago - Reply to comment | Linux Journal
1 day 11 hours ago - great post
1 day 11 hours ago - Google Docs
1 day 12 hours ago





Comments
Booting Windows from Linux via Qemu
The article is great and I successfully booted my Linux installation via Qemu. I am interested in booting my Windows installation from the Linux side using Qemu. If you have any suggestions please post them.
Thanks,
JPM
I have tried (months ago)
I have tried (months ago) with something like: '-hda /dev/hda' , and I remember that I have failed.
Anyway, a QEMU virtual machine has different "physical" devices compared with your real machine.
So, if the windows partition is booted inside it, I guess that it is going to find "new hardware" etc.
It is something similar to removing the hard disk and booting it inside another machine.
While linux is flexible enough to endure this kind of migration, I am not sure about windows, it has
to be tried.