LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   A question about qemu (https://www.linuxquestions.org/questions/slackware-14/a-question-about-qemu-610891/)

cwwilson721 01-03-2008 01:16 PM

A question about qemu
 
I use qemu rather frequently, using XP in Slackware...

But I also dual boot SW12/XP.

Can I run qemu using the windows drive? In other words, instead of using the xp.img file, can I use /dev/hda1?

Just curious, not sure if I actually will.

I know there are hardware issues, etc, but...

dive 01-03-2008 02:15 PM

I may be wrong but I don't think it's possible. I think qemu will only work with an image and its internals need to read/write to the image in certain ways that wouldn't work with a real file system.

TSquaredF 01-03-2008 03:20 PM

I know its possible, at least with Win2K; I'm doing it. Win2K is in /dev/hda1 & has its own bootloader in the hda MBR. I'm using a modified version of Eric Hamleers script to start it. Here it is:
Quote:

#!/bin/sh
#
# Start guest OSes in QEMU

NAME=${0: -5}
# If you want a CD available, use a '-cdrom' parameter:
PARAMS=$*

# Qemu can use SDL sound instead of the default OSS
export QEMU_AUDIO_DRV=sdl

# Whereas SDL can play through alsa:
export SDL_AUDIODRIVER=alsa

# Change this to the directory where the QEMU images are stored:
IMAGEDIR=/home/bill

# Now, change directory to your image directory
cd $IMAGEDIR

IMAGE="/dev/hda"

vdeqemu -kernel-kqemu -net vde,vlan=0 -net nic,vlan=0,macaddr 52:54:00:00:EE:02 -m 256 -localtime -serial /dev/ttyS0 -soundhw all -hda $IMAGE 1>$NAME.log 2>$NAME.err ${PARAMS} &

exit 0
I also have two hardware profiles set up for Win2K, one for qemu, one for booting standalone, but I'm not sure you can do that with WinXP.
Regards,
Bill

cwwilson721 01-03-2008 03:54 PM

I'm thinking the different 'bios' might make XP freak....

But, what the heck...I'll try it. If I toasy my XP install, It deserves it...lol

iiv 01-03-2008 04:29 PM

Have you tries XEN? It can do that, if the your processor supports virtualisation. The benefit of XEN is that it will be much faster.

cwwilson721 01-03-2008 05:12 PM

Quote:

Originally Posted by iiv (Post 3010265)
Have you tries XEN? It can do that, if the your processor supports virtualisation. The benefit of XEN is that it will be much faster.

Not to be rude, but my original question was
Quote:

A question about qemu
, NOT "What can do this?"

Just trying to keep this on post, not turn it into a "This can do this..." thread.

I'm using qemu already to run XP inside of Slackware, and other Slackware "tweaks", and am in no way interested in "the newest, greatest, cutting edge...". qemu works, and I'm sticking to it.

The answer, for now, seems to be "Yes, kinda, maybe" I was just wondering if it was possible. I'll try that script later on tonight, see what happens.

Now, for the betting portion:

I think it will:

Toast my XP install because of radically different hardware setups.

I'm giving even odds on that...

osor 01-03-2008 07:51 PM

Quote:

Originally Posted by cwwilson721 (Post 3010311)
Toast my XP install because of radically different hardware setups.

You will need to use hardware profiles to get this to work (and yes, you can use hardware profiles on Windows XP). I don’t know the specifics, though I know someone who does something similar. He has a bootable windows XP on a removable hard drive, which he uses to boot two separate machines (at separate times of course). It works reliably now, but it took about a week of tweaking before he could get both machines’ sound cards to work. AFAICT, using qemu would accomplish the exact same thing (except one machine would be virtual and the hard drive would never really be moved).

Btw, this can be accomplished with linux as the guest system as well (it is even a little easier since you won’t need to muck around with “hardware profiles”).

cwwilson721 01-03-2008 11:25 PM

My thought was M$'s "licensing" thing is semi-dependent upon hardware...A change in bios, as a matter of fact, is one of the major things that can make windows say "this is no longer valid".

But, as I said....I don't care. It's more of a philosophical exercise than anything.

More of a "Cool" than "need". I can do without windows at all. It's more of a "can I...?" than "Have to...". So I'll try it, probably tomorrow night. I have to be at work in the AM, then after I get home, I'll give it a shot.

I'll post the results, and what is lacking.

As I stated in the original post, I was just wondering if it was possible...

Woodsman 01-05-2008 12:57 PM

Quote:

Can I run qemu using the windows drive? In other words, instead of using the xp.img file, can I use /dev/hda1?
If have done this successfully. Two hardware profiles are needed. One for the actual hardware in the box for when you dual boot, and one for when you run Windows in the virtual hardware environment. My testing was with NT4. Of course, with NT4 I had no issues with the nonsense licensing schemes implemented by XP.


All times are GMT -5. The time now is 02:59 AM.