So I wanted this also on Debian.
I have to say it took me some time to get it done. But in the end it seemed a ./configure misconfigure.
NOTICE that your hardware should support the vanderpool extensions (intel; dont know for amd).
Check this by doing:
cat /proc/cpuinfo | grep vmx
And also be sure that it is enabled in your BIOS!
DO CORRECT all values according to your kernel version etc.
We need kvm and kqemu(kvm enables the virtualization of your hardware).
First we need the kernel sources:
- search the correct package name with:
apt-cache search linux-sourceThen, in the results I see the exact package name. Install:
apt-get install linux-source-2.6.22We also need the sources for kqemu:
apt-cache search kqemuInstall:
apt-get install kqemu-common kqemu-source kvmDespite what is on the qemu website, I've found that the kqemu accelerator does not compile if you have not at least compiled a kernel in the kernel source directory.
Compiling it is enough, you dont need to install it.
tar xjf kernel-source-*.bz2
ln -s kernel-source-* linux
cp /boot/config-2.6.22-2 /usr/src/linux/.config
cd /usr/src/linux && make oldconfig && make bzImage
Now we can configure, compile and install kqemu (dont use the symlink "linux" because it points to the kernel headers):
NOTE: In later versions --kernel-path is changed to --kernel-dir
If you don't specify the kernel path you will get this while compiling (make):
Do this to clean and start the correct way to solve this:ld -r -o ../kqemu-mod-x86_64.o kernel.o x86_64/kernel_asm.omake: Leaving directory `/usr/src/modules/kqemu/common'make -C /lib/modules/2.6.22-2-amd64/build M=`pwd` modulesmake: Entering directory `/usr/src/linux-headers-2.6.22-2-amd64'Makefile:275: /usr/src/linux-headers-2.6.22-2-amd64/scripts/Kbuild.include: No such file or directorymake: *** No rule to make target `/usr/src/linux-headers-2.6.22-2-amd64/scripts/Kbuild.include'. Stop.make: Leaving directory `/usr/src/linux-headers-2.6.22-2-amd64'make: *** [kqemu.ko] Error 2
make cleanCompile and install:
make install # as root user
Now you should be able to load the module:
modprobe kqemuAlso load kvm for your CPU:
modprobe kvm-intel # for Intel CPUsYou will need this:
modprobe kvm-amd # for AMD CPUs
apt-get install libsdl1.2-devDo this for auto loading the necessary modules:
cat >> /etc/modules
NOTE ^D is CTRL-D
Let's create our virtual disk(a dedicated disk will provide far better performance; also be sure you have alot of memory):
qemu-img create disk.img 10G
Start the Virtual Machine:
qemu-system-x86_64 -m 384 disk.img -cdrom cdimg.img -localtime
-m tells qemu how much memory should be reserved for the VM.
-cdrom determines what your cdrom drive is in the virtual machine.
You could also use /dev/cdrom here but sometimes this gives some problems.
-localtime gives the time on your hostmachine as the time for your VM.
I will later talk about howto setup networking for your virtual machine.