-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqemu-kvm-command-line.txt
39 lines (31 loc) · 9.22 KB
/
qemu-kvm-command-line.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
==================================qemu-kvm-command-line==================================
- for rhel5:
# /usr/libexec/qemu-kvm -no-hpet -no-kvm-pit-reinjection -usbdevice tablet -rtc-td-hack -startdate 2011-12-28T02:12:24 -name test -smp 1,cores=1 -k en-us -m 512 -boot dcn -net nic,vlan=1,macaddr=00:1a:4a:42:0b:00,model=virtio -net tap,vlan=1,ifname=virtio_10_1,script=no -drive file=/rhev/data-center/guest-image,media=disk,if=virtio,cache=off,serial=7b-8a18-438e1f274bd2,boot=on,format=raw,werror=stop -drive file=/rhev/data-center/guest-image.iso,media=cdrom,index=2,if=ide -fda /rhev/data-center/floppy/virtio-drivers-1.0.3-52454.vfd -pidfile /var/vdsm/4ddb3e48-0073-497e-974b-0327784aa09d.pid -soundhw ac97 -spice sslpassword=,sslciphersuite=DEFAULT,sslcert=/var/vdsm/ts/certs/vdsmcert.pem,sslkey=/var/vdsm/ts/keys/vdsmkey.pem,ssldhfile=/var/vdsm/ts/keys/dh.pem,sslcafile=/var/vdsm/ts/certs/cacert.pem,host=0,secure-channels=main+inputs,ic=on,sport=5890,port=5910 -qxl 1 -cpu qemu64,+sse2,+cx16,+ssse3 -M rhel5.5.0 -notify all -balloon none -smbios type=1,manufacturer=Red Hat,product=RHEL,version=5Server-5.8.0.1,serial=44454C4C-5700-1058-804B-B7 C04 F483258_00:21:9b:58:d2:90,uuid=4ddb3e48-0073-497e-974b-0327784aa09d -vmchannel di:0200,unix:/var/vdsm/4ddb3e48-0073-497e-974b-0327784aa09d.guest.socket,server -monitor unix:/var/vdsm/4ddb3e48-0073-497e-974b-0327784aa09d.monitor.socket,server
1).defines disk image(two interfaces and two types)
-drive file=/guest-image,media=disk,if=ide,cache=off,serial=7b-8a18-438e,boot=on,format=raw,werror=stop
-drive file=/guest-image,media=disk,if=virtio,cache=off,serial=7b-8a18-438e,boot=on,format=qcow2,werror=stop
2).define floppy with -fda or -fdb,it can help load driver when use virtio drive for windows guest. 3).define nic types(three types)
-net nic,vlan=1,macaddr=00:1a:4a:42:0b:00,model=virtio
-net nic,vlan=1,macaddr=00:1a:4a:42:0b:00,model=e1000
-net nic,vlan=1,macaddr=00:1a:4a:42:0b:00,model=rtl8139
4). define connection guest option
-vnc display[,option[,option[,...]]], for example -vnc :1
-spice sslpassword=,sslciphersuite=DEFAULT,sslcert=/var/vdsm/ts/certs/vdsmcert.pem,sslkey=/var/vdsm/ts/keys/vdsmkey.pem,ssldhfile=/var/vdsm/ts/keys/dh.pem,sslcafile=/var/vdsm/ts/certs/cacert.pem,host=0,secure-channels=main+inputs,ic=on,sport=5890,port=5910 -qxl 1
NOTE: Above description just lists important options. More QEMU user manual,please refer to http://wiki.qemu.org/download/qemu-doc.html or execute command “man qemu-kvm” in OS.
- for rhel6.3:
# /usr/libexec/qemu-kvm -S -M rhel6.3.0 -cpu Opteron_G3 -enable-kvm -m 512 -smp 1,sockets=1,cores=1,threads=1 -name vm1 -uuid 6afa5f93-2d4f-420f-81c6-e5fdddbd1c83 -smbios type=1,manufacturer=Red Hat,product=RHEV Hypervisor,version=6Server-6.3.0.2.el6,serial=CDBA54DE-AD75-DE11-BBD8-217AC8510024_00:24:21:7A:C8:51,uuid=6afa5f93-2d4f-420f-81c6-e5fdddbd1c83 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=2012-05-23T10:23:08,driftfix=slew -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw,serial= -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/rhev/data-center/guest-image,if=none,id=drive-virtio-disk0,format=raw,serial=40c061dd-5d60-4fc5-865f-55db700407f0,cache=none,werror=stop,rerror=stop,aio=threads -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=27 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:0a:00,bus=pci.0,addr=0x3,bootindex=1 -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channels/vm1.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -chardev pty,id=charconsole0 -device virtconsole,chardev=charconsole0,id=console0 -device usb-tablet,id=input0 -vnc 0:0,password -k en-us -vga qxl -global qxl-vga.vram_size=67108864bsp
1).defines disk image(two interfaces and two types)
-drive file=/rhev/data-center/guest-image,format=qcow2..., -device virtio-blk-pci,....
-drive file=/rhev/data-center/guest-image,format=raw..., -device ide-drive,....
-drive file=/rhev/data-center/guest-image,format=raw..., -device virtio-scsi-pci,....(only for rhel6.3)
2).define nic types(three types)
-netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=31 -device virtio-net-pci
-netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=31 -device e1000
-netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=31 -device rtl8139
3). define connection guest option
-vnc :display
-spice port=5932,tls-port=5933,addr=0,x509-dir=/etc/pki/vdsm/libvirt-spice,tls-channel=main,tls-channel=inputs -k en-us -vga qxl -global qxl-vga.vram_size=67108864
NOTE: Above description just lists important options. More QEMU user manual,please refer to http://wiki.qemu.org/download/qemu-doc.html or execute command “man qemu-kvm” in OS.
eg: /usr/libexec/qemu-kvm -M rhel6.4.0 -cpu SandyBridge -enable-kvm -m 4096 -smp 4,sockets=2,cores=2,threads=1,maxcpus=6 -usb -device usb-tablet,id=input0 -name sluo_migration -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 -drive file=/dev/vg-90.100-sluo/lv-90.100-migration-macvtap,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,fd=3 3<>/dev/tap3 -device virtio-net-pci,__com_redhat_macvtap_compat=on,netdev=hostnet0,id=virtio-net-pci0,mac=08:2E:5F:0A:0D:B1,bus=pci.0,addr=0x5 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -spice port=5931,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.vram_size=67108864 -device intel-hda,id=sound0,bus=pci.0,addr=0x6 -device hda-duplex -device usb-ehci,id=ehci,addr=0x7 -device usb-storage,drive=drive-usb-0-0,id=usb-0-0,removable=on,bus=ehci.0,port=1 -drive file=/dev/vg-90.100-sluo/lv-90.100-test-image,if=none,id=drive-usb-0-0,media=disk,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=ehci.0,debug=3 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -drive file=/dev/vg-90.100-sluo/lv-90.100-data-disk,if=none,id=data-disk,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x9,drive=data-disk,id=sluo-disk -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -drive file=/mnt/RHEL6.3-20120613.2-Server-x86_64-DVD1.iso,if=none,media=cdrom,format=raw,id=drive-ide1-0-1 -device ide-drive,drive=drive-ide1-0-1,id=ide1-0-1,bus=ide.1,unit=1 -drive file=/mnt/floppy.vfd,if=none,id=drive-fdc0-0-0,format=raw -global isa-fdc.driveA=drive-fdc0-0-0 -nodefaults -serial unix:/tmp/ttyS0,server,nowait -qmp tcp:0:4444,server,nowait -boot menu=on -monitor stdio -incoming tcp:0:5888,server,nowait
# /usr/libexec/qemu-kvm -M rhel6.4.0 -cpu host -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -usb -device usb-tablet,id=input0 -name data-plane -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port2 -drive file=/home/windows_7_ultimate_sp1_x64.raw,if=none,id=drive-virtio-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x4,scsi=off,x-data-plane=on,drive=drive-virtio-disk,id=virtio-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,id=virtio-net-pci0,mac=BC:96:9D:05:51:EC,bus=pci.0,addr=0x5 -balloon none -spice port=5931,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864 -boot menu=on -monitor stdio -drive file=/dev/vg-qz/sluo-data-disk,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x6,scsi=off,x-data-plane=on,drive=drive-data-disk,id=data-disk -drive file=/home/en_windows_7_ultimate_with_sp1_x64_dvd_618240.iso,if=none,media=cdrom,format=raw,id=drive-ide0-0-0 -device ide-drive,drive=drive-ide0-0-0,id=ide0-0-0,bus=ide.0,unit=0,bootindex=0 -drive file=/usr/share/virtio-win/virtio-win-1.5.4.iso,if=none,media=cdrom,format=raw,id=drive-ide1-0-1 -device ide-drive,drive=drive-ide1-0-1,id=ide1-0-1,bus=ide.1,unit=1 -drive file=/usr/share/virtio-win/virtio-win-1.5.4.vfd,if=none,id=drive-fdc0-0-0,readonly=on,format=raw -global isa-fdc.driveA=drive-fdc0-0-0
...-kernel /home/vmlinuz -initrd /home/initrd.img -append method=http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL6.4-20121212.1/6.4/Server/x86_64/os