View previous topic :: View next topic |
Author |
Message |
spacezmonkey n00b
Joined: 26 May 2004 Posts: 52 Location: Singapore
|
Posted: Tue Jun 15, 2004 5:56 pm Post subject: QEMU & Windows 98 How To |
|
|
somebody had created this website, which i think is very useful if you are new to QEMU. 3 cheers to Hetz Ben Hamo for his instructions.
Original website:
In this small how to, we will learn how to use QEMU (version 0.5.6 and above) to install and use Windows 95/98/98SE/ME operating systems.
Note: this "how to" requires basic knowedge of compiling. If you have the QEMU binary, you're off the hook
You'll also need the knowledge of DOS's FDISK, format, etc (basic DOS stuff) and how to install Windows.
For this how to, I used Windows 98SE, but the instructions apply to Windows all the Windows 9X variants...
First, we will need to compile it (if you don't have a binary installed. There are binaries for Gentoo and Debian unstable, use your favorite tool to install it if you're using one of those distributions, but make sure you have installed 0.5.6 or above).
If you have QEMU compiled and installed, jump to phase 2 directly.
Phase 1 - compiling, installing
You can either grab the sources from CVS with the instructions provided here , or you can get a nightly snapshot from my web site, here. Make Sure you have building tools installed on your Linux machine if you plan to compile (cvs, gcc, etc..)
After you grabbed the sources, extract them (only needed if you grabbed a snapshot tarball) and go inside the directory which has been created.
Perform the following commands:
Code: | ./configure --prefix=/usr --enable-slirp
make
|
Your Linux should compile QEMU without much problems. On an average machine this could take few minutes.
If you see that you have some problems with libSDL while compiling, then make sure you have the latest SDL (available here, make sure you also install the "devel" package if you're using RPM). Red hat 9 users who installed XFree86 4.3.0-33 should upgrade to the latest XFree86 4.3.0 to fix some problem with X.
After compiling, type the following command:
Code: | su -c "make install" |
This will ask you for your root password. Type it and press enter. Within few seconds you'll have QEMU installed on your system.
Now that you have QEMU, we'll need to make some preparation to install your Windows.
Phase 2 - preparing to format the "hard disk"
First, in order to make things look clean, make a directory where we would creature disk images and put ISO images there (and log files, if necessary). Use (for example): mkdir qemu-test ; cd qemu-test to create and go to this directory.
We will need to create a hard disk image. The following command will create a 1GB "hard disk" image. I recommend to create a directory (use: mkdir to do this job) and then run this command:
Code: | dd of=hd.img bs=1024 seek=1000000 count=0 |
We'll need a "bootable" floppy image. You can get floppy images from
here
. (I recommend downloading the OEM versions). Make sure you unzip the file and move it into the new directory you created with the hard disk image. (you can ignore the errors from the disk image).
Note: If you are using kernel 2.6 (or you're using a distribution like Fedora Core 2 or Mandrake 10), you'll need to setup your to have 1024Hz timer. To do that, do (as root):
Code: | echo 1024 > /proc/sys/dev/rtc/max-user-freq |
(You can add this line to your /etc/rc.d/rc.local so each time your Linux boot, it will be done automatically)
Lets boot qemu with the floppy image and the new hard drive image. Use the following command (note: the boot98sc.img is just the name of the floppy image that I use. Replace it with your floppy image name):
Code: | qemu -m 32 -fda boot98sc.img -hda hd.img -boot a |
You should see now something like the following screenshot:
[img:6d95187756]http://dad-answers.com/qemu/howto/snapshot1.png[/img:6d95187756]
You'll need to format your "C:" driver. Use the FDISK command to create the partition that you want, reboot (by going back to your terminal, typing "q" and restarting QEMU with the same command), and then use FORMAT C:/S to format your partition. No other modifications needed. Quit the emulator once you have your "hard drive" ready (by typing q in the qemu console in your terminal window).
Phase 3 - preparing Windows installation
At the moment of writing this HOW TO, QEMU cannot use real CD media's, you'll need to create an ISO image of your Windows installation. Use your favorite CD burning program to create the ISO image (many of those programs refer to this as a "virtual recorder"), and simply put all your Windows installation folders to this ISO image. When you're done, move this ISO image to your QEMU testing directory. Recommended ISO images recoding applications for Linux: CDBakeOven, K3b, Gnome-Toaster.
Lets boot QEMU with the floppy that we used to format the "hard drive", the "hard drive" itself and the ISO "cdrom" that we created:
Code: | qemu -hda hd.img -fda boot98sc.img -cdrom win98.iso -boot a -m 64 |
This would boot the floppy with your "hard drive" image and Windows 98 ISO (the -m is the amount of RAM QEMU will use). You should quickly see the MS DOS screen. Make sure your "hard disk" is formatted (check C, and then CD to your CDROM (in my case: R, then CD to the Windows install directory and type: setup
Follow the on-screen instructions just like a real Windows 98 installation. Here is an example screenshot:
[img:6d95187756]http://dad-answers.com/qemu/howto/snapshot2.png[/img:6d95187756]
Proceed with the installation as usual. (Windows will ask if you want to create a start-up floppy disk - skip it). When it finished, you'll be "rebooted" back to the old MS DOS screen (since we've boot from floppy). Quit QEMU in the terminal (use "q" to quit) and type the following command:
Code: | qemu -hda hd.img -cdrom win98.iso -boot c -m 64 -user-net |
Proceed with the on-screen instructions and let it detect the devices. After it finishes detecting devices, it will quit QEMU. Run QEMU again with the same command above.
After a while, Windows will detect the NE2000 virtual card, like the following screenshot:
[img:6d95187756]http://dad-answers.com/qemu/howto/snapshot3.png[/img:6d95187756]
Change the Interrupt (IRQ) to 9/2 and leave the I/O address range at #300-31F. Click OK. You'll be asked to add computer name and workgroup, so if you plan to join an existing workgroup, type the name correctly. (more on Network issues - see in Phase 6).
Windows will ask you to set the Time and Date. You can leave them unchanged since QEMU at the moment does not have a full time accurate support yet. Click OK and let it continue the setup.
Once it finished, it will reboot and exit QEMU. Again, re-run the command above to re-launch QEMU. You should get the familiar Login screen (you might also see some hardware detection like "default monitor" and "updating system setup" - thats perfectly ok).
Login with your user name and password (since it's a first time install, the password is empty). You should see Windows 98 screen with the "Welcome" opening, like this:
[img:6d95187756]http://dad-answers.com/qemu/howto/snapshot4.png[/img:6d95187756]
Congratulations! You have Windows 98 running for the first time. Now it's time for the other hardware parts to be setup.
Phase 5 - Graphics
As you can see from the screenshot, 640x480 with 16 colors is not exactly a nice look. At the moment, QEMU is emulating Vesa 2.0 specs, so you can go up to 1024x768 with 32 bit color. (future QEMU will have a SIS graphics chip emulation with much better modes).
In order to do so, download the following files to your host OS and create an ISO image in order to use them:
pmhelp.vxd
Scitech Display Doctor 7 beta
Quit QEMU and restart with your new ISO (I called mine "graphics.iso", replace this name with your ISO file and location [if it's not inside your "qemu-test" directory):
Code: | qemu -hda hd.img -cdrom graphics.iso -boot c -m 64 -user-net
|
Open a DOS windows and copy the pmhelp.vxd to c:\windows\system. Close the DOS window.
Run the SDD setup program and follow the on screen instructions.
SDD will ask to reboot the virtual machine, let it do so (this will quit qemu), re-run the above command.
After rebooting and login, Scitech Display Doctor will appear. Close it. We don't need it.
Right click on an empty screen space, select Properties, Settings tab, Advanced, Adapter, and click "change".
Click "Next" and then select "Display a list of all the drivers..." and click "Next". Windows will build a database of cards.
You should see "Scitech Display Doctor" - select this driver and click "Next". Windows will try to warn you, click "Yes", and then "Next".
Windows will try to install the driver and will alert you that he's looking for some part of the driver. Click "Browse" and go to C:\Program Files\Scitech Display Doctor\Disk - select the file and click "OK" to continue installation. When it finishes, click "Close" at the bottom of the window. click "Close" and you'll be headed back to the Properties screen. Click "close" (thats the almost-unseen botton at the end of the screen) and windows will ask you (guess what..) to reboot. Select "No" and do a restart from the Start Menu (select "shut down"). QEMU will quit, restart it with the command above.
When Windows will start again, you'll see the window screen much better, but Scitech will nag you to register and purchase the product (which is no longer available). You can skip it by using the following instructions:
Click Start, select "run" and type: msconfig
Select Startup
Remove the check marks from "Check for SDD Update" and from "Start SDD Quick mode tray icons" and click "OK"
Windows will ask if you want to reboot. Click No
Next time - no more nagging
Now you can enjoy full colors, browse the net etc...
[img:6d95187756]http://dad-answers.com/qemu/howto/snapshot5.png[/img:6d95187756]
QEMU uses 2 ways to emulate network connectionsTUN/TAP - creating a virtual network which connects to host
SLiRP - emulates a simple user level network.
I will concentrate on the SLiRP way at the moment to make network connection.
Make sure you're compiled QEMU with SLiRP support (like this HOW-TO asked in the beginning) and that you launched QEMU with -user-net parameter.
You should be able now to surf the Internet, talk with IRC, get/send emails, use MSN Messenger and other network related stuff. You should remember however, that with SLiRP default settings, you cannot connect to your host machine, and you cannot ping anywhere else (since ping requires using port which only allowed by root).
Future versions of QEMU (when I'm saying "future" I'm talking about version 0.6.x and upward) will have a better TUN/TAP driver (and a whole lot easier configuration), so you will not need any special requirements to make your guest OS talk to your host OS (and also easier to disable ).
phase 7 - Block I/O Devices
With recent version of QEMU, it is possible to use physical devices (as long as they are not mounted on the host OS - like mount in Linux & BSD, and as long as you have read/write previlages on the device) so you can eject and insert media for your needs.
Here's an example:
Launch Windows with the command: qemu -hda hd.img -m 64
Windows should be loaded and the CDROM drive would be empty.
Put a physical CD in your drive and make sure that the drive is not mounted (do: umount /mnt/cdrom on Linux if needed)
in your QEMU terminal, type: change cdrom /dev/cdrom
You should see now that Windows will find a CD inside and will try to launch it (if there's autorun.inf in the CD)
If you want to eject the cdrom, then go back to the QEMU terminal and type: change cdrom
Windows will "remove" the CDROM. You can eject physically your CDROM now.
You can always use floppies with /dev/fd0 and other IDE physical devices with their corresponding device name (e.g. /dev/cdrom1). You can check the status of your devices with the command: info block.
Last edited by spacezmonkey on Wed Jun 16, 2004 1:01 am; edited 2 times in total |
|
Back to top |
|
|
spacezmonkey n00b
Joined: 26 May 2004 Posts: 52 Location: Singapore
|
Posted: Wed Jun 16, 2004 12:57 am Post subject: |
|
|
hrm....wonder y the image links are not loaded... |
|
Back to top |
|
|
malv n00b
Joined: 07 Jul 2004 Posts: 69
|
Posted: Fri Jul 30, 2004 12:19 pm Post subject: QEMU vs Win4Lin? |
|
|
Hi spcezmonkey,
Thank you for your this qemu how to.
Would it be fair to say that QEMU allows you to do the same as win4lin (W89 & WinME stuff)?
In your referenced URL by Hetz Ben Hamo I read:
"You can also skip the entire ISO section in this manual (by replacing the ISO image with the real device, just make sure it's not mounted) and use real CD (if it's bootable), by replacing the "win98.iso" with /dev/cdrom (example: qemu -hda hd.img -fda boot98sc.img -cdrom /dev/cdrom -boot a -m 64), and the same thing with a physical floppy (replace the -fda boot98sc.img with -fda /dev/fd0)
These instructions are only working on Linux as a host. I'm not sure about running QEMU under Windows as a host."
So preparing your ISO image on hd should no longer be necessary. Did this work for you? This would make it almost as easy as win4lin. On top you don't have to mess with the kernel patching hokus pokus.
Did you look into the availability of a parallel port line printer for Win98 under QEMU?
Thank you for any comments. |
|
Back to top |
|
|
Dr. Heywood Floyd n00b
Joined: 19 Jan 2004 Posts: 16 Location: Davis, CA
|
Posted: Mon Aug 09, 2004 10:19 pm Post subject: Win 2000 OK! |
|
|
I followed the same steps and W2K worked fine. Actually. it runs a bit faster Thanks for such a great program and how-to.
This program should really be featured on gentoo.org -- it has a lot of promise.
Heywood _________________ "What the hell is that?"
-- Last words of a programmer
and
-- Last words of a nuclear bomb testing dummy |
|
Back to top |
|
|
1der Tux's lil' helper
Joined: 06 Aug 2003 Posts: 99
|
Posted: Sat Aug 14, 2004 9:58 am Post subject: |
|
|
works just as well using windows xp.
speed is good - slower then native but is workable.
my instructions are as follows:
1.create a disk image (hd.img) with dd (~3 gig),
2.put your windows xp cd in /dev/cdrom
3.then type the following
Code: |
qemu -localtime -user-net -cdrom /dev/cdrom -hda hd.img -boot d |
4.and begin the installation
once done with the installation create a backup of the hd.img, so if anything goes wrong you can always restart with a fresh img.
GOOD LUCK!
Qemu is only at .6 and its in par with vmware 3.0. To think what would happen when it gets to version 1.
anyway, I think a howto is in order for tips and tricks in the forum.
Last edited by 1der on Sun Aug 15, 2004 2:14 pm; edited 1 time in total |
|
Back to top |
|
|
thedumbkid n00b
Joined: 13 Dec 2003 Posts: 72
|
Posted: Sun Aug 15, 2004 7:27 am Post subject: |
|
|
thanks for the tutorial
I couldn't compile qemu from src but I grabbed the binary and was able to follow through after that
nice project to keep an eye on, but at this stage it's still too slow for me to be any productive |
|
Back to top |
|
|
malv n00b
Joined: 07 Jul 2004 Posts: 69
|
Posted: Sun Aug 15, 2004 10:19 am Post subject: |
|
|
Hi All,
I saw that gentoo has qemu version 0.5.2 as OK and versions up till 0.6.0 as ~x86. If I am correct, the above posts refer to 0.5.6 or higher which were not available from gentoo at that time (?).
Did anybody manage to get qemu going from gentoo sources? |
|
Back to top |
|
|
stahlsau Guru
Joined: 09 Jan 2004 Posts: 584 Location: WildWestwoods
|
Posted: Sun Aug 15, 2004 12:02 pm Post subject: |
|
|
nice tut, thanx!
The "Phase 5 - Graphics" isn´t needed anymore since you can select up to 1024x786@24 in the settings menu in Windows. Really nice!
Speed too is ok now, nothing for games i think but for working (f.e. MathCAD or s/t...) |
|
Back to top |
|
|
1der Tux's lil' helper
Joined: 06 Aug 2003 Posts: 99
|
Posted: Sun Aug 15, 2004 2:09 pm Post subject: |
|
|
malv:
if you want to emerge qemu, use the following:
Code: | USE="softmmu " ACCEPT_KEYWORDS="~x86" emerge -p qemu |
then just type
Code: | qemu -localtime -user-net -cdrom /dev/cdrom <your image> |
|
|
Back to top |
|
|
rhale314159 n00b
Joined: 14 Dec 2003 Posts: 41 Location: East US
|
Posted: Sat Sep 04, 2004 7:29 pm Post subject: running windows on qemu on ppc ibook G4 |
|
|
I just tried emerging qemu 0.6 onto an ibook G4 and following the advice given above. It seems to work quite well. Windows 98 took about an hour to install. Now I am able to run the few windows packages I need (e.g. mathcad) on a ibook running linux.
The speed of windows is reasonably OK, mouse clicks and movements are quite responsive. Explorer works well. |
|
Back to top |
|
|
Titeuf l33t
Joined: 19 Jun 2004 Posts: 759 Location: Middelkerke, Belgium
|
Posted: Sat Sep 04, 2004 8:31 pm Post subject: |
|
|
Is QEmu something like VMWare ? |
|
Back to top |
|
|
1der Tux's lil' helper
Joined: 06 Aug 2003 Posts: 99
|
Posted: Sat Sep 04, 2004 10:03 pm Post subject: |
|
|
yes.... but free.
and just as fast (at least with win98! ) |
|
Back to top |
|
|
rb338 n00b
Joined: 03 Oct 2002 Posts: 40 Location: Eindhoven, The Netherlands
|
Posted: Sat Sep 04, 2004 11:34 pm Post subject: |
|
|
How does QEmu work compared to Win4Lin?
Since W4L works really great here, I'm not sure if I should bother spending time trying this thingie. But I'm very interested - especially because it also supports W2K/XP |
|
Back to top |
|
|
1der Tux's lil' helper
Joined: 06 Aug 2003 Posts: 99
|
Posted: Mon Sep 06, 2004 8:08 pm Post subject: |
|
|
don't know....
never tried win4lin.
the only thing that I could tell you is:
1. no kernel patches.
2. can run windows (all version), linux, and other os (host or guest).
3. fairly small and not complicated to run.
I don't know what the speed advantages are for win4lin (since I never tried it).
give it a go.
try it, maximum... you'll uninstall it. |
|
Back to top |
|
|
davecs Guru
Joined: 08 Nov 2003 Posts: 436 Location: Dagenham, GB
|
Posted: Wed Nov 24, 2004 11:52 pm Post subject: |
|
|
I tried the Win98SE install in QEMU 0.6.1. I got a BSOD in a Window at an early reboot and the system did not complete loading, neither could I get the setup process to continue.
As I am using a 2.6 kernel, I tried the line
Code: | echo 1024 > /proc/sys/dev/rtc/max-user-freq
|
but all I got was an error message:
Code: | bash: /proc/sys/dev/rtc/max-user-freq: No such file or directory |
I'm trying a second install to see if I have better luck. Shame really, everything seemed to be going OK.
I do have experience in setting up Win98SE including in a VMware environment, so I am at a bit of a loss here... _________________ Gentoo, PCLOS-pre-81a and Windows 98SE.
Shuttle SN41G2V2
Athlon XP2500+ o/c to 3200+, 2x256Mb Geil Value RAM, FX5200.
Ntlworld cable internet via ethernet
and PC-Chips Desknote Laptop (with PCLOS-pre-81a ) |
|
Back to top |
|
|
BlackB1rd Tux's lil' helper
Joined: 13 Aug 2003 Posts: 131 Location: /Europe/Netherlands/Haarlem
|
Posted: Sun Nov 28, 2004 12:27 pm Post subject: |
|
|
Trying to install Windows 2000 Professional (dutch) and it's just sitting around at the hardware detection (keyboard, mouse etc.) doing nothing. Though, it responds when I move the mouse so it's not freezed up. Someone knows this issue? |
|
Back to top |
|
|
excyl n00b
Joined: 13 Dec 2004 Posts: 2 Location: Westborough, Massachusetts
|
Posted: Mon Dec 13, 2004 2:55 am Post subject: |
|
|
davecs wrote: | I tried the Win98SE install in QEMU 0.6.1. I got a BSOD in a Window at an early reboot and the system did not complete loading, neither could I get the setup process to continue.
As I am using a 2.6 kernel, I tried the line
Code: | echo 1024 > /proc/sys/dev/rtc/max-user-freq
|
but all I got was an error message:
Code: | bash: /proc/sys/dev/rtc/max-user-freq: No such file or directory |
|
You need to make sure your kernel is compiled with RTC (Real Time Clock) support.
Code: |
Device Drivers --->
Character devices --->
<*> Enhanced Real Time Clock Support
|
Then you should be able to set the max user frequency. _________________ That's what I said. |
|
Back to top |
|
|
iplayfast l33t
Joined: 08 Jul 2002 Posts: 642 Location: Cambridge On,CA
|
Posted: Mon Dec 13, 2004 5:40 am Post subject: |
|
|
Is it possible to use qemu on a dual boot system. I don't want to reinstall windows, I just want to use it like a wine alternative. That is have a xwindow running windows. (Wine doesn't cut it since the apps I want are things like debuggers and low level system stuff that never works under wine). |
|
Back to top |
|
|
davecs Guru
Joined: 08 Nov 2003 Posts: 436 Location: Dagenham, GB
|
Posted: Mon Dec 13, 2004 5:23 pm Post subject: |
|
|
Added rtc to kernel, rebooted, did the "echo 1024" line, ran qemu, still crashes Windows 98SE when I try to get screen out of 16 colour 640x480 mode. Any ideas anyone? _________________ Gentoo, PCLOS-pre-81a and Windows 98SE.
Shuttle SN41G2V2
Athlon XP2500+ o/c to 3200+, 2x256Mb Geil Value RAM, FX5200.
Ntlworld cable internet via ethernet
and PC-Chips Desknote Laptop (with PCLOS-pre-81a ) |
|
Back to top |
|
|
agnitio Tux's lil' helper
Joined: 17 Apr 2004 Posts: 136
|
Posted: Tue Dec 14, 2004 1:35 am Post subject: |
|
|
I'm trying to set up a windows install through qemu but, I'm wondering if it's possible to create the image on a fat32 partition mounted as vfat.
dd outputs this error message:
Code: |
# dd of=hd.img bs=1k seek=3G count=0
dd: advancing past 3298534883328 bytes in output file `hd.img': Operation not permitted
|
Is it possible at all to achieve what I want, maybe using another tool than dd? |
|
Back to top |
|
|
EzInKy Veteran
Joined: 11 Oct 2002 Posts: 1742 Location: Kentucky
|
Posted: Tue Dec 14, 2004 4:03 am Post subject: |
|
|
iplayfast wrote: | Is it possible to use qemu on a dual boot system. I don't want to reinstall windows, I just want to use it like a wine alternative. That is have a xwindow running windows. (Wine doesn't cut it since the apps I want are things like debuggers and low level system stuff that never works under wine). |
I've been using qemu -enable-audia -hda /dev/hda then picking Win98 from my OS list, but of course this caused driver problems B-) _________________ Time is what keeps everything from happening all at once. |
|
Back to top |
|
|
kellwood Tux's lil' helper
Joined: 22 Dec 2002 Posts: 123 Location: Ann Arbor
|
Posted: Sun Mar 27, 2005 1:38 pm Post subject: |
|
|
Hi All
I followed the instructions and got everything working, though with the newer qemu (0.6.1). The one trouble I am having is switching video modes with the new cirrus logic drivers. Did anyone get this to work with win98?
Thanks
Kevin |
|
Back to top |
|
|
kellwood Tux's lil' helper
Joined: 22 Dec 2002 Posts: 123 Location: Ann Arbor
|
Posted: Sun Mar 27, 2005 8:40 pm Post subject: |
|
|
Just an update. The cvs version of qemu works -- ie changes graphics modes in win98. |
|
Back to top |
|
|
Koala Kid Guru
Joined: 09 May 2003 Posts: 382
|
Posted: Sun Mar 27, 2005 8:45 pm Post subject: |
|
|
I got Windows XP running under qemu-cvs without any problem. _________________ "People are the worst, the worst thing about music is that people play it". M. Patton. |
|
Back to top |
|
|
Meaulnes n00b
Joined: 15 Mar 2004 Posts: 49
|
Posted: Mon Apr 25, 2005 5:05 pm Post subject: |
|
|
Not sure if I am missing something here ... i emerged qemu (0.61-r1) and I am not getting an binary called qemu. However I am getting qemu-<arch> where <arch> is a bunch of different architectures. I have tried running qemu-i386, but I keep getting a help message:
Code: |
% qemu-i386 -m 256 -localtime -user-net -fda winb98.IMA -hda hd.img -boot d
qemu-i386 version 0.6.2, Copyright (c) 2003-2004 Fabrice Bellard
usage: qemu-i386 [-h] [-d opts] [-L path] [-s size] program [arguments...]
Linux CPU emulator (compiled for i386 emulation)
-h print this help
-L path set the elf interpreter prefix (default=/usr/gnemul/qemu-i386)
-s size set the stack size in bytes (default=524288)
debug options:
-no-code-copy disable code copy acceleration
-d options activate log (logfile=/tmp/qemu.log)
-p pagesize set the host page size to 'pagesize'
|
Any thoughts on why? The command I am issuing is a combination of different stuff I have seen on the forumsm and what I have been able to get from the man pages. I would ideally like to run WinXP in qemu, but am testing with Win98.
Any help would be appreciated. |
|
Back to top |
|
|
|