Running Microsoft Windows inside Debian: qemu

Posted by Steve on Sun 7 Nov 2004 at 22:51

Tags: ,

There are many legitimate reasons for a Debian GNU/Linux user to wish to run Microsoft Windows applications. One approach involves using the wine program to run a single Windows executable in a fake Windows environment. An alternative is to run an entire Windows operating system within a Debian host. Qemu is a procesor emulator and virtualization program which allows you to do just that.

Qemu is available for Debian's unstable distribution, and can be installed from the source code available on its homepage for Woody. It is comparible to the commercial software VMWare albeit with a few features missing and a lower performance.

On the plus side it is evolving fast, and doesnt require complicated setup or kernel patching. It is also free - although if you wish to run an installation of Windows you will need a valid license to do so.

Qemu is a complete CPU and peripheral emulator which can be used to run entire operating systems as a user process, supported operating systems include Linux distributions such as Debian, RedHat, SuSE, varieties of Microsoft Windows such as Windows 98, Windows 2000, and Windows XP and BSD based operating systems. There are some disk images available from the Free OS Zoo website.

Whilst it's not as fast as running an operating system directly on the same hardware because of the overhead of virtualising running as a guest operating system is suprisingly responsive on my AMD XP 2800+ machine, once the slow installation is achieved.

This brief guide will walk you through installing Windows 2000 as a guest operating system on your Debian box.

First of all you need to install qemu, by running as root:

apt-get install qemu

Once this is done we're ready to start the installation process.

As qemu is a virtualization program it doesnt touch your real discs, instead you give it a big file and tell the system to use that for it's C:.

As a simple start we'll set aside a blank 2Gb file for Windows to install into, we can create that easily enough:

skx@undecided:~$ dd of=hd.img bs=1024 seek=2000000 count=0
0+0 records in
0+0 records out
0 bytes transferred in 0.000493 seconds (0 bytes/sec)

That's given us a file called hd.img which is 2000000 bytes long, close enough to 2Gb for us to proceed.

The next thing we need to do is have a Windows 2000 CD-ROM handy, we have two choices here either place it in your CD-ROM drive, or use an ISO image.

We'll go with the former.

We want to tell the system that it's first hard drive should be the big empty file we have just created, that the CD-ROM drive should be read from the drive we have - and that it should boot from CD-ROM.

skx@undecided:~$ qemu -boot d -cdrom /dev/cdrom  -hda hd.img
QEMU 0.6.0 monitor - type 'help' for more information

The '-boot d' flag tells the system to boot from the CD-ROM drive we've specified, the '-hda hd.img' tells the system that the first hard drive should be the contents of the file hd.img which we created previously.

This should bring up a window upon your desktop within which you'll see Windows boot. You can click in the window to give it focus, and when you wish to return the mouse to your desktop press "Ctrl + Shift". Pressing Ctrl + Shift + f will toggle you between fullscreen and windowed mode.

Now you can sit back and install Windows as you normally would. Some parts will be very slow, other parts such as formatting the drive will be lightening fast!

Whilst using the guest operating system is acceptably responsive for me the actual installation took a couple of hours. Most of this is waiting for the thing to finish, but it's something to be aware of.

I found that when I installed Windows 2000 it seemed to go faster if I ran it fullscreen and shut down as many open programs as I could.

When it came to networking I found that Debian doesn't allow non-root users to write to the tun driver by default, as root run:

chgrp users /dev/net/tun 
chmod g+w /dev/net/tun 

(If you don't have that device file you will need to run these commands, this assumes you're running Kernel 2.6.x)

mkdir -p /dev/net
mknod /dev/net/tun c 10 200

Finally we add in the module to enable the device :

modprobe tun
echo 'tun' >> /etc/modules

Now that you're installed the operating system you can create a backup of the image by simply copying the 'hd.img' file which is being used as the disk drive:

skx@undecided:~$ cp hd.img pristine.img

Any time you wish to restore back simply overwrite the hd.img with the pristine one - you'll never have to reinstall again!

Now that we've done the installation we can start the system for real with:

skx@undecided:~$ qemu -hda hd.img -boot c

From bootup to login prompt takes me 39 seconds, which is pretty impressive.

Networking should be setup properly for you in the sense that on the host machine you will have the interface tun0 setup.

Once that's done you need to setup some way for the emulated machine to talk to the world, or it's host at least.

I chose to give the host machine an IP address on it's own network. We do this by first setting up an address on the host, then on the guest.

I use 10.0.0.1 for the host, and 10.0.0.2 for the Windows system.

On the host run:

root@undecided:~# ifconfig tun0 10.0.0.1 up

Then on the host adjust the networking so that the Windows operating system has the ip address 10.0.0.2, with the gateway set to point to 10.0.0.1.

This should allow you to ping both the guest from the host, and vice versa.

If you wish the host to be able to talk to the internet generally run the following on the host:

root@undecided:~# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
root@undecided:~# echo "1" >/proc/sys/net/ipv4/ip_forward

 

 


Posted by Adem (127.0.xx.xx) on Thu 18 Nov 2004 at 12:35
[ Send Message ]

This is a very helpful article for me. I had always been shy of even touching this sort of thing; now that I have seen it here, I am a little more brave.

I have somewhat a different problem --i.e. the solution I need does not involve running an up-to-data OS, but plain old DOS, MS DOS 6.22.

We have a machine that runs on DOS ever since 386/486 days. Damn thing never died so I cant just replace it :) What it does is to serve G-Code data (i.e. CAM files) to a controller over a serial port. Serial port bit is easy to solve, but the it uses its own sofware communication protocol, which means I am stuck with it. And, as the vendor is long dead and gone, I ended up the one keeping the memories alive ;)

Since it is DOS, it is limited to local files only --I did try all sorts of networking possibilities but the software running on it uses every last bit of memory --i.e. NIC drivers etc will simply not fit.

So, after that long prelude, what I am looking for is a solution that lets me run DOS under, say, qemu *and* have access to a local linux partition (FAT16) so that we can handle the file transfers in Linux and DOS thing thinks it is using just another disk.

Does anyone, by any chance, know how to do this --or have pointers to how it can be done.

Thank you, again.

Cheers,

Adem

[ Parent | Reply to this comment ]

Posted by Anonymous (207.237.xx.xx) on Thu 30 Dec 2004 at 12:08
Adam: I think you might be better off looking at DOSemu (http://www.dosemu.org) or DOSbox (http://dosbox.sourceforge.net). These store their files directly on the Linux filesystem, while Qemu uses disk images (you might be able to convince it to use a disk drectly, but that would be too complex & dangerous for your purposes). You would find the same problem with VMware, as that needs special drivers in the guest OS to see the host FS.

[ Parent | Reply to this comment ]

Posted by Anonymous (146.151.xx.xx) on Fri 25 Feb 2005 at 06:43
Another option would be to use freedos (www.freedos.org) inside qemu. You wouldn't even need to install it, since the qemu download page (http://fabrice.bellard.free.fr/qemu/download.html) has a freedos.img.bz2 All you would need to do is download that and you are all set

[ Parent | Reply to this comment ]

Posted by Anonymous (12.152.xx.xx) on Thu 5 May 2005 at 01:33
If only I could figure out where the "?" is located... French keyboard layout.

[ Parent | Reply to this comment ]

Posted by Anonymous (83.129.xx.xx) on Tue 31 May 2005 at 21:55
Try "shift" + "-". Works fine under my german keyboard.

[ Parent | Reply to this comment ]

Posted by Anonymous (127.0.xx.xx) on Mon 27 Dec 2004 at 17:57
If you have a blank screen once you try and launch qemu and your cdrom blinks a few times at the beginning try the following. add -std-vga to the end of the qemu line. http://www.dad-answers.com/qemu-forum/viewtopic.php?t=184

[ Parent | Reply to this comment ]

Posted by Anonymous (61.229.xx.xx) on Sat 12 Mar 2005 at 19:17
One more step is needed to make the 'tun' interface work for those who compiled their own kernel:

before you can do a 'ifconfig tun0 ...' you gotta

1) apt-get install uml-utilities ( this contains 'tunctl' command which we're gonna need )
2) tunctl -u 'user' -t tun0 ( to create the 'tun0' interface owned by 'user' )
3) only then 'ifconfig tun0 10.0.0.1 up' will work, otherwise you'll get

utumno:/# ifconfig tun0 10.0.0.1 up
SIOCSIFADDR: No such device
tun0: ERROR while getting interface flags: No such device
tun0: ERROR while getting interface flags: No such device

See
http://www.linode.com/forums/archive/o_t/t_764/dummy_ip_interface .html

for a longer description of this problem.



BTW, this comment-submission scripts are a bit buggy, man. I cannot type a '>' , I gotta type '& g t' without the spaces. Also, there is a problem with pasting larger blocks of text...

[ Parent | Reply to this comment ]

Posted by Anonymous (62.178.xx.xx) on Tue 26 Apr 2005 at 11:15
Using Debian sid (qemu 0.6.1+20050407-1) starting qemu automatically configured networking via sudo.

[ Parent | Reply to this comment ]

Posted by Anonymous (84.220.xx.xx) on Fri 15 Jul 2005 at 17:18
Hi,
I have some problem to share internet connection to guest os.
The guestOs isn't windows, but I hope you can help me howeaver
I followed this instructions and both guest and host OS ping each other, but the guest os don't ping anythings else.
I added route to the guest os configuration with no result As guestos i tried both debian and openbsd.

Anyone can help me?
Thanks

ps. sorry for my bad english

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 15 Jul 2005 at 20:17
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Perhaps add -user-net when running qemu and seeing how that works?

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by Anonymous (84.220.xx.xx) on Sat 16 Jul 2005 at 20:58
Its useless, because with tun0 interfaces I have a network configured properly.
I need only internet netwirking and I really don't know why it don't works...
I used also a live cd as guestOS with no result, than the problem is qemu or the host system.
Any ideas?

Thanks

[ Parent | Reply to this comment ]

Posted by jwarnier (83.182.xx.xx) on Fri 20 Jan 2006 at 17:39
[ Send Message ]
This option changed to "-net user" in the latest versions.

[ Parent | Reply to this comment ]

Posted by Anonymous (89.49.xx.xx) on Sat 5 Apr 2008 at 21:39
Just use DHCP in Windows
and user-mode net in qemu:
-net nic,vlan=0,macaddr=00:ff:22:cf:da:eb -net user,vlan=0 (or other macaddr)

Look at: http://www.cnpbagwell.com/QEMU/HomePage (section User Mode Networking)

[ Parent | Reply to this comment ]

Posted by Anonymous (82.231.xx.xx) on Sat 26 Mar 2005 at 18:32
Using dd is not a good idea except if you have some place to lose on your harddrive. dd will allocate the 2GB. If instead you use
qemu-img hd.img 2G
your file will start empty (check it with du) and grow when you write in it, up to 2GB.

[ Parent | Reply to this comment ]

Posted by Anonymous (60.234.xx.xx) on Thu 31 Mar 2005 at 12:41
This is incorrect. When using 'dd' with the seek option, the resulting file is sparse, and has no space allocated to it. Space is only used up when actual data is written there.

[ Parent | Reply to this comment ]

Posted by Anonymous (121.72.xx.xx) on Sat 25 Nov 2006 at 05:16
Hey that's rocks :)

[ Parent | Reply to this comment ]

Posted by Anonymous (81.56.xx.xx) on Wed 30 Mar 2005 at 09:14
Hi,
I've got a problem when I try to restart qemu, I've got a message like "NTLR ..." and the boot freeze.
Any idea ?

Thanks
Max.

P.S Excuse my English, I'm french ;).

[ Parent | Reply to this comment ]

Posted by Anonymous (216.145.xx.xx) on Fri 1 Apr 2005 at 16:35
I had the same problem, evidently there is some problem with qemu 0.6.1 and NT based OSes. The current CVS version fixes everything. You may just want to wait for 0.6.2 or you can try compiling the CS version.

The CVS version works perfectly for me

[ Parent | Reply to this comment ]

Posted by Anonymous (82.223.xx.xx) on Mon 23 May 2005 at 13:49
Hi. I have tried to install Windows XP on my ubuntu and I wasn't able to do it.
All seems to work fine during instalation but when windows is booting an error message appears: "disk reading error. Press ctrl+alt+supr to reboot"
I'd like to know which could be the problem. Perhaps qemu doens't like winxp or perhaps something is wrong on my system.
Anyone can help me?

[ Parent | Reply to this comment ]

Posted by Anonymous (213.208.xx.xx) on Tue 14 Jun 2005 at 14:39
I had the same problem in Kubuntu.
(K)Ubuntu uses QEMU 0.6.1 which had this problem. Deinstall qemu with synaptic, download qemu 0.7.0 from www.qemu.org, install it and run the installation of Win XP again. Or, you can use the image you already created.

Good luck!

[ Parent | Reply to this comment ]

Posted by Anonymous (82.223.xx.xx) on Sat 18 Jun 2005 at 11:55
Thank you for your help. I've uninstalled qemu 0.6.1 and install 0.7.0 but I have another problem. Now, when a start qemu (to install winxp or run any live-cd or whatever) nothing appears. And nothing is nothing. It seems qemu reads the image but nothing happens.
Any idea?
Sergio.

[ Parent | Reply to this comment ]

Posted by Anonymous (192.138.xx.xx) on Tue 21 Jun 2005 at 09:11
Maybe you didn't compile QEMU with SDL support? or is libsdl not correctly installed? For gentoo users: USE=sdl emerge -av qemu

[ Parent | Reply to this comment ]

Posted by Anonymous (64.142.xx.xx) on Sat 25 Jun 2005 at 01:07
Does anyone know how to turn a set of files into a disk image? I have an already working windows partition that I dual boot from, and I would like to just turn it into a disk image and boot it with QEMU. Alternitivly, can I just mount it and use the mount point as disk image (like qemu -d /dev/hda1)?

Anyone think this will work?
--IK

[ Parent | Reply to this comment ]

Posted by jrasmussen0 (67.52.xx.xx) on Thu 30 Jun 2005 at 21:02
[ Send Message ]
It should work:

http://fabrice.bellard.free.fr/qemu/faq.html

Can I use a real disk, floppy or CDROM in QEMU ? Yes, at least with Linux. For the floppy, use /dev/fd0 as image filename. For the cdrom, use /dev/cdrom. For a real hard disk, first ensure that you have read-only permission to the device (it is very dangerous to leave write access to the device because in case of problems you can trash your hard disk). Then use /dev/hda to use the hard disk 0. As QEMU will have read-only access to the device, all the changes will be discarded at the end of the QEMU session. For more safety if you do not know the access rights of the hard disk device, always use the -snapshot option: qemu -snapshot /dev/hda

[ Parent | Reply to this comment ]

Posted by mebs (213.81.xx.xx) on Sun 26 Jun 2005 at 13:14
[ Send Message ]
I have problem with installing winXP under mandrake 10.1. After copying files sysetem reboots and reports error in installing of product catalogues. There are problems in installation protocol with time in bios wich is 'out of synchronization' (I don't know what it means).
Does anyone know how to solve these problems because installation then interrupt qemu reboots.
Thanks

Marek

[ Parent | Reply to this comment ]

Posted by Anonymous (80.217.xx.xx) on Sat 30 Jul 2005 at 16:02
I had problem with me qemu.. I didnt know ho to install windows on qemu; but now I know...
Thank you very much!!

[ Parent | Reply to this comment ]

Posted by steevie_t (82.43.xx.xx) on Wed 3 Aug 2005 at 23:28
[ Send Message ]
It seems this site is no longer working. :-(

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Wed 3 Aug 2005 at 23:33
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Looks like there are still some copies of it around. I'm not sure which is more official/reliable:

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by Anonymous (206.61.xx.xx) on Sat 13 Aug 2005 at 21:47
All I have is an XP upgrade disk and 2000. To get XP installed in QEMU I had to install XP on a seperate hard drive and create a disk image. Then create a QEMU hard drive roughly the same size as the physical hard drive I used to make the XP disk image. Format the QEMU hard drive with NTFS, install the XP disk image, and then reinstall XP with the upgrade disk. Maybe there's an easier way, but this worked for me.

[ Parent | Reply to this comment ]

Posted by Anonymous (206.61.xx.xx) on Sun 14 Aug 2005 at 16:59
I should have been clearer; my Win2000 is also an upgrade disk. I couldn't get QEMU to unmount and mount cdrom while Windows was installing or get a second cdrom to mount. My hard drive is also too small to convert a VMware disk image.

[ Parent | Reply to this comment ]

Posted by Anonymous (63.118.xx.xx) on Wed 31 Jan 2007 at 17:22
Hello,
Am having the same issue.
Trying to install into the WINDOZE XP VM and am finding that the install spans two cdroms. After rebooting with the first cdrom in the tray, I eject it to put in the next one and find that it is not recognizing it.
Anyone see this?
Thanks
Rick

[ Parent | Reply to this comment ]

Posted by ramnet (63.20.xx.xx) on Mon 7 Jul 2008 at 20:06
[ Send Message ]
A workaround to this would be to do what ms used to call a "manual install." copy all the stuff on the install cd to the hard disk and run setup from there, and have the upgrade disk you need in the cd drive - no disk swapping needed.

A much simpler alternative would be to simply install the old version off a full version disk and then do the upgrade from within windows - takes longer but works great for me (it also allows you to get around windows upgrade requirements - I use win95 to install winme, then use winme to install winxp).

[ Parent | Reply to this comment ]

Posted by Anonymous (83.151.xx.xx) on Sun 14 Aug 2005 at 15:42
SLightly off-topic but maybe of interest, I read this article and found it and comments very helpful. I was trying to get a Debian image running in qemu without need for a X server on the host system. This allows for running a qemu instance remotely. I have put my findings together here:

Running Debian inside qemu using console

[ Parent | Reply to this comment ]

Posted by sspike124 (69.68.xx.xx) on Fri 19 Aug 2005 at 00:42
[ Send Message ]
I have installed win98se on Qemu, but I cannot get it on the internet. I have done everything it says here and still no luck. Can someone please help me with this situation?

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 19 Aug 2005 at 15:01
[ Send Message | View Steve's Scratchpad | View Weblogs ]

What did you do, exactly?

If you ran with "--user-net" that should be sufficient. If you tried to use bridging make sure you have the bridge-utils package installed.

Did you add any routing to your gateway? Or on the host machine to allow it to route?

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by Anonymous (24.106.xx.xx) on Fri 19 Aug 2005 at 15:37
hi steve, this is sspike124, i don't have my password handy so i had to be anonymous. i am sorta new to linux, so i am sure i have something wrong. i did not do the --user-net, i don't know what that did or how it did it so i did'nt try that. as far as routing it oh the host machine, i'm sure i had that all screwed up to, i tried a bunch of different things but none of them worked. i need to be better instructed of what to do and where to put it. i am not real great with this yet so it is kinda hard for me to know where some of these things go. if you could help that'd be real cool, cause there is some stuff i can't figure out.

thanks shane sspike124@earthlink.net

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Fri 19 Aug 2005 at 15:44
[ Send Message | View Steve's Scratchpad | View Weblogs ]

I'm happy to clarify things that aren't obvious from articles. I can also offer more specific assistance in other cases.

But I'm afraid I don't have the time to go through things from start to finish with every person who has problems, which probably isn't the best thing to hear if you're new at all this :S

First of all I'd suggest you run Qemu with the "--user-net" flag and see if that helps. If you followed the instructions in the comments/article you should have the "tun" module loaded, and that might be enough for you.

The manpage which you can read with "man qemu" explains what this flag does, and shows other options. If you use the user-networking you should just setup the Windows installation to have IP address 172.20.0.2, and set its gateway to 172.20.0.1. That will most likely be enough - if you don't have any complicated routing going on.

Secondly if that doesn't help I'd suggest reading the documentation on the Qemu website - there are several good pieces of documentation available there.

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by Anonymous (24.106.xx.xx) on Fri 19 Aug 2005 at 15:57
thanks for the reply steve, i'll try that stuff and report back to let you know if that worked. its hard to find good docs to help with these matters, but you and all the others on here with these instructions have helped tremendously. thank you all very much for the instructions that you can provide. without all you people who take the time to put various things in here, i'd still have to use windows all the time. shane sspike124@earthlink.net

[ Parent | Reply to this comment ]

Posted by ravi (202.95.xx.xx) on Tue 23 Aug 2005 at 05:37
[ Send Message ]
great article.

[ Parent | Reply to this comment ]

Posted by cdubks88 (67.65.xx.xx) on Wed 24 Aug 2005 at 18:52
[ Send Message ]
I'm having some issues with installing windows 2000 pro under qemu on kanotix.

used apt to grab qemu and install.....all was good.

Ran your commands verbatim and all was good.

Then I get to the Win2K setup piece and it tells me i don't have enough space to install Windows (says there's 0 space at all left).

Any ideas?

I used the 2GB image that you suggested to create....

Thanks,

C.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Wed 24 Aug 2005 at 18:55
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Qemu bug.

The most recent version of Qemu has a new command line option -win2k-hack. Usage is described in this Qemu documentation page.

Seems to be sporadic; I've never experienced it but some people do consistently.

Upgrade qemu and use the flag when installing and all should be well.

[ Parent | Reply to this comment ]

Posted by cdubks88 (67.65.xx.xx) on Wed 24 Aug 2005 at 19:03
[ Send Message ]
I guess I'm a little confused.....how can I know that I'm getting the latest version via apt.....?

Thanks,

C.

[ Parent | Reply to this comment ]

Posted by cdubks88 (67.65.xx.xx) on Wed 24 Aug 2005 at 19:20
[ Send Message ]
Here's what I get when I try it with the version from the QEMU site....

Connected to host network interface: tun0
Could not open '/dev/kqemu' - QEMU acceleration layer not activated
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Could not initialize SDL - exiting

Not sure what's up now.

Any ideas?

C.

[ Parent | Reply to this comment ]

Posted by cdubks88 (67.65.xx.xx) on Wed 24 Aug 2005 at 20:28
[ Send Message ]
For future reference:

I found a topic at http://lists.progeny.com/archive/cl-workers/200503/msg00043.html
that suggested doing a "xhost +" in a shell as a normal user.

Did that and qemu started normally and the Win2K installer is going so far.

C.

[ Parent | Reply to this comment ]

Posted by Anonymous (82.223.xx.xx) on Sat 27 Aug 2005 at 20:27
I executing as root fail, but executing as normal user works fine.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Wed 24 Aug 2005 at 19:21
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Run "qemu -help" and the version will be displayed at the top of the output.

Compare that with the version on the Qemu website, which is currently 0.7.1.

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by cdubks88 (67.65.xx.xx) on Wed 24 Aug 2005 at 19:31
[ Send Message ]
man, this is aggravating.

That command won't do anything.

Just gives me an "invalid option" error.

I followed the instructions verbatim.

Now I can't seem to get the newer version to back off and go back to the apt package I installed previously, if I could do so, to try to install XP instead....

C.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Wed 24 Aug 2005 at 19:37
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Sorry I should have said --help with two dashes.

D'oh.

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by cdubks88 (67.65.xx.xx) on Thu 25 Aug 2005 at 00:31
[ Send Message ]
so i got win2k finally installed, but it seems like every windows installer I run at that point fails.....in particular it seems as the installer check the msi version.

I suppose a different image install of XP should remedy that, but I still have lots of issues.....CDs being mounted when qemu is started, then ejected, and the next cd having to be mounted by restarting qemu.....etc....unless I'm missing something huge..

Any ideas?

C.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Thu 25 Aug 2005 at 13:16
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Sorry I've never seen problems like that.

I'd suggest a mail to one of the qemu mailing lists instead, it seems like you have it installed correctly but issues with it running after all.

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by kbahey (72.140.xx.xx) on Sun 10 Dec 2006 at 18:16
[ Send Message ]
I have the exact same problem.

Installed qemu on kubuntu 6.10 (edgy), and proceeded with Windows 2000 install. Everything seems to work, including access to the network and the internet.

When I try to install something it fails. Even the service packs, or MS IE 6.

Any solution to this?

[ Parent | Reply to this comment ]

Posted by kbahey (72.140.xx.xx) on Mon 11 Dec 2006 at 03:08
[ Send Message ]
This one is solved now.

To get IE 6 installed, I created a new image from the start, using the -win2k-hack option for qemu. When the installation is finished, this parameter is not needed.

When I tried to install an application, InstallShield complains and gives an error (0x80040706). Googling the error message shows that InstallShield needs to be upgraded for applications to install.

Check here http://consumer.installshield.com/kb.asp?id=Q110641 and http://consumer.installshield.com/kb.asp?id=Q108322

Service Pack 4 still refuses to install though. It goes through the verification, and copies the file then fails with a dialog box that does not say much.

[ Parent | Reply to this comment ]

Posted by Anonymous (75.153.xx.xx) on Sun 2 Dec 2007 at 00:49
Problem:

Installing Windows 2000 Service Pack 4 in QEMU gives error.

Solution:

Install Service Pack 3 first. Do NOT reboot/restart. Install Service Pack 4 immediately.

(I installed the service packs from downloads not through Windows Update).

[ Parent | Reply to this comment ]

Posted by ajt (85.211.xx.xx) on Sun 2 Dec 2007 at 12:18
[ Send Message | View Weblogs ]
I've had lots of problems with Service packs under QEMU, but no problems with the same service packs under Virtual Box.

I gather one problem both suffer from is a bug in the Windows hard disk driver, that tends to show up under virtualisation were the virtual hard disk is MUCH faster than a real one would be, hence the -win2k-hack for Qemu and a similar option for VirtualBox.

--
"It's Not Magic, It's Work"
Adam

[ Parent | Reply to this comment ]

Posted by Anonymous (81.6.xx.xx) on Wed 20 Jun 2007 at 17:15
Regarding the installation failures I think there is a bug somewhere and something is becoming corrupted because I could keep installing things to correct things and then other problems would show up.

The good news is that this bug seems to be limited to qemu running without the benefit of the kqemu accelerator. Although you can't use the -kernel-kqemu option while installing, making sure the kqemu module is available and in-use (qemu needs to be compiled to support it) seems to avoid the corruption problems and I was able to get a stable Win2000 installation that way.

Once you're installed you can make a backup of the disk image and enable -kernel-kqemu for greater speed.

[ Parent | Reply to this comment ]

Posted by Anonymous (200.171.xx.xx) on Sun 4 Sep 2005 at 00:02
I've compiled and installed everything just as showed, but I can olnly run Qemu + Kqemu as root :(

Cannot initialize sdl

How can i give an user permission to sdl?( root runs it great )

[ Parent | Reply to this comment ]

Posted by ajt (84.12.xx.xx) on Sun 4 Sep 2005 at 16:46
[ Send Message | View Weblogs ]
We did quite a few QEMU installs at our LUG meeting today, a very useful tool if you have CPU cycles to spare.

Thanks for this guide, it proved MOST useful.

See our wiki page for some of the stuff that we got involved in: http://www.hants.lug.org.uk/cgi-bin/wiki.pl?LinuxHints/QemuEmulat ion

--
"It's Not Magic, It's Work"
Adam

[ Parent | Reply to this comment ]

Posted by helmetedwarrior (217.72.xx.xx) on Sat 8 Oct 2005 at 13:42
[ Send Message ]
I have a dual boot system. 30G WinXP on /dev/sda1 and the rest is dedicated to linux. I was wondering how I could use the WinXP that I already have without having to create a file and installing XP all over again like it says above?
Thanks

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Sat 8 Oct 2005 at 13:52
[ Send Message | View Steve's Scratchpad | View Weblogs ]

See the Qemu FAQ - it mentions using a real disk / partition.

"For a real hard disk, first ensure that you have read-only permission to the device (it is very dangerous to leave write access to the device because in case of problems you can trash your hard disk). Then use "-hda /dev/hda" to use the hard disk 0"

I'd expect using /dev/hda[1-9] rather than using the whole disk - but I guess the mailing list would help you ...

Steve
--

[ Parent | Reply to this comment ]

Posted by helmetedwarrior (217.72.xx.xx) on Sat 8 Oct 2005 at 15:53
[ Send Message ]
Thanks for the quick response. I still have a problem I hope you could help with. When I run the command qemu /dev/sda I get a window with my grub menu. When I choose XP the screen goes blank and the cpu works at 100% and nothing else happens.
When I run the command qemu /dev/sda1 I get a window which states

Plex86/Bochs VGABios current-cvs 11 Jul 2005
This VGA/VBE Bios is released under the GNU LGPL

Please visit :
. http://bochs.sourgeforge.net
. http://www.nongnu.org/vgabios

Bochs VBE Display Adapter enabled
Bochs Bios, 1 cpu, $Revison: 1.121 $ $Date:2004/10/15 15:34:44 $

ata0 master: QEMU HARDISK ATA-2 Hard-disk (30718 MBytes)
ata0 slave: Unknown device
ata1 master: QEMU CD-ROM ATAPI-¤ CD-rom/DVD-Rom
ata1 slave: Unknown device

Booting from Hard Disk...

Then nothing seems to happen except the the cpu goes up to 100%.
I was wondering if you might have an ides or be able to point me in the right direction. I tried to find the mailing list but the only one I found was qemu-devel.
Thanks

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Sat 8 Oct 2005 at 16:02
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Sorry I think this is where I give up - I've no experience with anything but disk images.

I'd be interested to know if you can boot to Linux from grub though? If so that suggests that the Windows stuff is broken, rather than the Qemu disk reading.

Steve
--

[ Parent | Reply to this comment ]

Posted by helmetedwarrior (217.72.xx.xx) on Sun 9 Oct 2005 at 12:08
[ Send Message ]
When I run /usr/bin/qemu-system-x86_64 I can boot from grub but I get a kernel panic before it has a chance to finish.
Thanks for your help

[ Parent | Reply to this comment ]

Posted by Anonymous (192.148.xx.xx) on Thu 27 Oct 2005 at 04:39
One option you could try (and I could be horribly wrong here) is to use dd to duplicate your existing XP install to an img file.

dd if=/dev/hda1 of=xp_clone.img

and then try to open it with qemu's -hda option

qemu -hda xp_clone.img

I could be horrible wrong, but I don't see why this won't work. (/me prepares for the flames)

[ Parent | Reply to this comment ]

Posted by Anonymous (81.189.xx.xx) on Sun 27 Nov 2005 at 11:32
I've tried this, but it doesn't work. If I understand correctly, the problem is that the image just contains one partition (hda1) but qemu expects a complete harddisk (hda not hda1).

[ Parent | Reply to this comment ]

Posted by Anonymous (138.250.xx.xx) on Mon 1 May 2006 at 11:39
To give qemu access to an existing winxp partition on a dual boot pc instead of duplicating it all in an image I did

$ fdisk -l

Disk /dev/hda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3442 27647833+ 7 HPFS/NTFS
/dev/hda2 3443 3455 104422+ 83 Linux
/dev/hda3 3456 3709 2040255 82 Linux swap
/dev/hda4 3710 7296 28812577+ f Win95 Ext'd (LBA)
/dev/hda5 3710 7296 28812546 83 Linux

and start qemu using

qemu -hdb /dev/hda1 /usr/local/qemu/winxp.img -localtime

Worked fine so far. Only problem is that the enviroment vars for some apps are wrong. For VC6 I found the startup executable for it and right clicked on it and created a short cut on desktop. It works ok. WORD still telling me it cannot find some DLL

There is no concurrency problems as the only other use of the partition is when the pc is booted into winxp. Same goes for licence. Same goes for licence - I cannot us vc6 twice
Tony R

[ Parent | Reply to this comment ]

Posted by Anonymous (70.141.xx.xx) on Tue 23 May 2006 at 23:32
A while back, I installed windows XP onto one partition, then I installed Fedora Core 4 onto another partition along with grub. So the MBR contains grub.

Now that I am trying out qemu, I create a disk image:

dd if=/dev/sda2 of=windows.img

Then I tried:

qemu windows.img -localtime -snapshot
qemu -hda /dev/sda2 -localtime -snapshot (real disk partition)
qemu /dev/sda2 -localtime -snapshot (real disk partition)
qemu -hdb /dev/sda1 windows.img -localtime (just trying different things)

Nothing worked. All displayed:

ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (45559 MBytes)
ata0 slave: Unknown device
ata1 master: QEMU CD-ROM ATAPI-4 CD-Rom/DVD-Rom
ata1 slave: Unknown device

Booting from Hard Disk....

and just hang there.

I figured that /dev/sda2 does not have the boot record, so I tried:

qemu /dev/sda -localtime -snapshot
qemu -hda /dev/sda -localtime -snapshot

Again nothing work. Right below "Booting from Hard Disk....", it displayed:

GRUB _

and hang. It did not display the graphical interface, and I can't type anything.

What is going on here? Why grub hang ?

Beside the boot loader / boot record, /dev/sda2 (or windows.img) is also missing the partition table. What else is it missing? How can I add the missing items to windows.img ?

Thank you.

[ Parent | Reply to this comment ]

Posted by Anonymous (65.95.xx.xx) on Fri 28 Oct 2005 at 21:27
Qemu is a great little program. I have followed the instructions here and have successfully set up Win 98SE inside of Mepis. I need to acces the LPT printer port because I have to use a program that uses a security dongle. Is this possible?

Thanks
Tom

[ Parent | Reply to this comment ]

Posted by Anonymous (67.164.xx.xx) on Sat 29 Oct 2005 at 05:59
This is the best article I have ever read about a linux program yet. Without this I would be totally lost on qemu. *bows* great author.
-Trash
-Projekt DotNet Designs

[ Parent | Reply to this comment ]

Posted by Arto (213.250.xx.xx) on Fri 4 Nov 2005 at 17:00
[ Send Message ]
As a follow-up, there was an article about QEMU on Linux.com a couple of days ago, where the author walks through QEMU installation from the source tarball on an Ubuntu system (close enough to Debian). This could be useful for anyone wishing to run the very latest bleeding-edge version of QEMU.

[ Parent | Reply to this comment ]

Posted by Anonymous (201.208.xx.xx) on Sun 15 Jan 2006 at 19:18
Thank you Steve. I am a one year linux user (actually Kubuntu 5.10) and I heard and read a lot about VMWare and recently about qemu. I found qemu but I didn't have a clue of how to use it until I read this article. Now I'm running WindowsME in my Kubuntu and everything works fine.

Norberto

[ Parent | Reply to this comment ]

Posted by captslacker (24.209.xx.xx) on Sun 22 Jan 2006 at 02:58
[ Send Message ]
I'm wondering if I had some bad mushrooms on my pizza or something. Using Breezy Badger. I installed the new version of qemu (0.8.0) (apt-get still installs 0.7.0). I used the debian installer version.

I used qemu-img to create an 10GB image for a new disk. I did not want to try qcow format until I had some experience, and made an assumption that there might be some performance penalty.

Using:

qemu -hda w2kmdw.img -boot d -cdrom /dev/cdrom -win2k-hack (win2k install cd)

I got the install completed for Windows 2000 using the win2k-hack. The image rebooted into a good install .img file, and I logged into the resultant image file. ..... The problem begins here.

I shutdown the emulator using windows shutdown... and then tried to reboot to C: using:

qemu w2kmdw.img -boot c -cdrom /dev/cdrom

I immediately get an

FATAL: INT18: BOOT FAILURE

from the BIOS.

Any ideas, If I don't hear back I'll trash it and start over.

Thanks for any help.

mdw ;-)

[ Parent | Reply to this comment ]

Posted by Anonymous (70.104.xx.xx) on Thu 23 Feb 2006 at 03:22
try `-boot d'

[ Parent | Reply to this comment ]

Posted by Anonymous (195.228.xx.xx) on Sun 29 Jan 2006 at 22:30
tun1: ERROR while getting interface flags: No such device

but:

lsmod:

tun 8832 1

[ Parent | Reply to this comment ]

Posted by Anonymous (69.158.xx.xx) on Thu 19 Oct 2006 at 03:15
What a great set of instructions. I've installed Winxp in the latest Ubuntu, everything went just fine and the install is complete.
When I login as administrator though (for the first time) it tells me
"A problem is preventing Windows from accurately checking the license for this computer. Error Code:0x800703e6"

Any help would be appreciated.

[ Parent | Reply to this comment ]

Posted by craftycathy (4.242.xx.xx) on Wed 27 Dec 2006 at 05:53
[ Send Message ]
Yes I am getting this same error also.

When you get this error, can't go any farther. How to solve this problem??

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Wed 27 Dec 2006 at 10:33
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Googling for the error message leads to this post where it is suggested booting the copy of Windows in Safe Mode and installing Service Pack 2 will fix it.

Since A) I wrote this guide a long time ago and B) I don't have a copy of XP to experiment with thats the best advice I can offer. If it works do let us all know ..

Steve

[ Parent | Reply to this comment ]

Posted by craftycathy (4.242.xx.xx) on Thu 28 Dec 2006 at 02:16
[ Send Message ]
Steve,

I happened to have WinXP Service Pack 2 on CD. Some how I managed to get the cdrom to work to install it. This whole process took hours. The initial installation of the Cd was a snap. But when it came to XP doing it thing, afterwards, this is what took so long. Must of took 5 hours to finish.

After XP did all it needed to do to get SP2 installed and set up, finally restarted and went to Windows where I put in my password. And there it was, finally... Then XP had to do some more stuff with the SP2. Well after that was all over with, I was told I did not have an anti-virus protection. Ok.. so I don't... Worry about that later..

The problem I am having now, now matter what command I put in the Ubuntu Dapper Drake 6.06 terminal, I can not get the Cdrom to work.

In XP it says its working. But all that happens when I click on it is the hour glass appears and stays there.

I have googled looking through page after page of info on this, trying various commands. All I get is errors in the terminal.

I have two Cdrom's. They are hdc and hdd. Now on XP the one it shows is d. But still it don't ever work.

I have tried going into XP and adding hardware. Don't work. One screen even freezes when I do that. Which was Listing hardware on system.

So far this is as far as I have gotten. I wanted Windows inside of Linux so I could use certain programs on Win that I can not get to work on Linux. Still I can not use these programs, cause I can't use the Cd to install them. Or to even copy to Win, then I could install from there.

I don't suppose there is a way to access Ubuntu while in Windows. I have some of these programs on Linux already and could just copy and paste to Win if that is possible.

Thank you for your help...

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Thu 28 Dec 2006 at 09:14
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Not too sure why it is failing, but I can't really help much more than say you should mount the CD-ROM in Linux, then use the "-cdrom /path/to/mount/point" option to use it from Windows.

If you have questions on actually using Qemu you're more likely to get help on from the qemu main website - the documentation/mailing lists will be more use than me ..

Steve

[ Parent | Reply to this comment ]

Posted by yogi4yu (203.94.xx.xx) on Thu 18 Jan 2007 at 04:57
[ Send Message ]
First of all thanx for this stuff .
I tried these instructions with windows XP with SP2 instead of windows2000. But it takes years to install drivers. The green progress indicator bar was full, but nothing was happening. After 6 hrs i killed QEMU.

Does it work with XP or i have to use w2000 ?
--
There is no point in knocking the "closed Windows" when the door is "Open". Open your eyes, use open source software.

PLEASE VISIT & REGISTER @ "www.ossrc.org.in "

Regards,
Yogesh

[ Parent | Reply to this comment ]

Posted by mutsuura (68.239.xx.xx) on Wed 24 Jan 2007 at 20:31
[ Send Message ]
Steve et al

I'd like to try qemu but before I do can someone pls answer this question for me...

I can see the benefit of installing foreign OS's w/ qemu in order to have concurrent systems side-by-side. However, does it make 'any' sense to do an initial 'base' install of Debian first along with qemu then instantiate another [same] Debian install within qemu?

I suspect there's a performance hit in running qemu'd os as opposed to running it in native mode on a separate partition.

The benefit of running Debian within Debian however could be that the whole image [instance] can be easily backed up.

I know there are other alternatives (eg: mondo) to do image backups as well. But would this be a more reliable form of image backup?

Thx

[ Parent | Reply to this comment ]

Posted by ramnet (63.20.xx.xx) on Mon 7 Jul 2008 at 19:59
[ Send Message ]
It sounds like what you're after is virtualization without emulation - there are products tailored just for this purpose - see the following article for more - I'd suggest linux-vserver (it's in debian and real easy to do). http://www.debian-administration.org/articles/328

[ Parent | Reply to this comment ]

Posted by Anonymous (59.167.xx.xx) on Thu 25 Jan 2007 at 18:42
Firstly I think this article is great. I've tried installing Windows 98, though from what may not be a totally legit CD and I'm getting the error messages:
Could not open '/dev/kqemu' - QEMU acceleration layer not activated
and
CDROM boot failure code : 0003
Boot from CD-Rom failed
FATAL: Could not read the boot disk
I would appreciate any help

[ Parent | Reply to this comment ]

Posted by Anonymous (65.65.xx.xx) on Tue 1 May 2007 at 20:05
Are you sure it's a bootable disc? Maybe that disc expects you to use a floppy to bootstrap the install. That was common with windows 98.

[ Parent | Reply to this comment ]

Posted by yogi4yu (202.141.xx.xx) on Sat 27 Jan 2007 at 14:12
[ Send Message ]
Thanx for this gr8 stuff :)
I have 2 queries .
I have dual boot with XP n debian , is it possible to boot that XP on first partition inside debian , instead of creating redundant hd.img again in debian partition ?

I tried XP ( sp2 )on stable debian using these instructions , but it was giving error
" ..spawning too fast , disabled for 5 minutes .. ". Somebody has already posted solution for this , so i tried to edit /etc/inittab but it didn't help.
any solution ?

-------------
There is no point in knocking the "closed Windows" when the door is "Open". Open your eyes, use open source software.

PLEASE VISIT & REGISTER @ "www.ossrc.org.in "

Regards,
Yogesh

[ Parent | Reply to this comment ]

Posted by Anonymous (84.133.xx.xx) on Thu 8 Mar 2007 at 02:54
I got some non-windows-ish problems with qemu+kqemu: netbsd-3.0, -3.1 and a self built -4.0-beta2 will not install as long as the kqemu module is active.

Retried without kqemu and netbsd-3.1-cd: installs fine.

Loaded the kqemu module: Booting the previously installed netbsd-3.1 gor a hang...

Qemu is great but kqemu still needs some time...

[ Parent | Reply to this comment ]

Posted by Anonymous (85.240.xx.xx) on Sun 6 May 2007 at 19:28
Hi

I've tried running Windows in Debian using kqemu and the install went rather well. The emulation speed was not native by far, but qemu is still work in progress. The thing that stopped me from using QEmu was that I wasn't able to install the trial version of Acrobat Pro 8.

Googling for other emulator, I found VirtualBox. Wonderful little piece of free and open source software that has a very good user interface - everything is easy to configure with the graphical interface. Moreover, the emulation speed is (very very very) close to native. If you aren't happy with QEmu, you should really try VirtualBox.

[ Parent | Reply to this comment ]

Posted by Anonymous (198.150.xx.xx) on Tue 19 Jun 2007 at 18:56
I believe VirtualBox is based on Qemu, at least to some extent. Also note that only part of VirtualBox is open source, in case you're the type who only likes completely open source stuff. VirtualBox also has its nice "VBox Guest Additions" that make using an OS as a guest fun ;). I started with VirtualBox, but I'm now playing more with Qemu because it works better with Win98 than VB (no guest addition for Win98, I'm afraid). Oh, and it's available for PPC, so I'm currently running Win98 SE on a G3 iMac :D.

-Gideon

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

Which init system are you using in Debian?






( 1626 votes ~ 7 comments )