LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Qemu (KVM) and Vista. (https://www.linuxquestions.org/questions/linux-software-2/qemu-kvm-and-vista-616158/)

ComputerGreek 01-24-2008 09:54 PM

Qemu (KVM) and WINDOWS Vista.
 
Qemu (KVM) and Vista.

I wrote this article nearly a year ago, but never got around to finishing it. I have added the driver ISO, but otherwise it is little changed. I used the Kernel Virtual Machine (KVM) rather than QEMU itself, but what works for KVM, will usually work for QEMU, as KVM has QEMU as its foundation. If time permits, I will add a section on which CPUs are KVM capable and how to compile the latest version of KVM. Until then, I will point you to:

http://kvm.qumranet.com/kvmwiki and
http://fabrice.bellard.free.fr/qemu/

Copy your Vista installation disk to an iso image with:

dd if=/dev/cdrom of=vista.iso

Create a raw image with:

/usr/local/kvm/bin/qemu-img create -f raw vista.img 10G

The reason for using the raw format is that you can use ntfs-3g to mount the image. This makes copying files into the image a breeze. However, do not boot the image when it is mounted, or mount it when booted, as this will probably fry it.

You need one of the following kvm kernel modules:

/sbin/modprobe kvm-amd
/sbin/modprobe kvm-intel

Vista does not produce valid boot sector information, so partition and format the image, vista.img, with XP or Linux. For example, use:

qemu-system-x86_64 -boot d -m 512 vista.img -cdrom xp.iso

to format the image using an XP install disk (xp.iso). Stop after the partition is formated (with NTFS).

KVM doesn't make a distinction between i386 and x86_64 so, even in i386, you should use qemu-system-x86_64. If your system cannot find qemu-system-x86_64, you might need to use the full path:

/usr/local/kvm/bin/qemu-system-x86_64.

Now install Vista with:

qemu-system-x86_64 -boot d -m 512 vista.img -cdrom vista.iso

The installation runs much faster from the iso image, but, you can also install from the CD with:

qemu-system-x86_64 -boot d -m 512 vista.img -cdrom /dev/cdrom

Now mount vista.img and copy the drivers into the image:

mount -t ntfs-3g -o loop,offset=$((63*512)) vista.img /1
mkdir /1/drivers; cp -r ES1370 RTL8029 /1/drivers

$((63*512)) = 32256, 63 sectors of 512 bytes. Or, use the tiny iso image, drivers.iso:

bunzip2 drivers.iso.bz2
qemu-system-x86_64 -m 512 -soundhw es1370 -usb -usbdevice tablet vista.img -cdrom drivers.iso

The option -soundhw es1370 has qemu emulate an Ensoniq AudioPCI ES1370 sound card.

The default network hardware -net nic,model=ne2k_pci is a Realtek 8029 PCI Ethernet Card.

Drivers for both, are on drivers.iso. Install them by right-clicking on the .inf files and choosing install from the menu.

The complete default network option is -net nic,model=ne2k_pci -net user. The -net user option sets up a SLIRP connection (since it is modeled on the earlier SLIRP connections). It allows you to get on the internet and is naturally fire-walled. It is not a true network connection, e.g., ping does not work.

Qemu can also emulate a Realtek 8139 Ethernet Card, which Vista does have a driver for, however, this does not recognize the SLIRP connection, the DHCP server, or the tap devices (so is essentially useless to you).

To use the Realtek 8139 card use the option -net nic,model=rtl8139.

Kvmwiki claims that rtl8139 now works with recent versions of KVM. You apparently need, the 0.9.0-cvs version of QEMU (check, e.g., kvm-58/qemu/VERSION). If you are still using QEMU 0.9.0, then you will need the rtl8029 driver. It should be noted, that the rtl8139 driver, always "worked", you just couldn't connect to the internet, or do anything useful, with it.

Now run Vista with the command:

qemu-system-x86_64 -m 512 -localtime -soundhw es1370 -usb -usbdevice tablet vista.img

The -usb -usbdevice tablet option allows your mouse to escape from Vista to Linux by just moving outside the Vista window (without this, you have to press Ctrl-Alt to escape the mouse).

The -m 512 option allocates 512 MB of RAM to KVM.

Using the -no-acpi option can result in much faster installation and performance. However, I am told that Vista does not work with this option?

ComputerGreek 01-26-2008 04:23 AM

The complete default network option is -net nic,model=ne2k_pci -net user. It allows you to get onto the internet and is naturally fire-walled. The -net user part sets up a SLIRP connection. It is not a true network connection, e.g., ping does not work. The SLIRP connection comes with its own DHCP server. Setting a static IP address will cause things not to work.

ComputerGreek 01-26-2008 03:37 PM

Does anyone know if Vista works with the -no-acpi option?

ComputerGreek 01-27-2008 05:00 PM

Please; Does anyone know if Vista works with the -no-acpi option?

ComputerGreek 01-28-2008 07:44 PM

Does anyone actually read these threads?

ComputerGreek 01-29-2008 06:54 PM

Why doesn't someone humor me and reply? Just to prove that at least one person has read (at least) some of this thread.

ComputerGreek 01-31-2008 12:08 AM

Why doesn't someone humor me and reply? A good question.

teddyt 01-31-2008 12:21 PM

I think you turned us all off with your use of 'Vista' in the title: it's an ugly, obscure OS, the door of whom only the most self-hating among us dares to knock.

No idea. But this is a reply.

Uncle_Theodore 01-31-2008 12:29 PM

Quote:

Originally Posted by ComputerGreek (Post 3040709)
Why doesn't someone humor me and reply? A good question.

Gee, man, I think you've got your reply. No, nobody knows if vista works with -no-acpi :D

ComputerGreek 02-01-2008 05:13 PM

Thanks Ted, and here's me thinking that Vista might attract attention.

jens 02-01-2008 06:35 PM

Quote:

Originally Posted by ComputerGreek (Post 3042949)
Thanks Ted, and here's me thinking that Vista might attract attention.

Vista is really the last thing you want to to run in kqemu (most of us don't even have the hardware for it ) ;)

As far as I know, Vista needs acpi support to install it.
I never managed to run it qemu for this reason (acpi support in qemu is new and buggy).

ComputerGreek 02-02-2008 03:12 AM

Quote:

Originally Posted by jens (Post 3043016)
Vista is really the last thing you want to to run in kqemu (most of us don't even have the hardware for it )

It runs OK, except for anything that involves heavy graphics.

XP Office extra run fine.

And by the way, not kqemu, but Qemu and KVM.

You use kqemu if you cannot run the kernel virtual machine (KVM).

ComputerGreek 02-08-2008 12:31 AM

By the way, run XP, not Vista, if at all possible.

XP is all-round better.

jens 02-08-2008 12:46 AM

Quote:

Originally Posted by ComputerGreek (Post 3049879)
By the way, run XP, not Vista, if at all possible.

XP is all-round better.

I'm still interested in knowing if Vista will work in Qemu (I use kqemu since Debian comes with a 2.6.18 kernel).

I tried the instructions you posted above, but it still gives me the same old acpi error when booting...

Did you try it in both kvm and qemu (and what 64 version are you using?)?

teddyt 02-08-2008 10:46 AM

Quote:

Originally Posted by jens (Post 3049885)
I'm still interested in knowing if Vista will work in Qemu (I use kqemu since Debian comes with a 2.6.18 kernel).

I'm not sure it matters - while I don't remember the exact policy, it violates the license to run at least some versions of Vista virtualized.

ComputerGreek 02-10-2008 06:05 PM

Quote:

Originally Posted by jens (Post 3049885)
Did you try it in both kvm and qemu (and what 64 version are you using?)?

Only with kvm. AMD-64.

By the way, QEMU version 0.9.1 is out.

Using it may help.

ComputerGreek 02-11-2008 04:06 PM

jens: did QEMU version 0.9.1 solve your problems?

jens 02-11-2008 05:53 PM

Sadly, ... no.
Qemu seems to have some weird acpi problems (It did went a lot further though).

I tried it with kvm and virtual box on my Slackware laptop and that did work (that system isn't powerful enough though).

If everything else fails, I'll just try VB on Etch.

PS: I only need vista to test some compatibility issues, so it doesn't even need to run perfect. I'd really like to stick with Qemu/KVM though...

ComputerGreek 02-12-2008 02:20 PM

Quote:

Originally Posted by jens (Post 3053985)
Sadly, ... no. Qemu seems to have some weird acpi problems (It did went a lot further though).

That's a shame. I might have to try Qemu (no KVM) on a friends machine. I will let you know how things turn out.

ComputerGreek 02-13-2008 05:44 PM

Quote:

Originally Posted by ComputerGreek (Post 3054834)
I will let you know how things turn out.

Looks like that won't be happening.

ComputerGreek 02-15-2008 05:47 PM

Quote:

Originally Posted by jens (Post 3053985)
Qemu seems to have some weird acpi problems.

I assume you have tried the -no-acpi option

crashmeister 02-16-2008 03:57 AM

What do you expect?
Nobody even knows what physical hardware vista works with for sure.

ComputerGreek 02-17-2008 07:12 PM

Yeah. Although it runs with Vista, I use it with XP.

I just like XP better.

crashmeister 02-18-2008 03:56 AM

Is this with the ultimate-super-duper edition?
Me thinks there is something in the EULA about the home and whatever else editions not being allowed to run in a VM.Or was it not being allowed to run VM's?

ComputerGreek 02-20-2008 05:18 PM

Quote:

Originally Posted by crashmeister (Post 3061122)
Is this with the ultimate-super-duper edition?

I was using the home edition.

ComputerGreek 02-23-2008 03:47 PM

I was using the home edition. Does the ultimate-super-duper edition do anything extra for you as far as Qemu is concerned?

jens 02-23-2008 03:55 PM

Quote:

Originally Posted by ComputerGreek (Post 3067558)
I was using the home edition. Does the ultimate-super-duper edition do anything extra for you as far as Qemu is concerned?

It's only a legal matter.
Their license does mention your not allowed to use it as a VM.

A license doesn't meant everything though.
Stating something in *any* license doesn't make that automatically true.

It still depends on local copyright law.

crashmeister 02-24-2008 03:59 AM

I don't care much about licenses in that respect - way I see it what you do at home with your software is nobodys concern.
What I don't know is if they disabled some things you might need in order to use the home version in a VM.

ComputerGreek 02-26-2008 08:49 AM

Quote:

Originally Posted by crashmeister (Post 3067971)
What I don't know is if they disabled some things you might need in order to use the home version in a VM.

Nope. Everything seems to work.

ComputerGreek 03-07-2008 06:42 AM

Quote:

Originally Posted by ComputerGreek (Post 3070272)
Nope. Everything seems to work.

Did I say that for Vista: Except for anything that needs a decent video card.

crashmeister 03-07-2008 07:08 AM

I was wondering where you get a virtual machine with 4 cores, 4 gig ram and an emulated gtx 8800 from :)

ComputerGreek 03-07-2008 10:01 PM

Quote:

Originally Posted by crashmeister (Post 3081025)
I was wondering where you get a virtual machine with 4 cores, 4 gig ram and an emulated gtx 8800 from :)

You wouldn't emulate a gtx 8800.

You would give the virtual machine direct access to the video card :)

crashmeister 03-08-2008 03:16 AM

Quote:

Originally Posted by ComputerGreek (Post 3081688)
You wouldn't emulate a gtx 8800.

You would give the virtual machine direct access to the video card :)

How do you do that with qemu?

jens 03-08-2008 06:08 AM

Quote:

Originally Posted by crashmeister (Post 3081836)
How do you do that with qemu?

You don't.
(K)Qemu is the fastest (raw cpu) of them all but not for graphical stuff (It does have an OpenGL patch/option though). As far as I know, it doesn't
"emulate" high end cards...

Qemu (and kqemu/kvm) is not a good option if you're looking for graphical performance. (This could change though, KVM is getting better with every release).

crashmeister 03-08-2008 07:01 AM

Quote:

Originally Posted by jens (Post 3081917)
You don't.
(K)Qemu is the fastest (raw cpu) of them all but not for graphical stuff (It does have an OpenGL patch/option though). As far as I know, it doesn't
"emulate" high end cards...

Thats what I thought but I am always willing to learn something new.

About the speed thing:
Dunno - last time I tried kqemu it was kind of sluggish for compiling.
It's hard to say because reliable benchmarks of VM's are hard to find.I read that Vmware even expicitly prohibits publishing benchmarks in their license.

ComputerGreek 03-08-2008 07:21 AM

Quote:

Originally Posted by crashmeister (Post 3081836)
How do you do that with qemu?

There is nothing stopping you from giving Qemu direct access to the video card. Except of course the coding.

crashmeister 03-08-2008 08:07 AM

Quote:

Originally Posted by ComputerGreek (Post 3081962)
There is nothing stopping you from giving Qemu direct access to the video card. Except of course the coding.

Could you please elaborate on that?

I can't find anything anywhere about doing this.

jens 03-08-2008 12:09 PM

Quote:

Originally Posted by crashmeister (Post 3081946)
About the speed thing:
Dunno - last time I tried kqemu it was kind of sluggish for compiling.
It's hard to say because reliable benchmarks of VM's are hard to find.I read that Vmware even expicitly prohibits publishing benchmarks in their license.

Did you try it with a headless VM ?
I use it like that with RDP to avoid the sluggish graphics emulation.

I find the speed difference very noticeable compared to VMWare.
Virtual Box isn't bad for this either (but more aimed for desktop systems).

crashmeister 03-08-2008 01:28 PM

Never used qemu headless - wouldn't make a difference either because I normally don't run a GUI in VM's.
Virtualbox (usuaslly run the headless either) was faster at the time which didn't make much sense since it shares a lot of code with qemu.

jens 03-08-2008 03:01 PM

Quote:

Originally Posted by crashmeister (Post 3082269)
Never used qemu headless - wouldn't make a difference either because I normally don't run a GUI in VM's.
Virtualbox (usuaslly run the headless either) was faster at the time which didn't make much sense since it shares a lot of code with qemu.

Well, I must admit that I don't know Virtualbox that good.
We mostly use Xen (RHEL, IBM), but that only makes sense for networking (xen beats everything here).
We do have a number of servers (mostly running drupal) using kvm and I'm really happy with those. Qemu's best thing is its raw cpu performance (IMHO, still the most important part).

crashmeister 03-08-2008 03:41 PM

If you do servers you might be interested in disk I/O which doesn't seem too great on any VM.
desides running any benchmark on VM's is funny business from my experience.

I am wondering where M$ is going with their next VM - either they go halfbaked as usual or if they really want to get all the way they'll have to include 3d for vista.

ComputerGreek 03-12-2008 08:52 AM

Quote:

Originally Posted by crashmeister (Post 3082008)
Could you please elaborate on that?

I can't find anything anywhere about doing this.

You need only adjust the Qemu code to have direct access to the video card. Think of a system with two video cards. Assign one of them to Qemu.

ComputerGreek 03-13-2008 07:40 AM

Well? Two video cards. What do you think?

crashmeister 03-13-2008 09:05 AM

Never heard about anybody doing this - I know there is some prealpha software to get some 3d going but attaching a video card directly to the VM is news to me.

ComputerGreek 03-22-2008 12:57 AM

Quote:

Originally Posted by crashmeister (Post 3087330)
Never heard about anybody doing this - I know there is some prealpha software to get some 3d going but attaching a video card directly to the VM is news to me.

It just seemed like something that was doable.

ComputerGreek 03-27-2008 09:02 PM

Quote:

Originally Posted by ComputerGreek (Post 3096636)
It just seemed like something that was doable.

I would really love to see someone take up the idea.

davide.rossetti 04-30-2008 12:09 PM

KVM and Vista on a real disk partition
 
just a question... I already have a dual boot PC, with Vista pre-installed on my 500GB SATA disk, and I’d like to boot kvm from the NTFS partition, not from a disk image. is it possible ???

Bernstein34 05-05-2008 08:42 AM

Quote:

Originally Posted by ComputerGreek (Post 3096636)
It just seemed like something that was doable.

I would be interesting if doable.

satimis 08-11-2008 02:06 AM

Hi ComputerGreek,


Your guide may help me out.


Quote:

Vista does not produce valid boot sector information, so partition and format the image, vista.img, with XP or Linux. For example, use:
qemu-system-x86_64 -boot d -m 512 vista.img -cdrom xp.iso
Having installed Vista, Ultimate Edition, on KVM at least 3 times. Each time Vista can't boot after exit. It just boots seemingly to Rescue Mode. I have to put its installer on CDRom and re-run;

# kvm -m 1024 vista.img -cdrom /dev/scd0 -boot d

to start the OS. It is working fine on the VM able connecting Internet w/o problem.


Your comment abovementioned clears my doubt on mis-installation. Vista can't boot by itself on VM without some treatment.


If I use linux.iso when shall I stop installing Linux on linux.iso? Please advise. TIA


I'm prepared running Ubuntu8.04 amd64 desktop which is the Host OS on VM


B.R.
satimis


Furthermore can I use 64bit OS on 32bit Vista? OR I have to run a 32bit Linux installer to do the job? Thanks

DaveAtFraud 05-22-2009 11:04 AM

Resurrecting an old thread
 
I had Vista working in a qemu VM at one point. I probably still have a screen shot. I wanted to get kqemu working and I was playing with Windows 7 RC so I rebuilt all of the pieces (kqemu, qemu, etc.) including the kernel (currently running the 2.6.30-rc6 kernel). W7 works fine now as does Windows Server 2008 and both with kqemu but Vista is giving me the STOP: 0x000000A5 BSOD. Supposedly this is an ACPI problem but that doesn't explain Server 2008 and W7 working.

I've tried going back to the configuration that had previously worked with Vista (qemu 0.9.1 with or without kqemu, previous kernel, etc.) but I still get the same BSOD. This includes using a gzipped image that used to work and trying a clean install into a new VM.

Just for sanity's sake, does anyone have Vista running in a qemu VM (with or without kqemu)? If so, what if anything did you do to get Vista running (which version of qemu, etc. are you using)?

Any suggestions as to how to troubleshoot/debug this are welcome. I'd like to have Vista working "for completeness" so, please, no suggestions to just abandon Vista. I've started taking some classes on network security and being able to run any OS I want in a VM is really handy.

Thanks,
Dave


All times are GMT -5. The time now is 06:11 PM.