View previous topic :: View next topic |
Author |
Message |
notz n00b
Joined: 31 Aug 2004 Posts: 15 Location: Graz, Austria
|
Posted: Tue Mar 01, 2005 8:32 pm Post subject: HOWTO: build qemu from cvs (incl. accelerator) |
|
|
goto to your portage overlay
Code: | cd /usr/local/portage |
download & extract the ebuild
Code: | wget ftp://notz.homelinux.com/qemu-cvs.tar.gz
tar -xzf qemu-cvs.tar.gz |
add arch keyword to package.keywords i.e. ~x86
Code: | echo "=app-emulation/qemu-cvs-0.0.1 ~x86" >> /etc/portage/package.keywords |
for accelerator add kqemu use flag
Code: | echo "app-emulation/qemu-cvs kqemu" >> /etc/portage/package.use |
emerge qemu
load kqemu (accelerator module)
Code: | /etc/init.d/kqemu start |
to load the accelerator module on startup
Code: | rc-update add kqemu default |
start qemu as usual
Code: | qemu -hda hd.img -boot c |
enjoy it and feel free to add your coments, hints and tips.
changelog:
2005-03-14: fixed runscript for udev only users (thx to pussi)
Last edited by notz on Mon Mar 14, 2005 2:50 pm; edited 1 time in total |
|
Back to top |
|
|
AlterEgo Veteran
Joined: 25 Apr 2002 Posts: 1619
|
Posted: Tue Mar 01, 2005 9:26 pm Post subject: |
|
|
Code: |
wget ftp://notz.homelinux.com/qemu-cvs.tar.gz
--22:24:09-- ftp://notz.homelinux.com/qemu-cvs.tar.gz
=> `qemu-cvs.tar.gz'
Resolving notz.homelinux.com... 62.99.150.84
Connecting to notz.homelinux.com[62.99.150.84]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD not needed.
==> PORT ... done. ==> RETR qemu-cvs.tar.gz ...
Error in server response, closing control connection.
Retrying.
|
Fetching the file manually does work
But the rest: excellent work, thanks! |
|
Back to top |
|
|
watashiwaotaku7 n00b
Joined: 26 Mar 2003 Posts: 70
|
Posted: Tue Mar 01, 2005 10:24 pm Post subject: |
|
|
When using qemu, trying to install windows xp it dies with "bus error" when trying to format the image as fat32 (or ntfs) I invoke qemu with "qemu -user-net -enable-audio -m 384 -hda hd.img -cdrom /dev/hdc -boot d" and created the hd image by going to / and invoking "dd of=hd.img bs=1024 seek=30000000 count=0" my root partition is set as device /dev/md0 using md raid, is this what is causing my problem? I also tried making the image on a empty fat32 partition and replacing -hda hd.img with /mnt/hda/hd.img, can anyone tell me what I am doing wrong?
EDIT: FIXED! I removed the -m 384 argument, from what I can tell this is for using virtual memory only, and you must compile qemu with a certain flag in order for this to work, installing now. |
|
Back to top |
|
|
bravecobra Tux's lil' helper
Joined: 26 Dec 2002 Posts: 130 Location: Planet Earth (sometimes)
|
|
Back to top |
|
|
PraetorZero Apprentice
Joined: 11 Dec 2004 Posts: 239 Location: /home
|
Posted: Wed Mar 02, 2005 5:29 pm Post subject: |
|
|
Pardon my n00b-ness, but would this pull whatever is the current version in CVS when you emerge it? So... if I were to find at a later time a new version is out, all I would have to do is clear the cache and re-emerge qemu? |
|
Back to top |
|
|
1der Tux's lil' helper
Joined: 06 Aug 2003 Posts: 99
|
Posted: Wed Mar 02, 2005 5:33 pm Post subject: |
|
|
I also got the same result as watashiwaotaku7.
What did u do to fix it ? What compile flag did you use?
running the old qemu (6.1) was fine. |
|
Back to top |
|
|
watashiwaotaku7 n00b
Joined: 26 Mar 2003 Posts: 70
|
Posted: Wed Mar 02, 2005 10:29 pm Post subject: |
|
|
1der, per my edit, I removed -m 384, if you search there is a thread in portage and programming aobut qemu and the accelerator that talks about using some flag which causes qemu to use only virtual memory.
Having said that, I am still having problems but at least it is installed, everything is working fine, but for some reason it doesnt seem to be using system memory to run windows, which is causing it to be very very slow, I am only using 94 mb of memory total and I have 512 mb so I was hoping to have my emulated OS running on this too, how exactly do I do that? I also imagine other people will want to know since my slowdown running this on raid 0 is big enough, it must be worse with just a regular drive. |
|
Back to top |
|
|
bravecobra Tux's lil' helper
Joined: 26 Dec 2002 Posts: 130 Location: Planet Earth (sometimes)
|
Posted: Thu Mar 03, 2005 4:33 am Post subject: |
|
|
the -m 384 sets the amount of memory you want to assign to qemu. Note that this is the amount of memory you won't be able to use for your host then. _________________ Brave Cobra
http://www.bravecobra.com |
|
Back to top |
|
|
notz n00b
Joined: 31 Aug 2004 Posts: 15 Location: Graz, Austria
|
Posted: Thu Mar 03, 2005 8:53 am Post subject: |
|
|
the mem given to qemu should be lower than /dev/shm
Code: | root # df | grep shm
none 240944 0 240944 0% /dev/shm |
so mine is about 240M....
if you need more, you should edit your fstab and increase /dev/shm .... |
|
Back to top |
|
|
watashiwaotaku7 n00b
Joined: 26 Mar 2003 Posts: 70
|
Posted: Thu Mar 03, 2005 10:11 pm Post subject: |
|
|
none /dev/shm tmpfs defaults , is my /dev/shm line, how do I edit this to change the size?
also,
has anyone experimented with different windows versions to see which is the most responsive?
how does qemu deal with graphics? (eg: does graphic rendering have the same type of slowdown as everything else or does it just use the native drivers to do everything?)
has anyone attempted to register their windows xp on qemu? I'm using an OEM version of windows from dell, and it tells me the registration key is invalid, how will the microsoft support staff feel about me trying to register and emulated version of XP? |
|
Back to top |
|
|
jdgill0 Veteran
Joined: 25 Mar 2003 Posts: 1366 Location: Lexington, Ky -- USA
|
Posted: Thu Mar 03, 2005 11:38 pm Post subject: |
|
|
Use the "size" option:
Code: | none /dev/shm tmpfs size=256m 0 0 |
|
|
Back to top |
|
|
corefile n00b
Joined: 27 Jun 2002 Posts: 44
|
Posted: Sat Mar 05, 2005 1:12 pm Post subject: networing |
|
|
Thanks for the link, helped alot. I was wondering if its posiible to setup networking so that i can set up smb (to access HOST file system) Internet AND local network (printer on the network). So basically I wan't to be about to easially access the host files, use the internet, and use printer on my network |
|
Back to top |
|
|
at6 Tux's lil' helper
Joined: 28 Nov 2002 Posts: 78 Location: /dev/null
|
Posted: Sun Mar 06, 2005 12:41 am Post subject: |
|
|
great howto.
qemu works like a charm. thanks!
best regards
marc _________________ debian: stable but lame! suse: unstable and lame! gentoo: stable and only 4 geeks!
Gadget tests! |
|
Back to top |
|
|
bravecobra Tux's lil' helper
Joined: 26 Dec 2002 Posts: 130 Location: Planet Earth (sometimes)
|
Posted: Sun Mar 06, 2005 4:03 am Post subject: |
|
|
You should be able to able all of that, following the guidelines. Maybe you need to adjust your smb.conf? I haven't tested this, but it should possible. The only thing you won't be able to do, is run services on the qemu host, unless you set upset a forwarding to your host's gateway.
As you can see in the screenshot (might be a little small), I was able to access my network through samba from within qemu and had access to the internet. _________________ Brave Cobra
http://www.bravecobra.com |
|
Back to top |
|
|
pussi l33t
Joined: 08 May 2004 Posts: 727 Location: Finland
|
Posted: Mon Mar 07, 2005 8:50 pm Post subject: |
|
|
Note that if you are using udev, /dev/kqemu is not created automatically when you boot, and acceleration won't work.
( http://fabrice.bellard.free.fr/qemu/kqemu-doc.html#SEC4 )
If youre using udev you need to create the file yourself: Code: | mknod /dev/kqemu c 250 0
chmod 666 /dev/kqemu |
Or you can edit the /etc/init.d/kqemu file: Code: | #!/sbin/runscript
udev() {
# Create the KQEMU device if using udev
if [ -a /dev/kqemu ] ; then
einfo "/dev/kqemu exists"
else
ebegin "Creating /dev/kqemu"
mknod /dev/kqemu c 250 0
chmod 666 /dev/kqemu
fi
}
start() {
ebegin "Loading kqemu module"
/sbin/modprobe kqemu
udev
eend $?
}
stop() {
ebegin "Unloading kqemu module"
/sbin/modprobe -r kqemu
eend $?
} |
|
|
Back to top |
|
|
techiem2 Apprentice
Joined: 28 Sep 2002 Posts: 166 Location: The Net
|
Posted: Tue Mar 08, 2005 8:24 pm Post subject: |
|
|
The Howto is wonderful and worked fine.
I am having one problem though.
When I try to boot my old Win98SE vm, it dies with a Windows Protection Error.
Starting it with -no-kqemu works fine as before.
Any suggestions?
I'm currently trying to install win2k in a new vm to see if that works.
Mark II |
|
Back to top |
|
|
pussi l33t
Joined: 08 May 2004 Posts: 727 Location: Finland
|
Posted: Wed Mar 09, 2005 10:42 am Post subject: |
|
|
techiem2 wrote: | When I try to boot my old Win98SE vm, it dies with a Windows Protection Error.
Starting it with -no-kqemu works fine as before.
Any suggestions?
I'm currently trying to install win2k in a new vm to see if that works.
Mark II | This happened to me also and it seems to be known bug in qemu.
Win2k works fine with me. :) |
|
Back to top |
|
|
Koala Kid Guru
Joined: 09 May 2003 Posts: 382
|
Posted: Wed Mar 09, 2005 4:11 pm Post subject: |
|
|
Guys, how can I access my local files and directories from the guest OS ? _________________ "People are the worst, the worst thing about music is that people play it". M. Patton. |
|
Back to top |
|
|
techiem2 Apprentice
Joined: 28 Sep 2002 Posts: 166 Location: The Net
|
Posted: Wed Mar 09, 2005 10:40 pm Post subject: |
|
|
You have to setup the networking and use smb (at least from win) to access the host.
There's a link higher in the thread about how to set that up.
Direct access to the host fs would be a nice feature. |
|
Back to top |
|
|
stonent Veteran
Joined: 07 Aug 2003 Posts: 1139 Location: Texas
|
Posted: Thu Mar 10, 2005 6:08 am Post subject: |
|
|
Code: | Aurora ~ # /etc/init.d/kqemu start
* Loading kqemu module ...
FATAL: Error inserting kqemu (/lib/modules/2.6.10-gentoo-r4/misc/kqemu.ko): Invalid module format |
Something happened that wasn't right... _________________ Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism. |
|
Back to top |
|
|
Lejban n00b
Joined: 12 Dec 2003 Posts: 53 Location: Sweden
|
Posted: Thu Mar 10, 2005 8:11 am Post subject: |
|
|
Koala Kid wrote: | Guys, how can I access my local files and directories from the guest OS ? |
I use winSCP from the guest (winXP) to any computer including the host (gentoo). Much easier then setting up a smb-server on the host. _________________ http://www.lejban.se|http://www.koad.se |
|
Back to top |
|
|
Koala Kid Guru
Joined: 09 May 2003 Posts: 382
|
Posted: Thu Mar 10, 2005 8:33 am Post subject: |
|
|
Lejban wrote: | Koala Kid wrote: | Guys, how can I access my local files and directories from the guest OS ? |
I use winSCP from the guest (winXP) to any computer including the host (gentoo). Much easier then setting up a smb-server on the host. |
Can you write some details about that ? it sounds me like chinese...
What's that winSCP thing ?
Thanks in advance _________________ "People are the worst, the worst thing about music is that people play it". M. Patton. |
|
Back to top |
|
|
Lejban n00b
Joined: 12 Dec 2003 Posts: 53 Location: Sweden
|
Posted: Thu Mar 10, 2005 9:56 am Post subject: |
|
|
Koala Kid wrote: | Lejban wrote: | Koala Kid wrote: | Guys, how can I access my local files and directories from the guest OS ? |
I use winSCP from the guest (winXP) to any computer including the host (gentoo). Much easier then setting up a smb-server on the host. |
Can you write some details about that ? it sounds me like chinese...
What's that winSCP thing ?
Thanks in advance |
scp is coping over ssh, winscp is a windows app to do this, come on, one google serch would give you this info... _________________ http://www.lejban.se|http://www.koad.se |
|
Back to top |
|
|
Debentoo_Gao Tux's lil' helper
Joined: 21 Nov 2003 Posts: 85 Location: Shanghai,China
|
Posted: Sat Mar 12, 2005 11:36 am Post subject: |
|
|
pussi wrote: | Note that if you are using udev, /dev/kqemu is not created automatically when you boot, and acceleration won't work.
( http://fabrice.bellard.free.fr/qemu/kqemu-doc.html#SEC4 )
If youre using udev you need to create the file yourself: Code: | mknod /dev/kqemu c 250 0
chmod 666 /dev/kqemu |
Or you can edit the /etc/init.d/kqemu file: Code: | #!/sbin/runscript
udev() {
# Create the KQEMU device if using udev
if [ -a /dev/kqemu ] ; then
einfo "/dev/kqemu exists"
else
ebegin "Creating /dev/kqemu"
mknod /dev/kqemu c 250 0
chmod 666 /dev/kqemu
fi
}
start() {
ebegin "Loading kqemu module"
/sbin/modprobe kqemu
udev
eend $?
}
stop() {
ebegin "Unloading kqemu module"
/sbin/modprobe -r kqemu
eend $?
} |
|
I just did all the thing above,but when I start qemu in cosole,it still said "Could not open '/dev/kqemu' - QEMU acceleration layer not activated' _________________ More Love~~More Dream~~More Happiness
Free Your Mind~~Free Your Body~~Free Your Life
http://www.myblue.ws |
|
Back to top |
|
|
pussi l33t
Joined: 08 May 2004 Posts: 727 Location: Finland
|
Posted: Sat Mar 12, 2005 7:09 pm Post subject: |
|
|
I just realized that it don't work with me eiter
I know it should work as it reads in Qemu acceleration module manual, but for some reason it don't. |
|
Back to top |
|
|
|