User Tools

Site Tools



pxe-booting kvm virtualmachines

Newer kvm has pxe-support build in. Just use '-boot n' as kvm parameter when starting the vm. There is also a bootmenu reachable with 'F12'. Older kvm-versions need floppies from rom-o-matic to be booted, i.e. the one for rtl8139 nics works for me.

Note: in my setup here one vm can supply another vm with an ip via dhcp, but tftp-get doesnt seem to work. I supply tftp-services from my host to the vms, this works.

mac os x running on kvm

  • - Alexander created the patches to provide the kvm-environment macosx expects
  • - dmg2img converts dmg-files to images that can be run by kvm
  • what runs: macosx, network, installing/running software etc.
  • what doesnt work: 3d, sound
compiling on debian amd64
  • better use the complete howto from the link above
mkdir -p /mnt/store/kvm/images_mac/
cd /mnt/store/kvm/images_mac/
mkdir kvm-src
cd kvm-src
rpm2cpio ../kvm-*.src.rpm | cpio -id
tar xvvjf kvm-*.tar.bz2
cp kvm.spec kvm_nosuse.spec
cat kvm.spec | sed '/Name:/ i\
%define suse_version 1100
'| sed 's/%suse_kernel_module_package/#%suse_kernel_module_package/' > kvm_nosuse.spec
quilt -v setup kvm_nosuse.spec
cd kvm-*/
cp -a bios bios-mac
quilt push -a -v
./configure --prefix=/mnt/store/kvm/images_mac/kvm_installed_kvm-84-7.2 \
  --audio-drv-list="oss alsa sdl" --audio-card-list="ac97 es1370 sb16 cs4231a adlib gus"
make -j4

cd bios-mac/
cd ..
sudo make install
sudo modprobe kvm_intel
sudo cp bios-mac/BIOS-bochs-latest /mnt/store/kvm/images_mac/kvm_installed_kvm-84-7.2/share/qemu-kvm/bios-mac.bin
wget -O /mnt/store/kvm/images_mac/kvm-osx-bootloader


  • qemu_add_tap_to_kvm0
set -x
# switch=br0
if [ -n "$1" ];then
        /sbin/ifconfig $1 >&/dev/null || /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1
        /usr/bin/sudo /sbin/ip link set $1 up
        sleep 0.5s
        /usr/bin/sudo /usr/sbin/brctl addif $switch $1
        ifconfig $1 promisc up
        exit 0
        echo "Error: no interface specified"
        exit 1

brctl addbr $br
ifconfig $br netmask broadcast

#brctl addbr $br
#ifconfig $br netmask broadcast

#brctl addbr $br
#ifconfig $br netmask broadcast
  • starting emulation of a vm:
kvm \
    -hda cmaster.img \
    -cdrom /mnt/store/isos/centos-5.3-x86_64-dvd.iso \
    -boot d \
    -m 512 \
    -k de \
    -name cmaster \
    -net nic,vlan=1,macaddr=de:ad:be:ef:00:06,model=rtl8139 \
    -net tap,vlan=1,ifname=tap0,script=/mnt/store/kvm/qemu_add_tap_to_kvm0
#    -fda /mnt/store/kvm/kvm-pxe/usr/share/kvm/pxe-rtl8139.bin \
software/virtualization/kvm.txt ยท Last modified: 2021/03/23 12:22 (external edit)