Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: build qemu from cvs (incl. accelerator)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
notz
n00b
n00b


Joined: 31 Aug 2004
Posts: 15
Location: Graz, Austria

PostPosted: Tue Mar 01, 2005 8:32 pm    Post subject: HOWTO: build qemu from cvs (incl. accelerator) Reply with quote

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
Code:
emerge qemu-cvs


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
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Mar 01, 2005 9:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
watashiwaotaku7
n00b
n00b


Joined: 26 Mar 2003
Posts: 70

PostPosted: Tue Mar 01, 2005 10:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
bravecobra
Tux's lil' helper
Tux's lil' helper


Joined: 26 Dec 2002
Posts: 130
Location: Planet Earth (sometimes)

PostPosted: Tue Mar 01, 2005 10:55 pm    Post subject: Reply with quote

To have both access to internet and your local network from within qemu, check my blog: http://blog.bravecobra.com/index.php/linux/2005/02/25/emulating_an_os_with_qemu
_________________
Brave Cobra
http://www.bravecobra.com
Back to top
View user's profile Send private message
PraetorZero
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 239
Location: /home

PostPosted: Wed Mar 02, 2005 5:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
1der
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2003
Posts: 99

PostPosted: Wed Mar 02, 2005 5:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
watashiwaotaku7
n00b
n00b


Joined: 26 Mar 2003
Posts: 70

PostPosted: Wed Mar 02, 2005 10:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
bravecobra
Tux's lil' helper
Tux's lil' helper


Joined: 26 Dec 2002
Posts: 130
Location: Planet Earth (sometimes)

PostPosted: Thu Mar 03, 2005 4:33 am    Post subject: Reply with quote

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
View user's profile Send private message
notz
n00b
n00b


Joined: 31 Aug 2004
Posts: 15
Location: Graz, Austria

PostPosted: Thu Mar 03, 2005 8:53 am    Post subject: Reply with quote

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
View user's profile Send private message
watashiwaotaku7
n00b
n00b


Joined: 26 Mar 2003
Posts: 70

PostPosted: Thu Mar 03, 2005 10:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Thu Mar 03, 2005 11:38 pm    Post subject: Reply with quote

Use the "size" option:

Code:
none                    /dev/shm                  tmpfs           size=256m               0 0
Back to top
View user's profile Send private message
corefile
n00b
n00b


Joined: 27 Jun 2002
Posts: 44

PostPosted: Sat Mar 05, 2005 1:12 pm    Post subject: networing Reply with quote

bravecobra wrote:
To have both access to internet and your local network from within qemu, check my blog: http://blog.bravecobra.com/index.php/linux/2005/02/25/emulating_an_os_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
Back to top
View user's profile Send private message
at6
Tux's lil' helper
Tux's lil' helper


Joined: 28 Nov 2002
Posts: 78
Location: /dev/null

PostPosted: Sun Mar 06, 2005 12:41 am    Post subject: Reply with quote

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
View user's profile Send private message
bravecobra
Tux's lil' helper
Tux's lil' helper


Joined: 26 Dec 2002
Posts: 130
Location: Planet Earth (sometimes)

PostPosted: Sun Mar 06, 2005 4:03 am    Post subject: Reply with quote

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
View user's profile Send private message
pussi
l33t
l33t


Joined: 08 May 2004
Posts: 727
Location: Finland

PostPosted: Mon Mar 07, 2005 8:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
techiem2
Apprentice
Apprentice


Joined: 28 Sep 2002
Posts: 166
Location: The Net

PostPosted: Tue Mar 08, 2005 8:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
pussi
l33t
l33t


Joined: 08 May 2004
Posts: 727
Location: Finland

PostPosted: Wed Mar 09, 2005 10:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Koala Kid
Guru
Guru


Joined: 09 May 2003
Posts: 381

PostPosted: Wed Mar 09, 2005 4:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
techiem2
Apprentice
Apprentice


Joined: 28 Sep 2002
Posts: 166
Location: The Net

PostPosted: Wed Mar 09, 2005 10:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Thu Mar 10, 2005 6:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Lejban
n00b
n00b


Joined: 12 Dec 2003
Posts: 53
Location: Sweden

PostPosted: Thu Mar 10, 2005 8:11 am    Post subject: Reply with quote

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
View user's profile Send private message
Koala Kid
Guru
Guru


Joined: 09 May 2003
Posts: 381

PostPosted: Thu Mar 10, 2005 8:33 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Lejban
n00b
n00b


Joined: 12 Dec 2003
Posts: 53
Location: Sweden

PostPosted: Thu Mar 10, 2005 9:56 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Debentoo_Gao
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2003
Posts: 85
Location: Shanghai,China

PostPosted: Sat Mar 12, 2005 11:36 am    Post subject: Reply with quote

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
View user's profile Send private message
pussi
l33t
l33t


Joined: 08 May 2004
Posts: 727
Location: Finland

PostPosted: Sat Mar 12, 2005 7:09 pm    Post subject: Reply with quote

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. :(
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum