qemu 9 and kqemu for ubuntu dapper and edgy
Open source processor emulator qemu of the 0.9′th version is out, and the new version of kqemu acceleration module is released under GPL. That is the first reason to install or to upgrade them. The second reason is current absence qemu 0.9 and kqemu packages for ubuntu edgy and dapper. And the final reason for a someone can be the kernel panic issue in the guest os runnig in qemu installed from the official ubuntu repository (happend for me only with kqemu).
You can install a packages of qemu 0.9 and kqemu for ubuntu dapper and edgy from my repository. The qemu in my repository is a packaged official binary build of qemu. And the kqemu packages are from from debian experimental repository. In addition qemu package will automaticaly initialise a recommended for qemu system parameters and will insert a kqemu modle if such is installed, after the system bootup (check /etc/init.d/qemu file), even if last is installed not from a package.
instalation
At first add my repository to /etc/apt/sources.list for edgy:
deb http://ubuntu.tolero.org/ edgy main
deb-src http://ubuntu.tolero.org/ edgy main
Or that lines if you’re running dapper (simply mepis 6.0):
deb http://ubuntu.tolero.org/ dapper main
deb-src http://ubuntu.tolero.org/ dapper main
The installation is better to do from the console package manager, rather then from the graphical one. Ensure that you have also ubuntu universe repository included to the sources.list. If so, cross your fingers and pass one by one to the console the next commands:
- sudo aptitude update
- sudo aptitude install kqemu-common kqemu-source
- sudo aptitude install module-assistant
- sudo m-a prepare
- sudo m-a build kqemu
- sudo m-a install kqemu
- sudo aptitude install qemu
The commands from 4 to 6 will install a kernel headers, compiller and other assistant packages, will build a kqemu-modules package for your kernel version package and install it. If all ok - the all is done.
Michael Moore:
Awesome! It all installed correctly.
Two questions:
1) Why not combine steps 2 & 3 — both are just install operations
2) The light gray text of your code sections is very hard to read against the white background. It’s pretty, but hard to read. Any chance of changing up the CSS a tiny bit so that it’s either light on dark or vice versa?
4 March 2007, 6:04 pmTolero:
Thanx for your comment.
The first point, right now as is just because it will not fit at one line in current blog design.
And for the second point, yes. I am not very happy with the current design. It is just a default one. I am currently collecting opinions, like your’s, about the things to pay attention to when I’ll decide to change it.
4 March 2007, 6:30 pmMr. Pink:
Does your package add udev rule for kqemu? Like this:
6 March 2007, 11:38 amhttp://felipe-alfaro.org/blog/2007/02/08/qemu-kqemu-and-udev/
Tolero:
It creates the /etc/init.d/qemu script which does the same job. The script manually checks for kqemu.ko file, does insmod on it, creates the /dev/kqemu device and sets a+rw permissions.
6 March 2007, 12:43 pmDarrell:
Thanks this worked but it complains about access to /dev/kqemu
after I run qemu -boot d -hda winxp.img -cdrom /dev/cdrom -m 192 -localtime
I get this when I close the qemu
Could not open ‘/dev/kqemu’ - QEMU acceleration layer not activated
but it does boot and install the OS.
Thanks,
Darrell
12 March 2007, 4:33 pmTolero:
@Darrell
Reason 1: kqemu module is not loaded or a device is not created
Solution: execute
Reason 2: kqemu module is not well compiled or installed.
12 March 2007, 6:44 pmCheck: does the next three commands pass without errors?
eia:
I get errors with these commands:
but i tried running apt-get install qemu, and it starts to download, will it not work because of the 3 commands not being successful
28 March 2007, 9:04 amTolero:
@eia
Qemu will work without kqume module but very slooow.
What are the errors when you execute these commands?
Did you executed the command
and what is the result?
28 March 2007, 11:12 ameia:
here’s the error for the 3 commands:
sudo: m: command not found
I Tried this one –> sudo aptitude install module-assistant, it was ok.
28 March 2007, 11:57 pmeia:
Your right, its to slow, how can i install kqemu,
the ff commands were not recognized:
29 March 2007, 9:26 amsudo m-a prepare
sudo m-a build kqemu
sudo m-a install kqemu
Tolero:
@eia
Hmm… That is a quite strange output: “sudo: m: command not found”… Should be at least “sudo: m-a: command not found”. See the difference? It is just in m and m-a. Check, that you have no space between m and -a. You can also try to use module-assistant instead m-a, so the commands will be:
29 March 2007, 9:46 ameia:
I run the this command:
sudo aptitude install module-assistant
I receive these:
Reading package lists… Done
29 March 2007, 11:17 amBuilding dependency tree
Reading state information… Done
Reading extended state information
Initializing package states… Done
Building tag database… Done
No candidate version found for module-assistant
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information… Done
Tolero:
@eia
Aha! Module assistant is at the universe repository. Check that it is included in /etc/apt/sources.list. I’ve pointed that at the instruction, but not concentrated an attention on it.
29 March 2007, 11:31 ameia:
im sorry for that , i guessed didn’t notice the errors, the ‘update’ was never complete…
but again, i received these:
sudo aptitude install kqemu
29 March 2007, 11:44 amReading package lists… Done
Building dependency tree
Reading state information… Done
Reading extended state information
Initializing package states… Done
Building tag database… Done
Couldn’t find package “kqemu”. However, the following
packages contain “kqemu” in their name:
kqemu-common kqemu-source
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
eia:
I RECEIVED THESE
qemu -cdrom /dev/cdrom -hda c.img -m 256 -boot d
———————- DirectFB v0.9.24 ———————
(c) 2000-2002 convergence integrated media GmbH
(c) 2002-2004 convergence GmbH
———————————————————–
(*) DirectFB/Core: Single Application Core. (2006-10-13 15:40)
29 March 2007, 12:05 pm(*) Direct/Memcpy: Using MMXEXT optimized memcpy()
(!) Direct/Util: opening ‘/dev/fb0′ failed
–> No such device
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use ‘fbdev’ option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize ’system’ core!
–> Initialization error!
Could not initialize SDL - exiting
Tolero:
No, not sudo aptitude install kqemu. Just execute lines 3, 4, 5, 6 from the instruction. If got no errors, the simpliest is to reboot the machine.
After reboot check that file /dev/kqemu exists. That means that all is done properly.
Just for the note: there is no kqemu package, it is compiled from kqemu-sorce package. And you have always to build it if a new (or updated) linux kernell installed.
29 March 2007, 12:16 pmTolero:
Are you trying to run qemu from a text console or on the server?
If you’re on a server, you have to work through an serial port emulation (but no graphics will be), or you have to forward a video output through vnc session. I’m not familar with bot of them, and can’t help there.
If you’re running qemu from a text console, just install a libdirectfb-0.9-24 package, and probably reboot to get a /dev/fb0 device.
29 March 2007, 12:27 pmeia:
apt-get install libdirectfb-0.9-24
Reading package lists… Done
Building dependency tree
Reading state information… Done
libdirectfb-0.9-24 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 156 not upgraded.
after these i received this error again :
qemu -cdrom /dev/cdrom -hda c.img -m 256 -boot d
———————- DirectFB v0.9.24 ———————
(c) 2000-2002 convergence integrated media GmbH
(c) 2002-2004 convergence GmbH
———————————————————–
(*) DirectFB/Core: Single Application Core. (2006-10-13 15:40)
30 March 2007, 1:23 am(*) Direct/Memcpy: Using MMXEXT optimized memcpy()
(!) Direct/Util: opening ‘/dev/fb0′ failed
–> No such device
(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use ‘fbdev’ option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize ’system’ core!
–> Initialization error!
Could not initialize SDL - exiting
Tolero:
@eia
30 March 2007, 6:40 amSorry, that is out of my knowledge
eia:
how can i remove qemu + kqemu, i want to redo all the steps. ARe there other ways to install? I really need to run WIndows XP inside qemu.
Thanks
2 April 2007, 3:37 amTolero:
@eia:
At first get a list of all related packages:
And purge them all with dpkg. In my case that is:
2 April 2007, 7:31 amnagercoin:
When I try to install module-assistant, the aptitude says that’s not a candidate to be installed
5 April 2007, 1:17 pmTolero:
@nagercoin:
5 April 2007, 8:44 pmProbably you’re also missed reqirenment for a ubuntu universe repository to be included.
zythos:
Everything compiled with no errors and I’ve rebooted my machine, but there is no kqemu script in /etc/init.d/ and after reboot no /dev/kqemu
10 April 2007, 1:13 amThe module is there, but no device
Tim:
i have a /dev/kqemu file. now i want to start kqemu. how do i do this? do i need to start it from the command line with options? or can i somehow start a gui that will let me setup the virtualization?
10 April 2007, 5:18 amTolero:
@zythos:
At the /etc/init.d/ should be qemu script, which will change the flags at the linux kernel and init the kqemu module. Also check the output of the command:
Is the init script listed there? If not, you’ve installed something not from my repository.
10 April 2007, 7:08 amTolero:
@Tim:
10 April 2007, 7:18 amQemu itself doesn’t provide a graphical interface. You can try external launchers for it from the qemu-launcher or qemuctl packages. They can help much to start using qemu quickly.
greywinters:
Everything went swimmingly - I am about to try it out. But I got the following warning when I ran “sudo aptitude install kqemu-common kqemu-source”:
WARNING: untrusted versions of the following packages will be installed!
Untrusted packages could compromise your system’s security.
You should only proceed with the installation if you are certain that
this is what you want to do.
kqemu-common kqemu-source
Do you want to ignore this warning and proceed anyway?
To continue, enter “Yes”; to abort, enter “No”: yes
I got a similar warning when I tried to install qemu.
Otherwise, this page is awesome! Thanks!
12 April 2007, 1:29 pmTolero:
@greywinters:
12 April 2007, 6:32 pmQuite pertinent note from the aptitude. I don’t make a promise that these packages are fully faultless. But I glad that much of users have had to setup qemu from my repository well.
Steve:
thanks for this great tutorial, works fine! tried to install a qemu-ed windows XP without your kqemu-tutorial and it lagged like hell, now it’s nice and smooth - great work!
16 April 2007, 10:44 amSuzyQ:
I get this error when i use the m-a prepare command please help!
m-a prepare
Getting source for kernel version: 2.6.17-11-generic
Kernel headers available in /lib/modules/2.6.17-11-generic/build
apt-get install build-essential
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential: Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:4.1.1) but it is not going to be installed
E: Broken packages
Done!
17 April 2007, 5:02 amSuzyQ:
get a failure on this command too m-a build kqemu
and
m-a install kqemu
but this probable because the prepare command didn’t work
sorry im sort of a noob
17 April 2007, 5:08 amI have been running Ubuntu Edgy for about 5 months.
Tolero:
@SuzyQ
17 April 2007, 7:07 amLooks like you have no main repository listed in the /etc/apt/sources.list
SuzyQ:
How do I put a main repository in /etc/apt/sources.list? I know how to add a repository in synaptic package manager…… Hey at least I’m learning!
17 April 2007, 1:35 pmTolero:
@SuzyQ
17 April 2007, 4:47 pmIt is quite the same. Check for the main repository at the synaptic.
Lurchgs:
I, too, am experiencing SuzyQ’s problem. The ’sudo m-a prepare’ went off without a hitch (or so it said). ’sudo m-a build kqemu’ blows up. The build file is pretty useless (just the start time).
The command line has the following:
I’m in /tmp with kqemu-1.3.0pre11.tar
Trying m-a get. gets me:
I have your repository in apt sources list:
did I miss something?
4 May 2007, 5:48 amLurchgs:
For the life of me, I have no idea what’s different. I got frustrated with trying to install and get kqemu last night [again!]. This morning, I came downstairs and (because I can be lazy) used the history on my Ubuntu 6 machine to try again… and it went off without a hitch.
6 May 2007, 4:31 pmBarry:
Everything installed smoothly, but when I put in:
qemu -boot c -hda winxp.img -m 512 -localtime
I get this:
‘/dev/kqemu’ - QEMU acceleration layer not activated
I’ve read the above replies, and for the life of me I can’t seem to get this working. I’m a newb for linux, and step by step instructions on what to do to get kqemu working would be greatly appreciated! Thanks!
28 May 2007, 12:36 amLarsR:
Barry, check out the bug described in
/dev/kqemu is not created by udev
https://bugs.launchpad.net/ubuntu/+source/kqemu/+bug/105933
It solved it for me…
I did
echo ‘KERNEL==”kqemu”, NAME=”%k”, MODE=”0666″‘ >> /etc/udev/rules.d/90-kqemu.rules
mv /etc/modprobe.d/kqemu /etc/modprobe.d/disabled-kqemu
3 September 2007, 6:06 pmDaniel:
You may need to sudo qemu -boot c ……….. if kqemu doesn’t have the correct permissions set up .
have a look at this
https://help.ubuntu.com/community/WindowsXPUnderQemuHowTo
hope it helps
10 September 2007, 3:33 pmRafa:
Would you be so kind as to include a Feisty repository for qemu? Thanks in advance
11 September 2007, 6:24 am