win7spiceusb重定向分析_第1页
win7spiceusb重定向分析_第2页
win7spiceusb重定向分析_第3页
win7spiceusb重定向分析_第4页
win7spiceusb重定向分析_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、创建虚机命令:virt-install -virt-type kvm -name win7-13 -vcpus 2 -ram 4096 -cdrom=/home/image/win7.iso -disk /home/image/win7-13.img,device=disk,bus=virtio,size=10,format=qcow2 -network network=default -graphics spice,listen=192.168.131.11 -sound ac97 -video qxl -channel spicevmc -controller type=usb,model

2、=ich9-ehci1 -disk virtio-win-drivers.vfd,device=floppy -os-type=windows -os-variant=win7 -force查看虚机启动的端口号port:5902rootcompute1 qemu# virsh list -all Id 名称 状态- 5 win7-10 running 6 instance-00000085 running 20 win7-13 running - win7-5 关闭rootcompute1 qemu# ps -ef |grep win7-13root 607 46508 0 08:49 pts

3、/0 00:00:00 grep -color=auto win7-13qemu 48622 1 20 10月29 ? 03:00:03 /usr/libexec/qemu-kvm -name win7-13 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu SandyBridge,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff -m 4096 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid fee0c59d-54

4、40-48fa-9845-6dfad64473ee -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/win7-13.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -boot strict

5、=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device

6、virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/home/image/win7-13.img,if=none,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/home/image/virtio-win-drivers.vfd,if=none,id=driv

7、e-fdc0-0-0,format=raw -global isa-fdc.driveA=drive-fdc0-0-0 -drive file=/home/image/win7.iso,if=none,id=drive-ide0-0-0,readonly=on,format=raw -device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:34:da:63,b

8、us=pci.0,addr=0x3 -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 -device usb-tablet,id=input0 -spice port=5902,addr=

9、192.168.131.11,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -global qxl-vga.vgamem_mb=16 -device AC97,id=sound0,bus=pci.0,addr=0x4 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0 -ch

10、ardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1 -chardev spicevmc,id=charredir2,name=usbredir -device usb-redir,chardev=charredir2,id=redir2 -chardev spicevmc,id=charredir3,name=usbredir -device usb-redir,chardev=charredir3,id=redir3 -device virtio-balloon-p

11、ci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=onrootcompute1 qemu# rootcompute1 qemu# cp /etc/libvirt/qemu/win7-13.xml /etc/libvirt/qemu/win7-13.xml.bakrootcompute1 qemu# vi /etc/libvirt/qemu/win7-13.xml.bak删除原来USB内容,添加如下内容 <controller type='usb' index='0' model='ich9-ehci1

12、'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <master startport='0'/> <address type='pci&#

13、39; domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <master startport='2'/> <address type='pci' domain

14、='0x0000' bus='0x00' slot='0x05' function='0x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00'

15、slot='0x05' function='0x2'/> </controller><redirdev bus='usb' type='spicevmc'> </redirdev> <redirdev bus='usb' type='spicevmc'> </redirdev> <redirdev bus='usb' type='spicevmc'> </redirdev> &l

16、t;redirdev bus='usb' type='spicevmc'> </redirdev>rootcompute1 qemu# virsh undefine win7-13rootcompute1 qemu# cp /etc/libvirt/qemu/win7-13.xml.bak /etc/libvirt/qemu/win7-13.xmlrootcompute1 qemu# virsh define /etc/libvirt/qemu/win7-13.xmlrootcompute1 qemu# virsh shutdown win7-

17、13rootcompute1 qemu# virsh start win7-13重启后可以正常看到U盘rootcompute1 qemu# pwd/etc/libvirt/qemurootcompute1 qemu# ll总用量 124-rw- 1 root root 4496 11月 26 12:23 instance-0000009b.xml-rw- 1 root root 4491 11月 26 12:26 instance-0000009d.xml-rw- 1 root root 4493 11月 12 09:57 instance-0000009e.xml-rw- 1 root ro

18、ot 4495 11月 24 14:02 instance-0000009f.xml-rw- 1 root root 4490 11月 12 09:57 instance-000000bb.xml-rw- 1 root root 4495 11月 12 10:42 instance-000000bc.xml-rw- 1 root root 4495 11月 12 14:07 instance-000000bd.xml-rw- 1 root root 4495 11月 12 14:08 instance-000000be.xmldrwx-. 3 root root 40 9月 22 18:18

19、networks-rw- 1 root root 3903 11月 4 15:47 ubuntu14.xml-rw- 1 root root 3931 11月 4 14:56 ubuntudesktop.xml-rw- 1 root root 4148 10月 27 15:22 win7-10.xml-rw- 1 root root 4464 10月 27 14:50 win7-10.xml.bakrootcompute1 qemu# vi win7-13.xml<!-WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE L

20、IKELY TO BEOVERWRITTEN AND LOST. Changes to this xml configuration should be made using: virsh edit win7-13or other application using the libvirt API.-><domain type='kvm'> <name>win7-13</name> <uuid>fee0c59d-5440-48fa-9845-6dfad64473ee</uuid> <memory unit=

21、'KiB'>4194304</memory> <currentMemory unit='KiB'>4194304</currentMemory> <vcpu placement='static'>2</vcpu> <os> <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type> <boot dev='hd'/> </

22、os> <features> <acpi/> <apic/> <pae/> <hyperv> <relaxed state='on'/> <vapic state='on'/> <spinlocks state='on' retries='8191'/> </hyperv> </features> <cpu mode='custom' match='exact'>

23、 <model fallback='allow'>SandyBridge</model> </cpu> <clock offset='localtime'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> &

24、lt;timer name='hypervclock' present='yes'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='f

25、ile' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/home/image/win7-13.img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' func

26、tion='0x0'/> </disk> <disk type='file' device='floppy'> <driver name='qemu' type='raw'/> <source file='/home/image/virtio-win-drivers.vfd'/> <target dev='fda' bus='fdc'/> <address type='drive'

27、 controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/home/image/win7.iso'/> <target dev='hda' bus='ide&

28、#39;/> <readonly/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='usb' index='0' model='ich9-ehci1'> <address type='pci' domain='0x0000' bus=

29、9;0x00' slot='0x05' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' funct

30、ion='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0

31、x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/> </controller> <

32、controller type='pci' index='0' model='pci-root'/> <controller type='fdc' index='0'/> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0

33、x1'/> </controller> <controller type='virtio-serial' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </controller> <interface type='network'> <mac address=&#

34、39;52:54:00:34:da:63'/> <source network='default'/> <model type='rtl8139'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <target por

35、t='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <input type

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论