DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th November 2008
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default qemu + guest os winxp - very slow..

Hi, folks!

Today I've installed qemu, cause I'm really tired from dual booting FreeBSD/WinXP. First I've installed qemu-devel from ports with kqemu-kmod-devel, then installed WinXP successfully but the performance is very poor. I have aio, if_bridge, if_tap and kqemu loaded.

I've tried running qemu with -vnc :1 option, but the performance is even slower.

After that I decided to give qemu (no devel) a chance. I think it works a little better than qemu-devel, but still it uses almost 99-100% of my CPU (AMD Athlon ~ 2.2 Ghz)

My question is how to reduce that CPU usage so I can get a better performance? Now I realize that I can't switch to FreeBSD completely cause I still need some win apps like AutoCAD.

Thanks everyone!

Cheers,
DNAeon
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
  #2   (View Single Post)  
Old 18th November 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

QEMU is slow unfortunelly, you may check Win4BSD which is free for personal use and seems to be faster then QEMU.

Other thing is to use Windows 2000 cause it uses less resources and CPU then XP.

But generally virtualization on FreeBSD sucks greatly, You should also try VirtualBox @ OpenSolaris with Guest Additions for the Guest OS, runs very fast.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #3   (View Single Post)  
Old 18th November 2008
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

I wanted to use Qemu on OpenBSD box. I am running AMD64 4.4 release on Intel Core 2 Duo and 3 GB of RAM. Qemu is not just slow I get core dump every time I try to install new package inside virtual disk. This happened when I had FreeBSD 7.0 in my virtual disk. It happened when I run OpenBSD latest snapshot in virtual disk. It was very surprising for me to see that OpenBSD actually runs much faster in Qemu than FreeBSD.
I was expecting to see FreeBSD faster by a mile.

Cheers,
OKO
Reply With Quote
  #4   (View Single Post)  
Old 18th November 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

NetBSD should run even faster.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #5   (View Single Post)  
Old 18th November 2008
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

I've tested FreeBSD under qemu too - FreeBSD host system and FreeBSD guest system - 100% cpu usage during boot (is this supposed to be normal?)

My system is not that slow though - I've got 2Gb of RAM and 2.2 Ghz cpu, but qemu just fails to perform well.

I'm currently downloading the latest releases of NetBSD and OpenBSD just to test them under qemu and I'll report back which one works better under qemu.

In my opinion VirtualBox for Linux is far better than qemu, but unfortunately there is no VirtualBox for FreeBSD.
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org

Last edited by DNAeon; 18th November 2008 at 09:58 PM.
Reply With Quote
  #6   (View Single Post)  
Old 18th November 2008
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by vermaden View Post
NetBSD should run even faster.
I am sure it would run the fastest. That is expected behavior but I am in shock how bloated FreeBSD is becoming. Heavily crypted OpenBSD to run faster than vanilla FreeBSD That is just plain ridiculus.
Reply With Quote
  #7   (View Single Post)  
Old 18th November 2008
richardpl richardpl is offline
Spam Deminer
 
Join Date: May 2008
Location: Croatia
Posts: 284
Default

Quote:
Originally Posted by Oko View Post
I am sure it would run the fastest. That is expected behavior but I am in shock how bloated FreeBSD is becoming. Heavily crypted OpenBSD to run faster than vanilla FreeBSD That is just plain ridiculus.
Comparing perfomances on virtual machine is dumb.

changing sysctl kern.hz from 1000 to 100 can help a lot.

Quote:
Originally Posted by FreeBSD 8.0 CURRENT
Date: Mon Oct 27 06:25:02 2008
New Revision: 184323
URL: http://svn.freebsd.org/changeset/base/184323

Log:
Default HZ value (1,000) on i386/amd64 is not very virtual machine friendly.
Due to the nature of the beast it causes lot of unproductive overhead. This
is especially bad when running SMP kernel on VMWare with several virtual
processors - idle FreeBSD guest with SMP kernel takes 150% host CPU time on my
dual-core MacBook Pro when I am enabling two virtual CPUs, making even host
not very usable. Detect when we are running in the sandbox and reduce HZ
to 10 (can be adjusted via VM_HZ in the kernel config) in such cases. This
brings host CPU usage of idle FreeBSD/SMP on two virtual processors down
to 10%.

Detect most popular VM platforms out there - VMWare, Parallels, VirtualBox
and VirtualPC.

MFC after: 2 weeks

Modified:
head/sys/kern/subr_param.c
Reply With Quote
  #8   (View Single Post)  
Old 18th November 2008
DrJ DrJ is offline
ISO Quartermaster
 
Join Date: Apr 2008
Location: Gold Country, CA
Posts: 507
Default

This sadly is a real weakness of the BSD family -- the lack of a good software VM. The old VMware still is the most responsive, but it works only on a single CPU or core. So if you want to use it, you have to disable the rest of your cores and reboot. Even in that mode, it is faster than using all the cores in qemu or Win4BSD on my (very old) dual Athlon box.

It also seems that in spite of repeated requests by the VBox developers, that no FreeBSD developer wishes to contribute to coding the kernel module that stands in the way of getting it to work.

I just keep a Windows box around. There are times when I spend a few days straight on it, and others where I don't use it for a few days. It all depends on what I'm doing. But the VMs just have proven to be too irritating.
Reply With Quote
  #9   (View Single Post)  
Old 19th November 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
Default

On his job Phoenix is quite happy with the KVM virtualizer/emulator. But this needs hardware virtualization support, which only can be found in the newer generation of CPU's
See http://daemonforums.org/showthread.php?t=1410 and http://en.wikipedia.org/wiki/Kernel-...irtual_Machine

But, what is so bad about multibooting ?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 19th November 2008
DrJ DrJ is offline
ISO Quartermaster
 
Join Date: Apr 2008
Location: Gold Country, CA
Posts: 507
Default

Right, but FreeBSD (which I use) does not support KVM (or Xen).

Personally, I hate multi-booting. The program you want to use is always on the other side, and booting for me takes a looonnngggg time. That's because I use ECC-Scrub mode on the memory, and it takes a few minutes (5?) to scan 3GB memory on this slow computer. Then there's the rest of the boot procedure.

It is just easier for me to connect from the Windows box to the BSD box (including remote x sessions when needed) instead when I need to be on the Windows side primarily. I have the computers and the room.
Reply With Quote
Old 19th November 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Accoriding to QEMU Mailing Lists they want to add KVM bits to QEMU itself, along with some gfx addons from both Xen and KVM, the upcoming QEMU 9.2 should be a lot faster then current one, but it will take some time to release also:
http://lists.gnu.org/archive/html/qe.../msg00253.html

More threads:
http://lists.gnu.org/archive/html/qemu-devel/

I also do not get the point why FreeBSD developers are so little interested in virtualization, like VirtualBox.

Someone even ported KVM to FreeBSD as a Summer of Code project, but its as usual, abandoned right now.

This is what I like about OpenSolaris, focusing on 64bit and virtualization.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Old 19th November 2008
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

So what will be your advice, guys - should I stay with qemu or try some other VM software?

I need virtualization for testing. Multi-booting is not an option.

EDIT:
btw while trying to setup these sysctl's gives me an error like sysctl: unknown oid
Code:
# sysctl net.link.ether.bridge_cfg=fxp0,tap0
# sysctl net.link.ether.bridge.enable=1 
# sysctl kern.hz=100
What is wrong?
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org

Last edited by DNAeon; 19th November 2008 at 10:36 AM.
Reply With Quote
Old 19th November 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Default

> kern.hz=100

this needs to go into /boot/loader.conf or set manually in the bootloader.
Reply With Quote
Old 19th November 2008
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Quote:
Originally Posted by ephemera View Post
> kern.hz=100

this needs to go into /boot/loader.conf or set manually in the bootloader.
Thanks for that!

But how can I get the value which is set by default to kern.hz?
Also, I need to set kern.hz on the host machine, right?

EDIT:
My fault, kern.hz should be set on the guest machine.
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org

Last edited by DNAeon; 19th November 2008 at 12:21 PM.
Reply With Quote
Old 19th November 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Quote:
Originally Posted by DNAeon View Post
Also, I need to set kern.hz on the host machine, right?
No, what for?

... but setting it to 100 helps to get more battery time on laptops.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Old 19th November 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Quote:
Originally Posted by DrJ View Post
Right, but FreeBSD (which I use) does not support KVM (or Xen).
As host OS, no.

As guest OS, FreeBSD runs fine in hardware-assisted VMs (HVM) on both Xen and KVM, and there are a couple different ways to get FreeBSD to run in a paravirtualised VM (PV) on Xen. Official support for PV domU (Xen) has even been added to FreeBSD-CURRENT.

If one needs to run multiple OSes at once, on the same machine, they are better off going with a slimmed-down Linux install running KVM, Xen, VMware Server (or even VMWare ESXi), or VirtualBox, and run the different OSes in VMs, including the one they will be using the most.

Virtualisation work in FreeBSD is happening at the "run multiple worlds on single kernel" level (jails / vimage), and from the guest side of things.

Until someone comes out of the woodwork and starts working on VM host support for FreeBSD, this is the best we're going to get.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Old 19th November 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Quote:
Originally Posted by vermaden View Post
I also do not get the point why FreeBSD developers are so little interested in virtualization, like VirtualBox.
No idea. Maybe they don't see the point to running Windows/Linux on top of FreeBSD? [shrug] I agree that having FreeBSD as the host OS would be nice, though.

Quote:
Someone even ported KVM to FreeBSD as a Summer of Code project, but its as usual, abandoned right now.
This saddens me greatly. Unfortunately, there's nothing I can do to rectify this.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Old 19th November 2008
DrJ DrJ is offline
ISO Quartermaster
 
Join Date: Apr 2008
Location: Gold Country, CA
Posts: 507
Default

Quote:
Originally Posted by phoenix View Post
As host OS, no.

As guest OS, FreeBSD runs fine in hardware-assisted VMs ...

If one needs to run multiple OSes at once, on the same machine, they are better off going with a slimmed-down Linux ...

Until someone comes out of the woodwork and starts working on VM host support for FreeBSD, this is the best we're going to get.
That's all right, of course. My challenge is that I really need to limit the number of operating systems I support. Right now I am fine with Free and Windows; adding Linux into the mix is just a pain. Maybe ESX is easy enough so that it wouldn't upset things too much. But then I need new hardware.

For the moment I'm just sticking to multiple machines. It saves a lot of time and irritation, and I already have the hardware. It works well enough for now.
Reply With Quote
Old 19th November 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Quote:
Other thing is to use Windows 2000 cause it uses less resources and CPU then XP.
There is little difference when you turn off the graphic effects and disable some services, Windows XP is just Windows 2000 + some junk.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 21st November 2008
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Quote:
Originally Posted by vermaden View Post
No, what for?

... but setting it to 100 helps to get more battery time on laptops.
I've set the kern.hz to 50 on my testing FreeBSD guest system and it seems to run perfect. Without this setting, I encounter about 10-15% CPU usage when the guest FreeBSD system is idle.

Also the FreeBSD Handbook recommends to set kern.hz
http://www.freebsd.org/doc/handbook/...ion-guest.html
__________________
"I never think of the future. It comes soon enough." - A.E

Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
qemu sound Oko OpenBSD Packages and Ports 2 7th May 2009 06:59 AM
Print on remote WinXP from web host drhowarddrfine General software and network 5 13th October 2008 05:41 PM
Dual-booting WinXP, FreeBSD; unlikely disk geometry ronaldmcdonald9 FreeBSD Installation and Upgrading 6 11th July 2008 06:10 PM
Jailed QEMU + other OS revzalot FreeBSD Installation and Upgrading 3 29th May 2008 06:00 PM


All times are GMT. The time now is 11:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick