|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Welcome Articles Articles Front Page ... Computing (10) Em português (1) Philosophy (4) Um teclado mais eficiente Installing KQEMU in Ubuntu Running QEmu with the KQemu accelerator in Ubuntu Linux E-mail (MIME) parser in NandoF library Culture industry reconsidered The culture industry: enlightenment as mass deception (part 1 of 2) Modest log of the spectacular domination Nunca mais reinstale o Windows Duke Nukem 3d for Windows! Duke Nukem 3d para Windows!Backend Using RSS aggregator software, you can read news from many sites without needing to visit them all. Here is our feed for your RSS reader: You may also use this text feed. Stop software patents! Search Nando Florestan Google ads |
by nando on Tuesday 10 January 2006 [DEPRECATED.] Run another operating system on top of Ubuntu This tutorial is now DEPRECATED; please use the automated installation script instead. Ubuntu Linux 5 (Hoary Hedgehog) is a Debian-based distribution. It already has QEMU in the repositories, so you can install QEMU just by typing sudo apt-get install qemu QEMU allows you to run other operating systems (such as DOS, Windows or other Linux distros) in a window. However, QEMU will run the guest operating system about 10 times slower than if it were running natively. This is normal when QEMU is not compiled with the KQEMU accelerator. KQEMU, a proprietary "plug-in" for QEMU, allows the guest operating system to run faster -- just about half its native speed. This is only possible if you are emulating an i386 on an i386. The extension was developed by QEMU author, who says: "As a supporter of open source, the author accepts to open source the QEMU Accelerator Technology provided a company invests enough money to support the project and to recompense the author from the potential loss of revenue. Interested companies can look at the roadmap and make suggestions to the author." (This is at http://fabrice.bellard.free.fr/qemu/qemu-accel.html ) This tutorial will show how to install KQEMU on Ubuntu Hoary. UPDATE: Here is a newer tutorial, you may want to follow this too: http://www.hants.lug.org.uk/cgi-bin/wiki.pl?LinuxHints/QemuCompilation COMPILATION First of all, in a console window, become root by typing... sudo -s ...and providing your password. This is because the following steps require administrator privileges. If the QEMU version provided by ubuntu has been installed, remove it by running the command: apt-get remove qemu Now browse to... http://fabrice.bellard.free.fr/qemu/download.html ...and download 2 files: 1) QEMU source code 2) QEMU Accelerator Module First you must decompress the QEMU sources: tar zxvf qemu-0.7.0.tar.gz cd qemu-x.y.z Uncompress the accelerator into a subdirectory: tar zxvf kqemu-0.6.2-1.tar.gz Now run the "configure" script: ./configure Here we see our first problem: "Could not find kernel includes in /lib/modules or /usr/src/linux - cannot build the kqemu module" To solve this, start the Synaptic package manager and search for packages called "linux-headers". Several packages start with this name. Install the one that corresponds to your processor and your kernel version. But how do you know what your kernel is? uname -a Linux MYHOST 2.6.10-2-386 #1 Fri Feb 4 09:44:19 UTC 2005 i686 GNU/Linux If your Celeron, Pentium III or IV is running on a 386 kernel, consider installing a 686 kernel, they say it is faster. Still in Synaptic, choose the package you have just installed, click Properties and go to the "Installed Files" tab. Write down the directory where the files were copied. In my case, they were copied to: /usr/src/linux-headers-2.6.10-5-686/ If you run ./configure again, you still get the same error message as before. The script is looking at the wrong folder. Let us teach the script better. Type something like this to open the script in a text editor: kwrite configure In the text editor, search for "/usr/src/linux". I ended up in line 375. Just replace the directory name and save the file: if test '!' -d "$kernel_path/include" ; then kernel_path="/usr/src/linux-headers-2.6.10-5-686" if test '!' -d "$kernel_path/include" ; then echo "Could not find kernel includes in /lib/modules or /usr/src/linux - cannot build the kqemu module" kqemu="no" fi fi Now run the modified ./configure and the error must be gone. The next problem is sound support. For me the configure script said, among other things: SDL support no To solve this you need to open Synaptic again and install libsdl1.2-dev. This package contains the files needed to compile and link programs which use the famous SDL sound library. Run ./configure again and it will say: SDL support yes So now we compile QEMU by typing: make This did NOT work in my system. The GCC compiler complained with many errors like this: block-qcow.c:26:18: zlib.h: No such file or directory block-qcow.c: In function `decompress_buffer': block-qcow.c:407: error: `z_stream' undeclared (first use in this function) Hmm, it says it did not find zlib. So what do we do? We go back to Synaptic, search for "zlib" and install the development package called zlib1g-dev: zlib1g-dev - compression library - development zlib is a library implementing the deflate compression method found in gzip and PKZIP. This package includes the development support files. Hopefully this time if you type "make" you will have to wait a few minutes while all that rubbish scrolls in your console window as GCC compiles QEMU... Warnings are fine, it is errors that you can't have. Now that the beast is compiled, we issue a command to install it in the system: make install If you want to see the files appearing, open a Konqueror window and go to the /usr/local/bin directory before issuing that command. QEMU would now work, but there is one last step to enable its Accelerator module. If you actually run QEMU right now, if you check the console, you will see this message: "Could not open '/dev/kqemu' - QEMU acceleration layer not activated" So the last step is to load the kqemu kernel module: modprobe kqemu What if this command does not work, saying this? FATAL: Error inserting kqemu (/lib/modules/2.6.10-2-386/misc/kqemu.ko): Invalid module format This means you did something wrong when compiling. For instance, the headers used during compilation are for a different kernel than the one you are actually using. You can run a "make clean" to wipe the compiled files and restart from the "./configure" step, doing something different this time. USING KQEMU OK, let us have some fun! To see qemu help you just call it, or its manual page: qemu man qemu man qemu-img To create a large file to serve as a hard drive image you can use qemu-img: qemu-img create harddrive.img 2G The "2G" above means the file will be 2 gigabytes long. The -cdrom parameter accepts a cd-rom image too. If we had just downloaded ubuntu we could install it with this command: qemu -hda harddrive.img -cdrom ubuntu.iso -boot d -m 192 The -m switch specifies the amount of RAM. It is recommended that you give to QEMU half of your memory. "-boot d" means boot from the cd-rom. On the other hand, if you have already burned a CD, put it in the drive, mount it, and then use the device in /dev/: qemu -hda harddrive.img -cdrom /dev/cdrom -boot d -m 192 Usage of qemu is beyond the scope of this article, but you can also use the floppy drives, access real hard disks (use backups and caution!) and access your files via samba in the guest OS! First, you need to have a working samba installation. Then start qemu with: qemu [hd_image] -enable-audio -user-net -smb [shared directory] -m [megabytes] "-user-net" creates a little firewalled network for the guest OS. Have fun. Be sure to try out FreeDOS (and run some games in it): http://freedos.org Also try out ReactOS, a free Windows NT clone: http://www.reactos.org For running DOS games you can try DOSBox instead of QEMU: http://dosbox.sourceforge.net/ AFTER REBOOTING After rebooting, QEMU will work, but the accelerator will not. If you want the KQEMU kernel module to be installed automatically at boot time, you need to edit a boot time script such as /etc/init.d/bootmisc.sh (for Debian systems) or /etc/rc.d/rc.local: 1) add this line to the boot script: /sbin/modprobe kqemu 2) If your distribution uses udev (like Ubuntu and Fedora), '/dev/kqemu' is not created automatically (yet) at every reboot. You can add the following to a boot script: mknod /dev/kqemu c 250 0 # Create the KQEMU device chmod 666 /dev/kqemu # Make it accessible to all users That is all. ![]() Rating This article has been rated: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 10.0 - 1 voteComments ...
You must be logged in to post comments on this site - please either log in or if you are not registered click here to signup
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||