[[kvm]]
 

KVM

References

[HOWTO] kvm with vde instead of bridging
http://forums.gentoo.org/viewtopic-t-760751.html?sid=518518c59c7bd5933e3bc301ad2fda43
http://forums.gentoo.org/viewtopic-p-5467295-highlight-vlan0.html#5467295

Gentoo QEMU/KVM ethernet bridging nano HOWTO 
http://wangbj.blogspot.com/2009/02/gentoo-qemukvm-ethernet-bridging-nano.html

Bridge
http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge

Gentoo KVM wiki
http://en.gentoo-wiki.com/wiki/KVM

libvirt
http://libvirt.org/drvqemu.html

VDE

Create switch

# /etc/vde2/vde_switch.rc

vlan/create 1 
vlan/addport 1 1 
port/create 2 
port/allocatable 2 1 
port/create 3 
port/allocatable 3 1 
port/create 4 
port/allocatable 4 1 
port/setvlan 4 1 
port/create 5 
port/allocatable 5 1 
port/setvlan 5 1 

Add management to vde

# /etc/init.d/vde

... 
start() { 
        ebegin "Starting vde" 
        [ "${VDE_MODPROBE_TUN}" == "yes" ] && modprobe tun 
        start-stop-daemon --start --quiet \ 
                --exec /usr/bin/vde_switch -- -tap ${VDE_TAP} -daemon \ 
                -mgmt /var/run/vde.ctl/ctl.mgmt 
        eend $? "Failed to start vde" 
        chmod -R ${VDE_SOCK_CHMOD} /var/run/vde.ctl 
        chown -R ${VDE_SOCK_CHOWN} /var/run/vde.ctl 
} 
... 

Check vde management

# unixterm /var/run/vde.ctl/ctl.mgmt

VDE switch V.2.2.2 
(C) Virtual Square Team (coord. R. Davoli) 2005,2006,2007 - GPLv2 

vde$ vlan/allprint 
0000 DATA END WITH '.' 
VLAN 0000 
 -- Port 0001 tagged=0 active=1 status=Forwarding 
 -- Port 0002 tagged=0 active=0 status=Learning 
 -- Port 0003 tagged=0 active=0 status=Learning 
VLAN 0001 
 -- Port 0001 tagged=1 active=1 status=Forwarding 
 -- Port 0004 tagged=0 active=0 status=Learning 
 -- Port 0005 tagged=0 active=0 status=Learning 
. 
1000 Success 

vde$ logout 

Working Notes


qemu-img create -f raw gentoo-i386.img 10G

ifconfig tap0 10.1.1.1 broadcast 10.1.1.255 netmask 255.255.255.0 
ifconfig tap0 up 

//does pick up the tap0 interface after being started
/etc/init.d/dhcpd restart

qemu-kvm -name base -daemonize -vnc 192.168.99.5:1 -monitor unix:/var/run/kvm/base.sock,server,nowait -m 1024 -localtime -hda /usr/local/vmware/gentoo-i386.img -cdrom /usr/local/samba/iso/install-amd64-minimal-20090813.iso -boot d -net vde,vlan=0 -net nic,vlan=0,macaddr=52:54:00:00:EE:03


qemu-kvm -name test -smp 2 -m 1024 -localtime -hda /usr/local/vmware/gentoo-i386.img -cdrom /usr/local/samba/iso/install-amd64-minimal-20090813.iso -boot d -net vde,vlan=0 -net nic,vlan=0,macaddr=52:54:00:00:EE:03


//wsus
qemu-kvm -name test -smp 2 -m 1024 -localtime -hda /usr/local/vmware/WSUS/WIN2K3R2-flat.vmdk -hdb /usr/local/vmware/WSUS/WIN2K3R2-0-flat.vmdk -hdc /usr/local/vmware/WSUS/WIN2K3R2-1-flat.vmdk -boot c -net vde,vlan=0 -net nic,vlan=0,macaddr=00:0c:29:86:94:f4 -uuid 564d934f-2783-e60a-97b1-089af88694f4

//printer
qemu-kvm -name test -smp 2 -m 1024 -localtime -hda /usr/local/vmware/XPSP3_Printer/XPSP3_Printer.vmdk  -boot c -net vde,vlan=0 -net nic,vlan=0,macaddr=00:0c:29:86:94:f4 -uuid 564d2fcb-b8d5-ad17-a9de-77d16bacf48e

//lachlan
qemu -enable-kvm -drive file=/dev/sdb,if=ide,media=disk,format=host_device,cache=none -name 'win 7' -m 2000M -smp 2 -vga std -localtime -net nic,macaddr=00:50:56:12:34:56 -net tap,vlan=0,ifname=tap0,script=/etc/qemu/qemu-ifup


random mac address:
echo $(echo -n DE:AD:BE:EF ; for i in `seq 1 2` ; do echo -n `echo ":$RANDOM$RANDOM" | cut -n -c -3` ;done)


qemu-kvm -name WSUSR2 -m 1536 -smp 2 -vga std -localtime -hda /usr/local/vmware/WSUSR2/WSUSR2_0_flat.img -cdrom /usr/local/samba/iso/WIN2003R2/64BIT_X64/standard/DISC1_VLP/EN_WINDOWS_SERVER_2003_R2_STANDARD_DISC1_x64_VLP.iso -boot d -net vde,vlan=0 -net nic,vlan=0,macaddr=DE:AD:BE:EF:25:56 -uuid df88f770-3b1d-11df-9879-0800200c9a66

Control the virtual machine

Ctrl-Alt-2 Console
Ctrl-Alt-1 Return to virtual

sendkey ctrl-alt-delete


find out your device names:
info block

depending on the name of the cdrom:
eject ide1-cd0
change ide1-cd0 isofilename.iso
or
eject cdrom
change cdrom isofilename.iso

OLD

example start

/usr/local/kvm/bin/qemu-system-x86_64 -hda /usr/local/vmware/qemutest/winxpprosp2-flat.vmdk -boot c -m 512 -vnc localhost:1 -net nic,model=rtl8139 -no-kvm
/usr/local/kvm/bin/qemu-system-x86_64 -hda /usr/local/vmware/vdisk.img -boot c -cdrom /home/paul/downloads/ubuntu-7.04-server-amd64.iso -m 512 -vnc localhost:1 -net nic,model=rtl8139 -no-kvm

kvm-33.tar.gz

tar xzf kvm-release.tar.gz 
cd kvm-release 
./configure --prefix=/usr/local/kvm 
make 
make install 

Qemulator-0.5.tar.gz

http://qemulator.createweb.de/index.php4?modname=Downloads

tar xzf Qemulator-0.5.tar.gz
cd Qemulator-0.5
./setup.py
kvm.txt · Last modified: 2011/08/03 23:18 by paulsmith
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki