Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

HOWTO: build qemu from cvs (incl. accelerator)

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
58 posts
  • 1
  • 2
  • 3
  • Next
Author
Message
notz
n00b
n00b
Posts: 15
Joined: Tue Aug 31, 2004 11:10 pm
Location: Graz, Austria

HOWTO: build qemu from cvs (incl. accelerator)

  • Quote

Post by notz » Tue Mar 01, 2005 8:32 pm

goto to your portage overlay

Code: Select all

cd /usr/local/portage
download & extract the ebuild

Code: Select all

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: Select all

echo "=app-emulation/qemu-cvs-0.0.1 ~x86" >> /etc/portage/package.keywords
for accelerator add kqemu use flag

Code: Select all

echo "app-emulation/qemu-cvs kqemu" >> /etc/portage/package.use
emerge qemu

Code: Select all

emerge qemu-cvs
load kqemu (accelerator module)

Code: Select all

/etc/init.d/kqemu start


to load the accelerator module on startup

Code: Select all

rc-update add kqemu default
start qemu as usual

Code: Select all

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.
Top
AlterEgo
Veteran
Veteran
User avatar
Posts: 1619
Joined: Thu Apr 25, 2002 2:51 pm

  • Quote

Post by AlterEgo » Tue Mar 01, 2005 9:26 pm

Code: Select all

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!
Top
watashiwaotaku7
n00b
n00b
Posts: 70
Joined: Wed Mar 26, 2003 6:52 pm

  • Quote

Post by watashiwaotaku7 » Tue Mar 01, 2005 10:24 pm

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.
Top
bravecobra
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 130
Joined: Thu Dec 26, 2002 8:57 pm
Location: Planet Earth (sometimes)
Contact:
Contact bravecobra
Website

  • Quote

Post by bravecobra » Tue Mar 01, 2005 10:55 pm

To have both access to internet and your local network from within qemu, check my blog: http://blog.bravecobra.com/index.php/li ... _with_qemu
Brave Cobra
http://www.bravecobra.com
Top
PraetorZero
Apprentice
Apprentice
User avatar
Posts: 239
Joined: Sat Dec 11, 2004 4:18 am
Location: /home

  • Quote

Post by PraetorZero » Wed Mar 02, 2005 5:29 pm

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?
Top
1der
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 99
Joined: Wed Aug 06, 2003 9:21 am

  • Quote

Post by 1der » Wed Mar 02, 2005 5:33 pm

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.
Top
watashiwaotaku7
n00b
n00b
Posts: 70
Joined: Wed Mar 26, 2003 6:52 pm

  • Quote

Post by watashiwaotaku7 » Wed Mar 02, 2005 10:29 pm

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.
Top
bravecobra
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 130
Joined: Thu Dec 26, 2002 8:57 pm
Location: Planet Earth (sometimes)
Contact:
Contact bravecobra
Website

  • Quote

Post by bravecobra » Thu Mar 03, 2005 4:33 am

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
Top
notz
n00b
n00b
Posts: 15
Joined: Tue Aug 31, 2004 11:10 pm
Location: Graz, Austria

  • Quote

Post by notz » Thu Mar 03, 2005 8:53 am

the mem given to qemu should be lower than /dev/shm

Code: Select all

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 ....
Top
watashiwaotaku7
n00b
n00b
Posts: 70
Joined: Wed Mar 26, 2003 6:52 pm

  • Quote

Post by watashiwaotaku7 » Thu Mar 03, 2005 10:11 pm

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?
Top
jdgill0
Veteran
Veteran
User avatar
Posts: 1366
Joined: Tue Mar 25, 2003 10:12 pm
Location: Lexington, Ky -- USA

  • Quote

Post by jdgill0 » Thu Mar 03, 2005 11:38 pm

Use the "size" option:

Code: Select all

none                    /dev/shm                  tmpfs           size=256m               0 0
Top
corefile
n00b
n00b
Posts: 44
Joined: Thu Jun 27, 2002 7:02 am

networing

  • Quote

Post by corefile » Sat Mar 05, 2005 1:12 pm

bravecobra wrote:To have both access to internet and your local network from within qemu, check my blog: http://blog.bravecobra.com/index.php/li ... _with_qemu
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
Top
at6
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 78
Joined: Thu Nov 28, 2002 6:19 pm
Location: /dev/null

  • Quote

Post by at6 » Sun Mar 06, 2005 12:41 am

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!
Top
bravecobra
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 130
Joined: Thu Dec 26, 2002 8:57 pm
Location: Planet Earth (sometimes)
Contact:
Contact bravecobra
Website

  • Quote

Post by bravecobra » Sun Mar 06, 2005 4:03 am

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
Top
pussi
l33t
l33t
Posts: 727
Joined: Sat May 08, 2004 9:28 am
Location: Finland

  • Quote

Post by pussi » Mon Mar 07, 2005 8:50 pm

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: Select all

mknod /dev/kqemu c 250 0
chmod 666 /dev/kqemu
Or you can edit the /etc/init.d/kqemu file:

Code: Select all

#!/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 $?
}
Top
techiem2
Apprentice
Apprentice
Posts: 166
Joined: Sat Sep 28, 2002 7:33 pm
Location: The Net
Contact:
Contact techiem2
Website

  • Quote

Post by techiem2 » Tue Mar 08, 2005 8:24 pm

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
Top
pussi
l33t
l33t
Posts: 727
Joined: Sat May 08, 2004 9:28 am
Location: Finland

  • Quote

Post by pussi » Wed Mar 09, 2005 10:42 am

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. :)
Top
Koala Kid
Guru
Guru
User avatar
Posts: 382
Joined: Fri May 09, 2003 2:07 pm

  • Quote

Post by Koala Kid » Wed Mar 09, 2005 4:11 pm

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.
Top
techiem2
Apprentice
Apprentice
Posts: 166
Joined: Sat Sep 28, 2002 7:33 pm
Location: The Net
Contact:
Contact techiem2
Website

  • Quote

Post by techiem2 » Wed Mar 09, 2005 10:40 pm

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.
Top
stonent
Veteran
Veteran
User avatar
Posts: 1139
Joined: Thu Aug 07, 2003 2:05 am
Location: Texas
Contact:
Contact stonent
Website

  • Quote

Post by stonent » Thu Mar 10, 2005 6:08 am

Code: Select all

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.
Top
Lejban
n00b
n00b
User avatar
Posts: 53
Joined: Fri Dec 12, 2003 2:36 am
Location: Sweden
Contact:
Contact Lejban
Website

  • Quote

Post by Lejban » Thu Mar 10, 2005 8:11 am

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
Top
Koala Kid
Guru
Guru
User avatar
Posts: 382
Joined: Fri May 09, 2003 2:07 pm

  • Quote

Post by Koala Kid » Thu Mar 10, 2005 8:33 am

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... :lol:
What's that winSCP thing ?

Thanks in advance 8)
"People are the worst, the worst thing about music is that people play it". M. Patton.
Top
Lejban
n00b
n00b
User avatar
Posts: 53
Joined: Fri Dec 12, 2003 2:36 am
Location: Sweden
Contact:
Contact Lejban
Website

  • Quote

Post by Lejban » Thu Mar 10, 2005 9:56 am

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... :lol:
What's that winSCP thing ?

Thanks in advance 8)
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
Top
Debentoo_Gao
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 85
Joined: Fri Nov 21, 2003 2:28 am
Location: Shanghai,China
Contact:
Contact Debentoo_Gao
Website

  • Quote

Post by Debentoo_Gao » Sat Mar 12, 2005 11:36 am

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: Select all

mknod /dev/kqemu c 250 0
chmod 666 /dev/kqemu
Or you can edit the /etc/init.d/kqemu file:

Code: Select all

#!/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
Top
pussi
l33t
l33t
Posts: 727
Joined: Sat May 08, 2004 9:28 am
Location: Finland

  • Quote

Post by pussi » Sat Mar 12, 2005 7:09 pm

I just realized that it don't work with me eiter :oops: :oops:

I know it should work as it reads in Qemu acceleration module manual, but for some reason it don't. :(
Top
Post Reply

58 posts
  • 1
  • 2
  • 3
  • Next

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic